HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

multiboard trigger problem

06-28-2006, 01:35 AM#1
evilmapcreater
i have these 3 triggers to make my multiboard, it sets number of kills a player got. for some reason it ant working, the whole game the colume 2 stays 0 for all the rows even when i kill... please help


Trigger:
Untitled Trigger 001
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Multiboard - Create a multiboard with 2 columns and 12 rows, titled Score
Set Score = (Last created multiboard)
Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Red
Multiboard - Set the text for (Last created multiboard) item in column 1, row 2 to Blue
Multiboard - Set the text for (Last created multiboard) item in column 1, row 3 to Teal
Multiboard - Set the text for (Last created multiboard) item in column 1, row 4 to Purple
Multiboard - Set the text for (Last created multiboard) item in column 1, row 5 to Yellow
Multiboard - Set the text for (Last created multiboard) item in column 1, row 6 to Orange
Multiboard - Set the text for (Last created multiboard) item in column 1, row 7 to Green
Multiboard - Set the text for (Last created multiboard) item in column 1, row 8 to Pink
Multiboard - Set the text for (Last created multiboard) item in column 1, row 9 to Gray
Multiboard - Set the text for (Last created multiboard) item in column 1, row 10 to L B
Multiboard - Set the text for (Last created multiboard) item in column 1, row 11 to D G
Multiboard - Set the text for (Last created multiboard) item in column 1, row 12 to Brown


and then this one

