HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why does this GUI trigger not work?

07-05-2007, 03:24 AM#1
GamesSmash
Hello Wc3 editors,

I was wondering if anyone could tell me exactly why my trigger is displaying the leaderboard incorrectly. When the trigger runs, the leaderboard remains untouched, it is still 1.

Color = A string which holds different color strings
SheepKiller = The hero who should level up for each kill
SheepKillsLeaderBoard = The leaderboard which displays each players kills.
It looks like:
GamesSmash 1
Random 1
Player2 2


Here is the trigger:
Trigger:
Sheep dies
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to (==) Sheep
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of (Killing unit)) Less than (<) 99
Collapse Then - Actions
Hero - Set SheepKiller[(Player number of (Owner of (Killing unit)))] Hero-level to ((Level of SheepKiller[(Player number of (Owner of (Killing unit)))]) + 1), Show level-up graphics
Game - Display to PlayerGroup the text: ((Color[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + |r)) + has just killed a sheep!)
Leaderboard - Change the value for (Owner of (Killing unit)) in SheepKillsLeaderBoard to (Level of (Killing unit))
Else - Actions

I have looked this over so many times and couldn't find any errors.
+Rep for the first person to solve this dilemma.
07-05-2007, 03:42 AM#2
Tide-Arc Ephemera
Try this...
Trigger:
Leaderboard - Change value for (Owner of(Killing unit)) in SheepKillsLeaderBoard to (Level of SheepKiller[(Player number of(Owner of (Killing unit)))]

If that doesn't work, put it before the hero action and try this...

Trigger:
Leaderboard - Change value for (Owner of(Killing Unit)) in SheepKillsLeaderBoard to ((Level of Killing unit) + 1)

Try those two.
07-05-2007, 05:50 AM#3
GamesSmash
LOL.

I just realized that my variable SheepKiller wasn't set to any unit...
My mistake..

Closed...?