Counting Dead Unit Type

21ToWin

New Member
Reaction score
5
How do I count the number of a dead unit type with an integer?

I'm not good with integers lol.
 

21ToWin

New Member
Reaction score
5
Is this right?

Code:
Creep Death Count Copy
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Dead_Creeps = (Dead_Creeps + 1)
 

21ToWin

New Member
Reaction score
5
I got that. But now how do I base a trigger off the variable. I want a condition based on if the Dead_Creeps integer hits 240,
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Create another trigger with no event, and add to your Creep Death Count Copy
trigger the action: Trigger - Run Creep Death Count 240 (Or whatever your trigger is called).

Add a condition to the new trigger, checking to see if Dead_Creeps == 240.
 

Cold

New Member
Reaction score
4
Trigger X

Code:
Event - 
A unit dies

Conditions -

Actions - 
Set (Your Variable) to ((Your Variable) + 1)
Trigger Run - Run Trigger Y checking conditions
-----------------
Code:
Trigger Y

Event -

Conditions - (Your Variable) is greater than or equal to (#)

Actions -
Whatever you're planning
 

21ToWin

New Member
Reaction score
5
I got the integer stuff working right but now i have a big problem. I'm using this for a TD.

Whenever a creep dies the Dead_Creep integers gets + 1.

But the game cant seem to count all the creeps dieing.

When 240 creeps died the integer only goes up to 142.

How can I fix this?
 

21ToWin

New Member
Reaction score
5
I got the integer stuff working right but now i have a big problem. I'm using this for a TD.

Whenever a creep dies the Dead_Creep integers gets + 1.

But the game cant seem to count all the creeps dieing.

When 240 creeps died the integer only goes up to 142.

How can I fix this?

If the units are dieing too fast for the integer to tally, what is another more efficient way to keep track of the number of a dead unit type?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
If the units are dieing too fast for the integer to tally, what is another more efficient way to keep track of the number of a dead unit type?

Trust me, that's not the problem here. Your computer can handle a LOT more than you think it can.

Do you have any other triggers that use the Dead_Creep variable?

Do you have any other triggers that activate when a unit dies?

Post all triggers that are related in any way to your problem.
 

LightChaosma

New Member
Reaction score
60
just a suggestion, since its aTD, i guess this is for moving on to the next level, why not count living units? when this hits 0, you start a timer, wich in term fires the next wave...

as for the dead problem...whats the init value of this intger? or ehm, add a line like this to your count trigger, aand kill the creeps slowly with abuilder with 9999 dmg

e
unit dies
c
owner of unit = creepowner
a
set counter = counter+1
game - display the to all players the message - unit killed
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top