Trigger:
add to score
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 1 (Red)
Collapse Then - Actions
Set kills[1] = (kills[1] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 2 (Blue)
Collapse Then - Actions
Set kills[2] = (kills[2] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Triggering unit)) Equal to Player 3 (Teal)
Collapse Then - Actions
Set kills[3] = (kills[3] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 4 (Purple)
Collapse Then - Actions
Set kills[4] = (kills[4] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 5 (Yellow)
Collapse Then - Actions
Set kills[5] = (kills[5] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 6 (Orange)
Collapse Then - Actions
Set kills[6] = (kills[6] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 7 (Green)
Collapse Then - Actions
Set kills[7] = (kills[7] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 8 (Pink)
Collapse Then - Actions
Set kills[8] = (kills[8] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 9 (Gray)
Collapse Then - Actions
Set kills[9] = (kills[9] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 10 (Light Blue)
Collapse Then - Actions
Set kills[10] = (kills[10] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 11 (Dark Green)
Collapse Then - Actions
Set kills[11] = (kills[11] + 1)
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
(Owner of (Killing unit)) Equal to Player 12 (Brown)
Collapse Then - Actions
Set kills[12] = (kills[12] + 1)
Collapse Else - Actions
Do nothing

and this one

Trigger:
add score to board
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to (String(kills[1]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String(kills[2]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(kills[3]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(kills[4]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(kills[5]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 6 to (String(kills[6]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 7 to (String(kills[7]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 8 to (String(kills[8]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 9 to (String(kills[9]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 10 to (String(kills[10]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 11 to (String(kills[11]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 12 to (String(kills[12]))

i dont get why it dont works...
06-28-2006, 03:13 AM#2
MercyfulJester
My guess is that the problem lies within the second trigger, "add to score". Maybe it's the "Owner of dying unit is playing" thingy, that is if you test the map by just clicking the test map button. I really have no idea, just a quick thought.
06-28-2006, 03:48 AM#3
StealthFox
Have you tried using AND in the conditions? Have you also tried to make the if then else chart flow?

Example:

(condition) AND (condition)

or in your case:

((Owner of (Dying unit)) slot status) Equal to Is playing
AND
(Owner of (Killing unit)) Equal to Player 1 (Red)

or even better:

The first condition of the trigger is:

((Owner of (Dying unit)) slot status) Equal to Is playing

This will make it a lot easier to read and you don't have to copy/paste as much.

Example:

If (condition)
then (actions)
else
If (next condition)
then (actions)
else
...
else
Do nothing

This will make the trigger run a lot faster because if it is for Player 1 then it will skip the rest of the else ifs. Just a tip.

Edit: Sorry, but I don't like using the "new" code tags.

One more thing, if you set a variable to something; use it. You did:

Set Score = (Last created multiboard)

Use it in context and the multiboard should run just fine (if you use the tips I wrote, it should work really well).
06-28-2006, 03:51 AM#4
evilmapcreater
nope, it ant that, i tested it with out that condition and tested it with other people... i dont no is happening! ill rep you if u gan find the problem
06-28-2006, 04:27 AM#5
harshateja
First off, your second trigger is so inefficent and can be done in one if statement:

Trigger:
Untitled Trigger 001
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Dying unit)) slot status) Equal to Is playing
Collapse Actions
Set kills[(Player number of (Owner of (Killing unit)))] = (kills[(Player number of (Owner of (Killing unit)))] + 1)

Your last trigger can be done in 3 lines using a loop.

Your Problem is very Obvious:

Your last trigger uses Last Created Multiboard but that trigger is not on the same stack as the trigger where you first initalized score. Thus, replace all of the Last Created Multiboards with your score variable and viola.
06-28-2006, 04:41 AM#6
StealthFox
Wow! That trigger is even more efficient than the one I told him to use. Oh well...I just hope he remembers to use else ifs when he really needs it.
06-28-2006, 04:56 PM#7
Xios
with the multiboard, to make it more efficient use

Trigger:
Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for (Last created multiboard) item in column 2, row 0 to (Name of (Player((Integer A))))

the row 0 mean that the text is in every row you have.

you can use this with the 3rd trigger you posted too
06-28-2006, 05:04 PM#8
Thunder_Eye
Instead of having the last trigger run every 1 sec, you can use a "run trigger" at the end of trigger 2 instead, dunno it's just a alternative, might not be good if it dies alot of units all the time
06-28-2006, 05:45 PM#9
evilmapcreater
ok... this is what i have now, but, when i test it, all the names in the multiboard are "player" including mine.. and i take out the condition "if owner of dieing units is = to playing" thing and it stays at 0 even when i kill...

Trigger:
add to score
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Set kills[(Player number of (Owner of (Killing unit)))] = (kills[(Player number of (Owner of (Killing unit)))] + 1)


Trigger:
Untitled Trigger 001
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Multiboard - Create a multiboard with 2 columns and 12 rows, titled Score
Set Score = (Last created multiboard)
Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Score item in column 1, row 0 to (Name of (Player((Integer A))))

Trigger:
add score to board
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer B) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Score item in column 2, row 0 to (String(kills[(Integer B)]))

and i added this

Trigger:
make board bigger
Collapse Events
Time - Elapsed game time is 1.00 seconds
Conditions
Collapse Actions
Multiboard - Set the width for Score item in column 1, row 0 to 5.00% of the total screen width
Multiboard - Set the icon for Score item in column 1, row 0 to ReplaceableTextures\CommandButtons\BTNKnight.blp
06-28-2006, 05:55 PM#10
MasterofSickness
Quote:
Trigger:
Trigger:
Collapse Untitled Trigger 001
Events
Time - Elapsed game time is 0.00 seconds
Collapse
Conditions
Collapse
Actions
Multiboard - Create a multiboard with 2 columns and 12 rows, titled Score
Set Score = (Last created multiboard)
Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
Collapse
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Multiboard - Set the text for Score item in column 1, row 0 to (Name of (Player((Integer A))))


Change this:
Trigger:
Multiboard - Set the text for Score item in column 1, row 0 to (Name of (Player((Integer A))))
To this:
Trigger:
Multiboard - Set the text for Score item in column 1, row (Integer A) to (Name of (Player((Integer A))))


EDIT:
And this:
Trigger:
Multiboard - Set the text for Score item in column 2, row 0 to (String(kills[(Integer B)])
To this:
Trigger:
Multiboard - Set the text for Score item in column 2, row (Integer B) to (String(kills[(Integer B)])


EDIT2:
And for further triggers:
row 0 always checks ALL ROWS !!!
column 0 always checks ALL COLUMNS !!!

That should do it...
Can perhaps also someone look at my thread to help me too?
Link: http://www.wc3campaigns.net/showthread.php?t=84734
06-28-2006, 06:28 PM#11
evilmapcreater
well...names are ok... but the the number of kills on the score board, say nothing. red (me worldedit when i test it) number of kills is 0 even when i kill, and every one elses i dont even see a zero.... not even for the computer...

heres my edited again triggers

Trigger:
Untitled Trigger 001
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Multiboard - Create a multiboard with 2 columns and 12 rows, titled Score
Set Score = (Last created multiboard)
Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Score item in column 1, row (Integer A) to (Name of (Player((Integer A))))
Multiboard - Set the text for Score item in column 2, row 1 to (String(kills[(Integer A)]))

Trigger:
add to score
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Set kills[(Player number of (Owner of (Killing unit)))] = (kills[(Player number of (Owner of (Killing unit)))] + 1)
Trigger - Run add score to board <gen> (checking conditions)

Trigger:
add score to board
Events
Conditions
Collapse Actions
Collapse For each (Integer B) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Score item in column 2, row (Integer B) to (String(kills[(Integer B)]))
06-28-2006, 07:34 PM#12
MasterofSickness
Do you test the map from WE or do you start WC3 and test it from there?
I suggest you always run WC3, search for your map and start it from there to test it, otherwise there are many problems.
I think you can also change some things that it works for running the test from WE, but AFAIK there are generally problems with this way of testing unless you change anything...
This could be your problem, but it also might be something else...
06-28-2006, 07:40 PM#13
Alevice
In the first trigger, you forgot to change row 0 to row Integer A

Trigger:
Untitled Trigger 001
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Multiboard - Create a multiboard with 2 columns and 12 rows, titled Score
Set Score = (Last created multiboard)
Multiboard - Change the color of the title for (Last created multiboard) to (100.00%, 80.00%, 20.00%) with 0.00% transparency
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for Score item in column 1, row (Integer A) to (Name of (Player((Integer A))))
Multiboard - Set the text for Score item in column 2, row (Integer A) to (String(kills[(Integer A)]))

And I think the other two trigger can be turned into this one:

Trigger:
add to score
Collapse Events
Unit - A unit Dies
Conditions
Collapse Actions
Set TempPlayerNumber = (Player number of (Owner of (Killing unit)))
Collapse Set kills[TempPlayerNumber] = (kills[TempPlayerNumber] + 1)
Multiboard - Set the text for Score item in column 2, row TempPlayerNumber to (String(kills[TempPlayerNumber]))
06-29-2006, 07:33 PM#14
evilmapcreater
thx guys i took all your advice and the thing dident work, but i tried taking the reincarnation out of the unit and it worked... so, i dont feel like starting another tread so.. how can i revive my unit using triggers? i see theres a revive hero but the unit ant a hero, i cant create another one of the same units at the potion of dieing unit cause i have triggers set for that units..