• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] questions about wait and other things

Status
Not open for further replies.
Level 5
Joined
Jan 2, 2013
Messages
84
I tried the wait trigger. its pretty good, but what are the side effects of multiplayer?
lets say I have 3 of the same guy use it and the wait kicks in, will the all of the guy besides the last guy wait trigger gets broken?

second question(other things)
I see a lot of other ppl's triggers without an event, what activates the trigger?

and is mui meant for multiplayer, while gui meant for single player?
 
Level 5
Joined
Oct 16, 2007
Messages
67
1)
I don't know what you mean with "wait trigger" but if you mean you use wait then there is not realy a Problem.
If a wait is hit the Trigger stops running for that amount of time, a singel Trigger can be running several times.
So if you have for example:
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Wait 5.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Hide revival graphics
That will work fine, but if you asign Variable values these will be overwritten if the Trigger fires again before the wait time is over.
  • Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set VariableSet death = (death + 1)
      • Wait 5.00 seconds
      • Game - Display to (All players) the text: (This was death: + (String(death)))
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Hide revival graphics
So here if a unit dies before the wait time was over a 2 will be visible instead of a 1.
The Values of Triggering Unit, Dying Unit, Triggering Player or whatever the event offers will stay in that Trigger Run. This is why this is possible.
A Trigger can run several times with different values in these variables.

How Triggers run exactly and where they break for other Triggers is a more Advanced and depending on how deep you are into Programming/Triggering hard to understand. However you can find a lot of information about this on this site.

2)
You can run Triggers using.
  • Trigger
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Trigger - Run OtherTrigger <gen> (checking conditions)
The variables (Triggering Unit, Dying Unit, Triggering Player or whatever the event offers) are then available in this Trigger as well.
  • OtherTrigger
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: I run.
Alternatively you can add Events to Triggers later.
  • Trigger
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Trigger - Add to OtherTrigger <gen> the event (Unit - A unit Dies)
This can be usefull if you need specific unit events like unit comes in range.

3)
MUI is short for Multi User Interactable, meaning a spell/system can run more then once at the same time.
As example in Maps where Heros can be more then once on the Map, if you work with custom spells you make them available so that the spell can run once per Player at the same time.
Some spells may need to run for several units at the same time. The standard Blizzard skills are MUI as far as i know but if you make something custom you have to watch out.

GUI is Graphical User Interface and refers to the way you code your Map.
The Trigger you see above are GUI, alernatively you can use JASS or LUA.
Then you can't click around and don't get these texts where you fill the gaps but instead you have to write everything like this.
Code:
function Trig_Trigger_Actions takes nothing returns nothing
    call TriggerSleepAction( 5.00 )
    call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(GetPlayableMapRect()), false )
endfunction
You can see this Code if you are in the Trigger Editor in "Edit" --> "Convert to Custom Text."



I hope this ansewered your Questions, but I can totaly understand if things are a bit Confusing, especialy a Trigger running serveral times at the same time.
 
Last edited:
GUI/MUI is explained here: Elemental Coder Guide

Something like (Triggering unit), (Dying unit) or (Casting unit), are event responses. They're useable, depending on which event fired the trigger. Casting, Unit Death, ...
Some event responses get "lost" or are not useable after "Waits". Something like (Triggering unit) is even useable after wait. That is good reason to use (Triggering unit) over some others.
You might read somewhere that all responses except (Triggering unit) is unsafe to use, but that's not true. Here's some documented behaviour which responses get lost: Event Response Myths

If trigger gets broken if multiple players fire it, and waits are used, depends on the code design. If for example only one global variable is used before and after the wait, and ALL players would use it, then yes, it could bug. Else this global variable will only hold the last written value, so only one value for one player at a time.

There are actions to run Triggers, and to even register events to them in mid-game. So triggers can also run, even if there's no event from start on.
 
Status
Not open for further replies.
Top