Kill counter trigger

810

New Member
Reaction score
1
Alright i've looked through the trigger editor in WE and i cant figure out how to do this.

I want to make a trigger that does this:

Player Red kills 50 units

no conditions i guess

Create one wisp at center of X region
reset kill counter to 0


I think that i have to use variables which im not too good at so if anyone could gimme a guiding hint please do.
 

Exide

I am amazingly focused right now!
Reaction score
448
Start by going into the Variable Editor, and create a new variable.
Name it something suiting like 'KillCounter', choose 'Integer' as it's type, and check the box saying 'array'. -Put a number in size (same as amount of players in your map. I.E: 4 players = 'size: 4').

Now you've got your KillCounter variable all set up.
All you need is a trigger:

Code:
Event:
A unit dies
Conditions

Actions
  set KillCounter[Player Number of (Owner of (Killing Unit))] = KillCounter[Player Number of (Owner of (Killing Unit))] + 1
    If KillCounter[Player Number of (Owner of (Killing Unit))] is Greater than or equal to 50 then do ....
else..
 

810

New Member
Reaction score
1
I got the variable set up but i dont understand this part.

KillCounter[Player Number of (Owner of (Killing Unit))] = KillCounter[Player Number of (Owner of (Killing Unit))] + 1
If KillCounter[Player Number of (Owner of (Killing Unit))] is Greater than or equal to 50 then do ....
else..

All i see is Set Killcounter(x) = (z)+(y)
 

Exide

I am amazingly focused right now!
Reaction score
448
Like this:

Trigger:
  • Set KillCounter[(Player number of (Owner of (Killing unit)))] = (KillCounter[(Player number of (Owner of (Killing unit)))] + 1)


Right-click, add new action, choose 'set variable'.
Choose your Kill Counter variable. Click on the array (KillCounter['The number in here is the array'] - cjhoose 'Player Number'.
Choose 'Owner of Unit' - Choose 'Event Response - Killing Unit'.

Then choose 'Arthimetic' (which means the basics of math. + - x / )
Then repeat the steps above.

-This will create a kill counter for each player in the map.
If you only have one player in the map, you don't need the array at all.
 

810

New Member
Reaction score
1
Wow thank you for the help, awesome +rep. Ill letcha know if it works.
 

810

New Member
Reaction score
1
it works awesome, thanks so much man i never woulda figured that out, but now i get it
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top