HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

CTF Leaderboard

04-23-2005, 04:05 PM#1
Limb_Smasher
Ok for this one game i have your doing this ctf kinda thing. and when i try to return the flag it doesnt give me a point on the leaderboard.
The first trigger goes like this:

Events
Conditions
Actions
Leaderboard - Destroy (Last created leaderboard)
Wait 1.00 seconds
Leaderboard - Create a leaderboard for (All players) titled Flags Captured
Set CTFLeader = (Last created leaderboard)
Player Group - Pick every player in (All players) and do (If (((Picked player) slot status) Equal to Is playing) then do (Leaderboard - Add (Picked player) to CTFLeader with label (Name of (Picked player)) and value 0) else do (Do nothing))
Leaderboard - Sort CTFLeader by Value in Descending order
Leaderboard - Show CTFLeader
For each (Integer A) from 1 to 12, do (Set Flags[0] = 0)

Then to get a point....:

CTF Getting a Point 1
Events
Unit - A unit enters flag1 <gen>
Conditions
(Triggering unit) Equal to Runner
(BlueFlag is owned) Equal to True
Actions
Set Flags[(Player number of (Owner of (Triggering unit)))] = (Flags[(Player number of (Owner of (Triggering unit)))] + 1)
04-23-2005, 07:06 PM#2
Anitarf
After you change your variable, you must also set the leaderboard value to that variable. The leaderboard value doesn't update with the variable all by itself just because you set it to that variable at start. Whenever you set it to be equal to a variable, you set it to that variable's current value.

Also, "blue flag is owned" is not such a good idea. If you leave it like that, then all a team has to do to score is grab the flag and at the same have a runner enter the flag1 region. When the runner will enter that region, it will check if the flag is owned (which it is, even if not by the same hero that entered the region) and award points. Use the boolean condition "hero - hero has item" instead.
04-23-2005, 07:10 PM#3
sweet5
when does this trigger run? I dont see any events listed and why are u destroying the previous leader board? what was the previous leaderboard?
04-24-2005, 01:37 AM#4
Limb_Smasher
Oh umm this trigger is run from another trigger. for example when some does some then run those triggers.... and I destory the previous leaderboard because it shows players kills and thats not necessary....
04-26-2005, 02:33 AM#5
Guest
um... i don't know if you understand what to do, so i'll show you the triggers
if this doesn't make sense, tell me and ill try to explain it in a better way

Trigger 1
Code:
Events
  Unit enters region
Conditions
  Unit type = Runner
  BlueHasFlag = True
Actions
  Set Flags[(Player number of (Owner of (Triggering unit)))] = (Flags[(Player number of (Owner of (Triggering unit)))] + 1)
  Run Trigger 2
Trigger 2
Code:
Events
Conditions
Actions
  For integer A, 1-2 do:
    Change value of Player 2 -> Flags[Integer A] in LEADERBOARD