• 🏆 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] Someone Help me make this MUI

Status
Not open for further replies.
Could someone make me this simple spell MUI?
  • Fatal Strike Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fatal Strike
    • Actions
      • Set TempLoc6 = (Position of (Triggering unit))
      • Unit - Pause (Triggering unit)
      • Unit - Make (Triggering unit) Invulnerable
      • Unit - Add FlyHeight to (Triggering unit)
      • Animation - Play (Triggering unit)'s death animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 game-time seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 300.00
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 200.00)
      • Animation - Play (Triggering unit)'s attack animation
      • Unit - Create 1 Dummy(Purple) for (Owner of (Triggering unit)) at TempLoc6 facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Fatal Strike(dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
      • Unit - Make (Triggering unit) Vulnerable
      • Unit - Unpause (Triggering unit)
      • Unit - Remove FlyHeight from (Triggering unit)
      • Custom script: call RemoveLocation (udg_TempLoc6)
Thanks

-BerZeKeR-
 
It gives me an error, Could you be more specific? Because if i would know how to do it i wouldn't ask.
  • Fatal Strike Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fatal Strike
    • Actions
      • Set TempLoc6 = (Position of (Triggering unit))
      • Custom script: local location udg_TempLoc6.
      • Unit - Pause (Triggering unit)
      • Unit - Make (Triggering unit) Invulnerable
      • Unit - Add FlyHeight to (Triggering unit)
      • Animation - Play (Triggering unit)'s death animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 game-time seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 300.00
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 200.00)
      • Animation - Play (Triggering unit)'s attack animation
      • Unit - Create 1 Dummy(Purple) for (Owner of (Triggering unit)) at TempLoc6 facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Fatal Strike(dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
      • Unit - Make (Triggering unit) Vulnerable
      • Unit - Unpause (Triggering unit)
      • Unit - Remove FlyHeight from (Triggering unit)
      • Custom script: call RemoveLocation (udg_TempLoc6)
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
  • Fatal Strike Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fatal Strike
    • Actions
      • Custom script: local location udg_TempLoc6.
      • Set TempLoc6 = (Position of (Triggering unit))
      • Unit - Pause (Triggering unit)
      • Unit - Make (Triggering unit) Invulnerable
      • Unit - Add FlyHeight to (Triggering unit)
      • Animation - Play (Triggering unit)'s death animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 game-time seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 300.00
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 200.00)
      • Animation - Play (Triggering unit)'s attack animation
      • Unit - Create 1 Dummy(Purple) for (Owner of (Triggering unit)) at TempLoc6 facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Fatal Strike(dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
      • Unit - Make (Triggering unit) Vulnerable
      • Unit - Unpause (Triggering unit)
      • Unit - Remove FlyHeight from (Triggering unit)
      • Custom script: call RemoveLocation (udg_TempLoc6)
Thats the correct way.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Nah dude, the custom script must be placed at the first line.
A local must be placed like that.

As a gui-spell this is not "leaky like hell". I dont really agreed with redscores ;)

However since you make it a local, you must null it at the end of the trigger.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
well... if you use the response "casting unit" instead of triggering unit, you would have to make a local unit yes. Thats why you always should use triggering unit since its already local. Casting unit for instance, is overwritten everytime a new casting event occurs.

I guess, you dont need to bother locals if the trigger is instant ran. (no wait actions/timers and such)
The risk of it running multiply times within that small matter of time is very very very small.

As for using a trigger like this in Jass, I suppose the most part of it would be made in "local" style.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
It should not... I think you ahve exchanged the Fatal Strike condition with the Fatal Strike (dummy) ?

Or you could just add in the condition: "Unit-type of triggering unit is Not Equal to Dummy(purple)"
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
  • Fatal Strike Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fatal Strike
    • Actions
      • Custom script: local location udg_TempLoc6.
      • Set TempLoc6 = (Position of (Triggering unit))
      • Wait 0.01 game-time seconds
      • Unit - Pause (Triggering unit)
      • Unit - Make (Triggering unit) Invulnerable
      • Unit - Add FlyHeight to (Triggering unit)
      • Animation - Play (Triggering unit)'s death animation
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 game-time seconds
      • Animation - Change (Triggering unit) flying height to 0.00 at 300.00
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 200.00)
      • Animation - Play (Triggering unit)'s attack animation
      • Unit - Create 1 Dummy(Purple) for (Owner of (Triggering unit)) at TempLoc6 facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Fatal Strike(dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Warden - Fan Of Knives
      • Unit - Make (Triggering unit) Vulnerable
      • Unit - Unpause (Triggering unit)
      • Unit - Remove FlyHeight from (Triggering unit)
      • Custom script: call RemoveLocation (udg_TempLoc6)
That shouldnt repeat the trigger anymore (if you pause a unit without a 0.01 wait before then the unit casts the spell over and over (because it never finishes the casting and like as it would be stunned while channeling it starts again)).
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Its meant for preventing double firing of an trigger, not for multithreading it, if the trigger is mult-fired the last instance will be overwritten during the duration of the current one, which can happen if a wait is in the trigger, the stuff will be rewritten, higher attack speed = more danger.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Remember to null the local.



I recon it can't happen at all, as warcraft is single threaded.

...

1) I don't think it is. If I recall correctly, there are like 70 threads open for triggers and a few hundreds more for stuff done internally.
2) Either way, as far as I know TriggerSleepAction() allows other triggers to be executed meanwhile, including the trigger itself.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Warcraft simulates multi threading by going from trigger to trigger, but I think it only happens when you use waits (as in waits and timers), and when there is a trigger with no waits, I think it would run it until the end and only then go to the next one on the queue.
 
Level 7
Joined
Jul 20, 2008
Messages
377
Ghost is right here. Basically, imagine that WC3 uses a queue of triggers. First in, first out. It will execute each trigger in that queue one by one. However, when a wait is used, the trigger is placed back in that queue. As long as the end time for the wait is greater than the current time, when it is the trigger's turn to be executed, it will be placed back into the queue. Otherwise, its wait "flag" is cleared and it goes on to execute the rest of its actions.

As long as you don't use waits or timers, triggers execute one-by-one in a queue system.
 
Status
Not open for further replies.
Top