• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with trigger

Status
Not open for further replies.
Level 5
Joined
Apr 12, 2009
Messages
125
I've made a "Steal" mode in my map. It works but... If you don't want that mode, what to do?

Well, here's the triggers.

  • T1 Lose
    • Events
      • Unit - A unit enters RedNBlue End <gen>
    • Conditions
      • ((Owner of (Entering unit)) Not equal to Player 1 (Red)) and ((Owner of (Entering unit)) Not equal to Player 2 (Blue))
    • Actions
      • Unit - Remove (Entering unit) from the game
      • Set Lives_T1 = (Lives_T1 - 1)
      • Trigger - Run Steal <gen> (checking conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Lives_T1 Equal to 0
        • Then - Actions
          • Wait 2.00 seconds
          • Player Group - Pick every player in Team1 and do (Actions)
            • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
  • Steal
    • Events
    • Conditions
    • Actions
      • If (((Owner of (Entering unit)) Equal to Player 1 (Red)) or ((Owner of (Entering unit)) Equal to Player 2 (Blue))) then do (Set Lives_T1 = (Lives_T1 + 1)) else do
      • If (((Owner of (Entering unit)) Equal to Player 3 (Teal)) or ((Owner of (Entering unit)) Equal to Player 4 (Purple))) then do (Set Lives_T2 = (Lives_T2 + 1)) else do
      • If (((Owner of (Entering unit)) Equal to Player 5 (Yellow)) or ((Owner of (Entering unit)) Equal to Player 6 (Orange))) then do (Set Lives_T3 = (Lives_T3 + 1)) else do
But how do I remove this line?
  • Trigger - Run Steal <gen> (checking conditions)
Or is there another way to do this?

+Rep if you help me! :)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,196
Make a boolean variable.
Set it to which modes are enabled. I advise setting it to false on map initialization and then when they choose steal mode (via host entered chat command in maps like in DotA or via dialog like in SWAT AM) you set the boolean to true.
In the code which normally executes the steal function, you then put the call inbetween a conditional statement which you pass the boolean.

The pesudo code should look somewhat like this.
If steal mode is enabled.
Run steal code.
end if.

Steal mode is enabled when the boolean is true.
The boolean is set to true when steal mode is choosen otherwise it is false so the condition will not run.

Hope this helps.
 
Level 5
Joined
Apr 12, 2009
Messages
125
Make a boolean variable.
Set it to which modes are enabled. I advise setting it to false on map initialization and then when they choose steal mode (via host entered chat command in maps like in DotA or via dialog like in SWAT AM) you set the boolean to true.
In the code which normally executes the steal function, you then put the call inbetween a conditional statement which you pass the boolean.

The pesudo code should look somewhat like this.
If steal mode is enabled.
Run steal code.
end if.

Steal mode is enabled when the boolean is true.
The boolean is set to true when steal mode is choosen otherwise it is false so the condition will not run.

Hope this helps.

Thanks for your comment, that'll helps pretty much! +rep to you
 
Status
Not open for further replies.
Top