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

Variable Help

Status
Not open for further replies.
Level 3
Joined
Nov 8, 2009
Messages
46
Let's say i got 2 triggers
  • Trigger 1
    • Events
  • A unit cast a spell
    • Conditions
  • Spell equal to storm bolt
    • Actions
  • Set Caster = casting unit
  • Create 1 ghoul
  • Trigger 2
    • Events
  • A unit cast a spell
    • Conditions
  • Spell equal to blizzard
    • Actions
  • Set Caster = casting unit
  • Create 1 Footman
The point is can i use the same Variable Caster for all the triggers for my spells.

If 1 player cast storm bolt and another play cast blizzard at the same time, will there be a bug?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Yes, as long as there are no waits or timed effects in the spell.

E.g. if your spell picks every unit in a radius and applies a buff, it'll work fine for any number of simultaneous casts.

If you make a spell that applies a buff every 2 seconds for a minute, it will bug out - also if two units are using the same spell at the same time.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
just a notice, in your trigger the casting unit = triggering unit, what is (with triggerplayer) the only thing what dont changed until trigger end, allways same indifferent how much time running that trigger.

so my advice, if u need only the caster unit then dont store to variable and use triggering unit :)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
And as you might know this, Warcraft III uses a single-thread mechanism, that will never runs a trigger at the same time.
It will finish either on of them first before proceed to another trigger.

Therefore, it will not bug as long the spell/trigger has instant effect.
 
Status
Not open for further replies.
Top