[Trigger] Need A Trigger and Multiboard

Status
Not open for further replies.
Level 5
Joined
Nov 13, 2007
Messages
99
Hello guys! My name is layzab0ne and I'm in need of a Multi board and a trigger. At first I want to make a Multi board. i need a trigger that: At first there's a multi board named kills and when ever someone kills a unit, you add one into the multi board. When there are a certain amount of points, like 50, create a unit. I really don't know how to do that. Please help!
 
a unit dies
set p1 = owner of killing unit
set kills[player number of p1] = kills[player number of p1]+1
run trigger "update board" checking conditions

(update board:)
loop from 1 to 12
set item in row loop collumn 2 to "kills[loop]"
if kills[loop]>=50 then
set kills[loop]=0
create unit for player(loop)
endloop

obviously not real code but it should help you.
 
That's not really hard...

First: setting up the multiboard:

  • Multiboard
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 2 columns and 9 rows, titled Status
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row 0 to 14.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row 0 to 6.00% of the total screen width
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to |c00aa0000Player Na...
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to |c00aa0000Kills|r
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 1) to (Name of (Player((Integer A))))
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Integer A) + 1) to 0
      • Multiboard - Show (Last created multiboard)
This is a simple multiboard for 8 players, to change the amount of players, change the number of rows in
  • Actions
    • Multiboard - Create a multiboard with 2 columns and 9 rows, titled Status
To 'Players + 1'

and

  • Actions
    • For each (Integer A) from 1 to 8, do (Actions)
Set the '8' to the number of players.

Then, the update-trigger:


  • MB Update
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Player number of (Owner of (Killing unit))) + 1) to (String(Kills[(Player number of (Owner of (Killing unit)))]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kills[(Player number of (Owner of (Killing unit)))] Equal to 50
        • Then - Actions
          • Set TempLoc = (Spawn-Area)
          • Unit - Create 1 Spawn-Unit for (Owner of (Killing unit)) at TempLoc facing Default building facing (270.0) degrees
          • Custom script: call RemoveLocation(udg_TempLoc)
        • Else - Actions
allright, this updates thet kills for every player and sets the amount of kills in the multiboard.

Variables:
"Kills": Integer Variable, array = number of players.
"TempLoc": Point variable, no array

Change "Spawn-Area" to the area where you want the unit to spawn
Change "Spawn-Unit" to the unit that will be spawned

Add the whole if/then/else-action for more kill-rewards and change the "Equal to 50" to the correct amount.
 
Thank you :]

You're welcome, if anything doesn't work, or isn't acting as it should, feel free to ask ;)

Ohh, by the way: I forgot this action:
  • Actions
    • Multiboard - Set the display style for (Last created multiboard) item in column 0, row 0 to Show text and Hide icons
Add it in the first trigger, wherever you want (as long as it is before the first action).
 
Status
Not open for further replies.
Back
Top