• 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.

Simple Immume Question

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
I would like to make a very simple immume spell when a unit enter region they get immunity for a few seconds from all attacks. But this will not work with multiple peopel is there a way to make this multiplayer friendly at all?
  • Events
    • Unit - A unit enters Region 483 <gen>
    • Conditions
    • Actions
      • Unit - Make (Entering unit) Invulnerable
      • Wait 5.00 seconds
      • Unit - Make (Entering unit) Vulnerable
 
Level 7
Joined
Nov 19, 2007
Messages
253
I think you need jass and use local units.. I had same problem why my skills remade them with jass and now everhtings working
 
Level 10
Joined
Apr 3, 2006
Messages
535
hmm so far it seems to be working uses triggering unit, i didnt think this would but so far it is. Thanks both of you +rep
 
Level 22
Joined
Jun 23, 2007
Messages
3,242
get rid of that wait. instead use this: (Im 90% sure this is MUI/MPI)
Events- Unit enters Region
Actions - Set entering unit as EnteringUnit (A variable) make EnteringUnit vulnerable
Trigger-Run trigger 2

TRIGGER 2 (make sure it is initialy OFF)
Events - Every 5 seconds
Conditions - none
Actions - Make EnteringUnit vulnerable
after that, im pretty sure you have to destroy the variable to avoid leaks, not sure though. but this should work.
 
Level 12
Joined
Aug 22, 2008
Messages
911
I'd use a timer.
  • Unit - Make (Triggering Unit) Invulnerable
  • Set Unit - (Triggering Unit)
  • Countdown Timer - Start timer as a one-shot timer that will expire in 5 seconds
  • Events
    • Time - timer expires
  • Actions
    • Unit - Make Unit Vulnerable
    • Set Unit - No unit
 
get rid of that wait. instead use this: (Im 90% sure this is MUI/MPI)
Events- Unit enters Region
Actions - Set entering unit as EnteringUnit (A variable) make EnteringUnit vulnerable
Trigger-Run trigger 2

TRIGGER 2 (make sure it is initialy OFF)
Events - Every 5 seconds
Conditions - none
Actions - Make EnteringUnit vulnerable
after that, im pretty sure you have to destroy the variable to avoid leaks, not sure though. but this should work.

Not MUI nor MPI. The variable would be overriden when another unit comes in.


I'd use a timer.
  • Unit - Make (Triggering Unit) Invulnerable
  • Set Unit - (Triggering Unit)
  • Countdown Timer - Start timer as a one-shot timer that will expire in 5 seconds
  • Events
    • Time - timer expires
  • Actions
    • Unit - Make Unit Vulnerable
    • Set Unit - No unit

Same as above.

(Triggering Unit) does work because it is the only Event Response variable that does not lose its value after a wait, as far as I know. And it won't be overridden if the trigger runs more than once at the same time.
 
Level 10
Joined
Apr 3, 2006
Messages
535
i have tested triggering unit with multi units and it seems to work okay

  • Events
  • Unit - A unit enters Region 483 <gen>
  • Conditions
  • Actions
  • Unit - Make (Triggering unit) Invulnerable
  • Wait 5.00 seconds
  • Unit - Make (Triggering unit) Vulnerable
 
  • Thing
  • Unit enters Region 483(gen)
  • Conditions
  • Actions
  • Custom Script: local unit udg_Invulnerable
  • set udg_Invulnerable = (Entering_Unit)
  • Make (Invulnerable) Invulnerable
  • Wait 5.00 second
  • Make (Invulnerable) Vulnerable
  • Custom Script: set udg_Invulnerable = null
That should do.

Global shadowing was fixed in 1.24, if I'm not wrong...
 
Status
Not open for further replies.
Top