condition that checks 'integer'

MissKerrigan

Active Member
Reaction score
23
Hello,

I just can't remember how this is done:

Every next wave in my tower defense I set variable 'wave number' +1
Now I want to make a trigger that spawns a normal wave except if the integer is 10,20,30 etc...
Because every 10 waves a boss must be spawned

How do I check in a condition-comparison if the integer is 10,20,30 etc?

MissKerrigan
 

Dave312

Censored for your safe viewing
Reaction score
269
You need to use the "Mod" function. Mod (short for Modulo) returns the remainder when you divide two numbers. In your case, you want to check if your wave number is a multiple of 10 (i.e the remainder is 0) so you need to use "[Wave Number] Mod 10 = 0" as your condition
 

MissKerrigan

Active Member
Reaction score
23
thx Dave! I remember you did explain this to me before and I didn't understand, but now I do! haha
 

MissKerrigan

Active Member
Reaction score
23
Hey Guys,

I'm trying to create this trigger, did I made it correct now?

[/no parse]
Wave Respawn
Events
Unit - Any Unit dies
Local Variables
Conditions
(Number of Living units in Wave Units) == 0
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Wave Number == (10 mod 0)
Then
General - Wait 2.0 Game Time seconds
Trigger - Run Small Mutalisk Wave (Check Conditions, Don't Wait until it finishes)
Else
General - Wait 2.0 Game Time seconds
Trigger - Run Small Mutalisk Wave (Check Conditions, Don't Wait until it finishes)
Variable - Modify Hitpoints Creeps: + 1
Variable - Modify Wave Number: + 1
[/no parse]
 

MissKerrigan

Active Member
Reaction score
23
ohh I see! I'll try fix it

didn't my trigger shown up as trigger? I placed the no parse arround it
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
You're not supposed to place no parse around it. You're supposed to place wc3 around it.

Like this:

[wc3]
*Your trigger*
[/wc3]


Notice how only the second wc3 tag has a slash.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top