Triggers Triggering Triggers (On/Off Flag Question)

jedi8955

New Member
Reaction score
4
Sorry for the weird topic post, I couldn't think of a more straight-forward way to get to my question :)

I'm working on a Wintermaul Wars-esque TD and I'd like to implement a trigger system where if someone does not summon creeps, the enemy side gains a portion of their income. It'll prevent people from amassing cash for upgrades and other nifty bonuses.

Here's kind of what I was thinking, but I'm not sure if the trigger system would bork this up or not.

Trigger:
  • IncomeTimer
    • Events
      • Every 25.00 seconds of game time
    • Conditions
    • Actions
      • Player - Set Player 1 (red) Current Gold to ((Player 1 (Red) Current gold) + RedIncome_Int)
      • Player - Set Player 2 (Blue) Current Gold to ((Player 2 (Blue) Current gold) + BlueIncome_Int)
      • Run CreepPenalty_Red (checking conditions)
      • ;;There would be one of these for each player in the game
      • Wait 1.00 Seconds
      • Turn on CreepPenalty_Red


Trigger:
  • CreepPenalty_Red
    • Events
    • Conditions
    • Actions
      • Player - Set Player 2 (Blue) Current gold to ((Player 2 (Blue) Current gold) + (RedIncome_Int / 2))


Trigger:
  • CreepSpawn_Red
    • Events
      • A unit enters region RedCreeps
    • Conditions
    • Actions
      • Turn off CreepPenalty_Red
      • ;;other creep spawning actions here, unrelated to question


Basically, will a Turn off action stop a Run action from taking place, with conditions checked?

Oh, and I would love if there was a way to comment out code in the WC3 tag, the ;; was my attempt at doing so.

As always, thanks for any help with this :)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Basically, will a Turn off action stop a Run action from taking place, with conditions checked?

No, but you can use the action "Skip remaining actions"...

So, make an "If" in that trigger, and use the "Then" actions to do what you want, and in the "Else" field, put "Skip remaining actions" ;)

Oh, and I would love if there was a way to comment out code in the WC3 tag, the ;; was my attempt at doing so.

There isn't...
But there are comments in GUI, just use them ;)
 

jedi8955

New Member
Reaction score
4
No, but you can use the action "Skip remaining actions"...

So, make an "If" in that trigger, and use the "Then" actions to do what you want, and in the "Else" field, put "Skip remaining actions" ;)

Oh, cool. So instead of when a creep spawns it turns off a trigger, I'll have it set a variable to 0, default 1, then if variable = 1, it'll run the extra code. Go go binary :D


There isn't...
But there are comments in GUI, just use them ;)

Oh yeah, I've used those a bit. Should use them more, but I have like a 25 page design document accompanying the map :)

I was hoping for something to use on the forums here.

Thanks a bunch for your help =)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top