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

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
  • ShaTari Fey Dragon Explode
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Shat'ari Fey Dragon
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Dying unit) using war3mapImported\Arcane Explosion.mdx
      • Unit - Create 1 ShaTari Dummy for (Triggering player) at (Position of (Dying unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Hello guys, it's been a while now back i'm back for another trigger enhancement again.... Or rather does this trigger even work perfectly as an GUI type of trigger? I just want for someone to check if this is an actual working trigger, and if anyone has any recommendations to enhance this trigger then i would gladly appreciate to hear all of it. If anyone wants a detail of what this trigger is for, this trigger is made to make a dummy unit to the position of the dying unit and makes the dummy unit to war stomp to the position of the dying unit.
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
You might replace Dying Unit with Triggering Unit.
Or better: save triggering unit / last created unit into a variable and use it

For more optimization, you can replace your location with real values, but that requires custom script.
This is an example:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering Unit)) Equal to Shat'ari Fey Dragon
  • Actions
    • Custom script: local unit u = GetTriggerUnit()
    • Custom script: local unit dummy
    • Custom script: local real x = GetUnitX(u)
    • Custom script: local real y = GetUnitY(u)
    • Custom script: call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Arcane Explosion.mdx", u, "origin"))
    • Custom script: set dummy = CreateUnit(GetPlayerId(GetTriggerPlayer()), 'YourUnitType', x, y, 0.0)
    • Custom script: call IssueImmediateOrder(dummy, "YourOrder")
    • // Expiration Timer in jass
    • Custom script: set u = null
    • Custom script: set dummy = null
 
Level 9
Joined
Apr 22, 2020
Messages
430
Hey guys, sorry it took long for me to respond. I'm having a little problem regarding about my trigger. Just take a look at this.
  • ShaTari Fey Dragon Explode
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Shat'ari Fey Dragon
    • Actions
      • Set ShatariPointExplode = (Position of (Triggering unit))
      • Unit - Create 1 ShaTari Dummy for (Owner of (Triggering unit)) at ShatariPointExplode facing Default building facing degrees
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using war3mapImported\Arcane Explosion.mdx
      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_ShatariPointExplode)
When you as the player have this unit, the trigger works. But if the AI player has this unit, the trigger doesn't work. What exactly did i do wrong here?
 
Level 9
Joined
Apr 22, 2020
Messages
430
Does the AI player actually exist? Or is it an empty slot? Because Owner of Triggering Unit would return null or some unwanted value in this case
Of course. The AI player is player 2 which is blue and the AI is actually custom, edited inside the AI editor. But i have already made the necessary set ups that is in need of my custom AI so i don't really see a problem about my AI. The only problem is that when that type of unit that is controlled or is owned by the AI player, the trigger of the dummy casting the "dummy war stomp" doesn't actually work for them, but it unexpectedly works for me as the "actual player" which is quite odd in this case. Though the create special effect works on the AI but the rest of the trigger doesn't really work, specifically where it creates the dummy unit and make it cast the war stomp ability.

Edit: I almost want to give up right now. What the heck is the problem with the trigger? I tested in the WE and if i try to kill my own Sha'Tari Fey Dragon the trigger works where it creates the dummy unit and make it cast war stomp. But on the other hand, If the AI loses the Sha'Tari Fey Dragon it only makes the special effect and creates the dummy unit but never casts the war stomp. And once again i want someone to know what's the problem here.
  • ShaTari Fey Dragon Explode
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Shat'ari Fey Dragon
    • Actions
      • Set ShatariPointExplode = (Position of (Triggering unit))
      • Unit - Create 1 ShaTari Dummy for (Owner of (Triggering unit)) at ShatariPointExplode facing Default building facing degrees
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using war3mapImported\Arcane Explosion.mdx
      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_ShatariPointExplode)
 
Last edited:
Status
Not open for further replies.
Top