• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Multiusable/simultanously usable triggers

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
How does this work, i have never figuerred it out. Can all triggers be used at the same time or does it just include a few? could some1 explain this so i don't end up with a map where everything crashes if 2 units uses a spell simultanously.

(With mulitusable triggers i mean if you trigger a spell, you can use the spell with lots of units at the same time without anything happening due to the trigger can only handle a action at a time.)
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
You can't execute 2 triggers at the "exact" same time. However, if you use a "wait" function you give other triggers that should be executed "right after" this trigger the opportunity of being executed.

For that reason many GUI spells have problems related to multi-instanceableness (if that's a word) where you can't have 2 units cast the spell "at the same time".

For example: if you have following trigger:

  • Actions
    • Unit - Create a unit...
    • Unit - Kill (last created unit)
    • Wait 5 seconds
    • Unit - Revive (last created unit)
If this trigger runs, it will come at the point of waiting 5 seconds. If within those 5 seconds the trigger runs again, the "last created unit" will no longer refer to the "first" unit that was created but to the 2nd unit. Then, when the 5 seconds are elapsed, it revives (2nd unit) and will never revive (first unit).

This is hard to solve in GUI, and usually even impossible.
 
Level 6
Joined
May 31, 2008
Messages
218
You can't execute 2 triggers at the "exact" same time. However, if you use a "wait" function you give other triggers that should be executed "right after" this trigger the opportunity of being executed.

For that reason many GUI spells have problems related to multi-instanceableness (if that's a word) where you can't have 2 units cast the spell "at the same time".

For example: if you have following trigger:

  • Actions
    • Unit - Create a unit...
    • Unit - Kill (last created unit)
    • Wait 5 seconds
    • Unit - Revive (last created unit)
If this trigger runs, it will come at the point of waiting 5 seconds. If within those 5 seconds the trigger runs again, the "last created unit" will no longer refer to the "first" unit that was created but to the 2nd unit. Then, when the 5 seconds are elapsed, it revives (2nd unit) and will never revive (first unit).

This is hard to solve in GUI, and usually even impossible.

Can you solve this with jass? just curious.
 
I don't know where you found revive unit. I looked for it but didn't see it. Anyway, here's it with local variables.
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location p = GetUnitLoc(u)
local real facing = GetUnitFacing(u)
local integer i = GetUnitTypeId(u)
local player X = GetOwningPlayer(u)
call KillUnit(u)
call TriggerSleepAction(5.)
call CreateUnitAtLoc( X, i, p, facing) 
set X = null
set u = null
call RemoveLocation(p)
endfunction
 
Status
Not open for further replies.
Top