HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Another question...

08-12-2005, 02:04 PM#1
Skwee
I'm sure Lord Vexorian will know how to solve this one.

I have 400 circles of power on my map, and I want a multiboard to show percents of the total each player has so I set it up like...

Quote:
Events
Time - Elapsed game time is 0.00 seconds

Actions
Multiboard - Create a multiboard with 3 columns and 6 rows, titled Paint Percentage
Multiboard - Set the width for (Last created multiboard) item in column 0, row 0 to 8.00% of the total screen width
Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to Total Percent
Multiboard - Set the display style for (Last created multiboard) item in column 0, row 0 to Show text and Hide icons
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to ((String(((CirclesOfPower[(Integer A)] / 400) x 100))) + %)
Multiboard - Set the text for (Last created multiboard) item in column 1, row (Integer A) to (Name of (Player((Integer A))))
Multiboard - Show (Last created multiboard)
Multiboard - Maximize (Last created multiboard)

And to update it:

Quote:
Events
Time - Every 0.25 seconds of game time

Actions
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions

Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to ((String(((CirclesOfPower[(Integer A)] / 400) x 100))) + %)

Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to ((String((((CirclesOfPower[1] + CirclesOfPower[2]) + (CirclesOfPower[3] + CirclesOfPower[4])) / (400 x 100)))) + %)


Multiboard - Set the text for (Last created multiboard) item in column 3, row (Integer A) to (String(CirclesOfPower[(Integer A)]))
Multiboard - Set the text for (Last created multiboard) item in column 3, row 5 to ((String((((CirclesOfPower[1] + CirclesOfPower[2]) + (CirclesOfPower[3] + CirclesOfPower[4])) + (0 x 0)))) + <Empty String>)

All that shows up is zeros all through column 2... help please?

EDIT: I just want to clarify that my problem is in the Column 2 parts of the trigger in bold
08-12-2005, 02:36 PM#2
duckduck
in the second trigger, you use last created multiboard, instead of that, set the multiboard to a variable in the first trigger and use that instead of last created multiboard for the second
08-12-2005, 02:49 PM#3
Skwee
I only have one multiboard... I only create one, so i can refer to it like that.
08-12-2005, 03:29 PM#4
duckduck
but i think the (last created ____) only refers to in the trigger.
if i created a unit in one trigger, i can't use last created unit to get that same unit in another
08-12-2005, 03:36 PM#5
Skwee
... the only part of the trigger that doesn't work is in column 2, so no you're wrong
08-12-2005, 03:37 PM#6
oNdizZ
yes you can.

edit: (yes you can was meant for duckduck)
08-12-2005, 03:54 PM#7
Zoxc
You need to do like this for each player.

For Allplayer Integer A do

For 1 to 400 Integer B do

If Player Own CirclesOfPower[Integer B] Then

set PlayerHas[Integer A] = PlayerHas[Integer A]+1 (ArrayOfIntegers)

endloop

endloop

Then you calculate it from PlayerHas.
08-12-2005, 05:39 PM#8
Skwee
what? i know how many circles of power each player has, the problem is that for somereason the math in the trigger doesnt work right and it comes out with 0 everytime in column 2
08-12-2005, 05:54 PM#9
oNdizZ
just so you know, WE rounds off in a bit different way than you do with money.
Converting Real to Integer
0.99 gives 0
1.00 gives 1
1.01 gives 1


besides, dividing by (400 x 100), why not just dividing by 40000?
one other little thing ive noticed.

Quote:
Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to ((String((((CirclesOfPower[1] + CirclesOfPower[2]) + (CirclesOfPower[3] + CirclesOfPower[4])) / (400 x 100)))) + %)

this one was from the periodic event.

Quote:
Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to ((String(((CirclesOfPower[(Integer A)] / 400) x 100))) + %)

and this one from the elapsed game time event.

the one below is first dividing by 400 and after that multipling by 100. and the other one isnt.
08-12-2005, 06:23 PM#10
Skwee
Quote:
Originally Posted by oNdizZ
just so you know, WE rounds off in a bit different way than you do with money.
Converting Real to Integer
0.99 gives 0
1.00 gives 1
1.01 gives 1

I didn't realise WE rounded like that.

Quote:
Originally Posted by oNdizZ
besides, dividing by (400 x 100), why not just dividing by 40000?
one other little thing ive noticed.

If you hadn't realised, i'm trying to find a percent. The total is 400 . If the player had 100 COP's then 100/400=.25 x 100 = 25 %

Quote:
Originally Posted by oNdizZ
Quote:
Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to ((String((((CirclesOfPower[1] + CirclesOfPower[2]) + (CirclesOfPower[3] + CirclesOfPower[4])) / (400 x 100)))) + %)

this one was from the periodic event.

Quote:
Multiboard - Set the text for (Last created multiboard) item in column 2, row (Integer A) to ((String(((CirclesOfPower[(Integer A)] / 400) x 100))) + %)

and this one from the elapsed game time event.

the one below is first dividing by 400 and after that multipling by 100. and the other one isnt.

That shouldn't effect it.
08-12-2005, 08:55 PM#11
oNdizZ
X / (400 * 100) = X / (40000)

thats what i was trying to point out. the right one is 'slightly' faster.
08-12-2005, 09:03 PM#12
Skwee
Quote:
Originally Posted by oNdizZ
X / (400 * 100) = X / (40000)

thats what i was trying to point out. the right one is 'slightly' faster.

lol, it's not a noticible difference.
08-12-2005, 09:09 PM#13
oNdizZ
thats why i said 'slightly'
if you noticed.
08-12-2005, 10:22 PM#14
Vexorian
Last Created Multiboard And every Last Created XXXX are global variables
08-12-2005, 10:37 PM#15
Skwee
Quote:
Originally Posted by Lord Vexorian
Last Created Multiboard And every Last Created XXXX are global variables

do you have solution for my problem, vex? im kinda depending you for this one lol