• 🏆 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!

[Trigger] General trigger question

Status
Not open for further replies.
Level 8
Joined
Sep 24, 2007
Messages
300
General trigger question and spell prevent

Is there a list of temporar variables and how long they last?

Example: How long (Triggering player) lasts? Does it delete after "Wait" action?

Do all those variables (triggering player, triggering unit, last created unit etc etc) delete after "wait" action?




-----------------------------------------------------------------------
EDIT: since I opened the topic, I will ask another question

How to prevent hero to cast a spell? Atm trigger looks like this:

  • Base Invulnerable prevent spells
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in BaseFountain <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to (Picked unit)
            • Then - Actions
              • Unit - Order (Picked unit) to move (Position of Fountain 0075 <gen>)
              • Wait 0.50 seconds
              • Unit - Order (Picked unit) to Stop
            • Else - Actions
I tried to prevent spell by issuing movement order but it doesn't work for all spells.

All I need is some kind of silence or spell effect prevention in a specific rect.
 
Last edited:
Level 21
Joined
Aug 21, 2005
Messages
3,699
Triggering player, triggering unit last for the whole trigger.
Last created unit lasts until another unit is created (well, it's just overwritten).
Other functions such as "dying unit" and "casting unit" disappear after a wait action.

-----

Why don't you simply use silence? Or that firelord hero spell? (don't know the name, incinerate or something?)

You also have a wait action inside your pick every unit action. Try to avoid that because if I recall correctly, this is what happens if you use it:

e.g. 5 units picked:
Unit 1 moves
Wait 0,5 seconds
Stop unit 1
Unit 2 moves
Wait 0,5 seconds
Stop unit 2
Unit 3 moves
...
 
Level 8
Joined
Sep 24, 2007
Messages
300
Thanks for the first part El.
____________________________

Yes, that wait 0.5 sec is just to stop hero from moving to fountain, movement order itself should stop the casting. :D The problem is (I think) that only spells with more then 0 sec casting are stopped, but those with 0 seconds casting release effect before movement order. I think that's the problem, but ofc I dunno how to fix it (and I am not making cast time for every spell!).

I guess will make dummy to cast silence every time someone enters, make a big duration and then remove the buff after unit leaves.
I just though there is more simple way.
 
Level 8
Joined
Sep 24, 2007
Messages
300
hmm, dunno guys something is still not working. I am posting the trigger.

What it does? After you type -unstuck your hero is moved in base after 1 minzte, but only if you DON'T move it or order it to cast a spell. I use this, because some spells can stuck hero in trees or cliffs. Move and spell orders are checked, so player can't abuse the command and freely move around.

The problem is, the hero is not moved in base. Displayed messege is shown.
Basic trigger for all players

  • Unstuck
    • Events
      • Player - Player 1 (Red) types a chat message containing -unstuck as An exact match
      • Player - Player 2 (Blue) types a chat message containing -unstuck as An exact match
      • Player - Player 3 (Teal) types a chat message containing -unstuck as An exact match
      • Player - Player 4 (Purple) types a chat message containing -unstuck as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -unstuck as An exact match
      • Player - Player 6 (Orange) types a chat message containing -unstuck as An exact match
      • Player - Player 7 (Green) types a chat message containing -unstuck as An exact match
      • Player - Player 8 (Pink) types a chat message containing -unstuck as An exact match
      • Player - Player 9 (Gray) types a chat message containing -unstuck as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -unstuck as An exact match
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • (Unit-type of (Picked unit)) Not equal to Item carrier
            • Then - Actions
              • Set UnstuckHero[(Player number of (Triggering player))] = (Picked unit)
              • Game - Display to (Player group((Triggering player))) the text: Your hero will be u...
              • Set UnstuckCheck[(Player number of (Triggering player))] = 1
              • Set UnstuckPlayer[(Player number of (Triggering player))] = (Triggering player)
              • Wait 3.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 1 (Red)
                • Then - Actions
                  • Trigger - Turn on Player1 Unstuck <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 2 (Blue)
                    • Then - Actions
                      • Trigger - Turn on Player2 Unstuck <gen>
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 3 (Teal)
                        • Then - Actions
                          • Trigger - Turn on Player3 Unstuck <gen>
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 4 (Purple)
                            • Then - Actions
                              • Trigger - Turn on Player4 Unstuck <gen>
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 5 (Yellow)
                                • Then - Actions
                                  • Trigger - Turn on Player5 Unstuck <gen>
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 6 (Orange)
                                    • Then - Actions
                                      • Trigger - Turn on Player6 Unstuck <gen>
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 7 (Green)
                                        • Then - Actions
                                          • Trigger - Turn on Player7 Unstuck <gen>
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 8 (Pink)
                                            • Then - Actions
                                              • Trigger - Turn on Player8 Unstuck <gen>
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 9 (Gray)
                                                • Then - Actions
                                                  • Trigger - Turn on Player9 Unstuck <gen>
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • UnstuckPlayer[(Player number of (Triggering player))] Equal to Player 10 (Light Blue)
                                                    • Then - Actions
                                                      • Trigger - Turn on Player10 Unstuck <gen>
                                                    • Else - Actions
              • Wait 57.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UnstuckCheck[(Player number of (Triggering player))] Equal to 1
                • Then - Actions
                  • Unit - Move UnstuckHero[(Player number of (Triggering player))] instantly to (Position of Fountain 0075 <gen>)
                  • For each (Integer A) from 1 to 10, do (Actions)
                    • Loop - Actions
                      • Set UnstuckPlayer[(Integer A)] = Player 11 (Dark Green)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UnstuckCheck[(Player number of (Triggering player))] Equal to 0
                    • Then - Actions
                      • Do nothing
                    • Else - Actions
            • Else - Actions

Example of trigger for Player 1 (there are 10 triggers for each player)

  • Player1 Unstuck
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Set UnstuckCheck[1] = 0
      • Wait 57.00 seconds
      • Trigger - Turn off (This trigger)
 
Level 8
Joined
Sep 24, 2007
Messages
300
there is another bug, when you use blink with item and blink on rect, that throws you out of base, instead of being moved on the play map it moves you in center of the playable area

that's actually the only reason, but I will use your idea if I won't find the bug
 
Status
Not open for further replies.
Top