HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leaderboard trigger problems

11-08-2003, 11:46 PM#1
Vallian88
I have a leaderboard that shows all the players current points. You get points by killing other players units or towers. The problem is that I also have a trigger that randomly spwans a tower, 7 footmen, and 5 riflemen. I want the leaderboard to be created after everyone has had their units spwaned. Heres my triggers.

Spwan:
Event
Map Initialization
Actions
Trigger - Run Random Intiger <gen> (ignoring conditions)
Unit Group - Pick every unit in (Units in spwanregions[randomint]) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Scout Tower
Then - Actions
Wait 0.01 seconds
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
Camera - Pan camera for (Picked player) to (Center of spwanregions[randomint]) over 0.00 seconds
Unit - Create 1 Scout Tower for (Picked player) at (Random point in spwanregions[randomint]) facing Default building facing degrees
Unit - Create 7 Footman for (Picked player) at (Random point in spwanregions[randomint]) facing Default building facing degrees
Unit - Create 5 Rifleman for (Picked player) at (Random point in spwanregions[randomint]) facing Default building facing degrees

Leaderboard:
Actions
Leaderboard - Create a leaderboard for (All players) titled Points
Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0)
Leaderboard - Show (Last created leaderboard)

Now how do I make an event of when trigger "spwan" ends. I want that to be my event for trigger "Leaderboard".
Also my leaderboard dosen't seem to change when I make kills. Heres my trigger for that:

Events
Unit - A unit owned by Player 1 (Red) Dies
Unit - A unit owned by Player 2 (Blue) Dies
Unit - A unit owned by Player 3 (Teal) Dies
Unit - A unit owned by Player 4 (Purple) Dies
Unit - A unit owned by Player 5 (Yellow) Dies
Unit - A unit owned by Player 6 (Orange) Dies
Unit - A unit owned by Player 7 (Green) Dies
Unit - A unit owned by Player 8 (Pink) Dies
Conditions
(Unit-type of (Dying unit)) Equal to Footman
(Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
Actions
Set Points[(Player number of (Owner of (Killing unit)))] = Points[((Player number of (Owner of (Killing unit))) + 1)]
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Points[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order

Could someone tell me whats wrong with my triggers?
11-08-2003, 11:50 PM#2
AllPainful
Hmmm... well seems how your ENTIRE question was answered on This Board........

If it wasn't answered satisfactory then you post a reply to the already existing board, not make a new board that says the EXACT same thing...
11-08-2003, 11:56 PM#3
Ligature
Er... to trigger "Leaderboard" when your spawn trigger finishes, just put an action at the end of your spawn trigger that runs trigger "Leaderboard."

I'm not quite sure what you're doing in your spawn trigger, it looks like it's gonna cause some ugly loops and end up creating towers in every random region... but if it works, alrighty.

Oh and I think you want "Owner of Dying Unit" instead of "Owner of Triggering Unit" in your scorekeeping trigger... maybe?

Hope you get this worked out... sorry I couldn't be of more help.
11-08-2003, 11:57 PM#4
Vallian88
Uhh, opps. My internet was going really slow for some reason so I stopped it midway of loading the submit reply, waited and then did it again. Sorry about the second thread.:(
11-09-2003, 12:04 AM#5
AllPainful
Ah, I see. And fully understand, my internet acts funny every now and then too.