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

Will this Leak/Work?

Status
Not open for further replies.
Level 12
Joined
Jun 10, 2008
Messages
1,043
Hello, Hive. I havn't had time/enough testers online to test this trigger and I need to know if it will work/leak. Basically, you can revive your ally's hero for 250 gold by buying the "Revive" item. So I need you're help. Will this work/leak?


  • Deathflag
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • (Owner of (Dying unit)) Not equal to Player 10 (Light Blue)
      • (Owner of (Dying unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Dying unit)) Not equal to Player 12 (Brown)
    • Actions
      • Set Dieing_Unit = (Unit-type of (Dying unit))
      • Set Dieing_Player = (Owner of (Dying unit))
      • Unit - Replace (Dying unit) with a Soul using The new unit's max life and mana
Ressurection
  • Events
    • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Revive
    • Actions
      • Unit - Replace (Selling unit) with a Dieing_Unit using The old unit's relative life and mana
 
  • Deathflag
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Player Number of (Triggering Player)) Less than 10
    • Actions
      • Set Dieing_Unit = (Unit-type of (Triggering unit))
      • Set Dieing_Player = (Triggering Player)
      • Unit - Replace (Dieing_Unit) with a Soul using The new unit's max life and mana
There are no leaks, but this makes a lot of optimizations on your map.

Also, dieing? That's not a word...
 
Level 12
Joined
Jun 10, 2008
Messages
1,043
  • Deathflag
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Player Number of (Triggering Player)) Less than 10
    • Actions
      • Set Dieing_Unit = (Unit-type of (Triggering unit))
      • Set Dieing_Player = (Triggering Player)
      • Unit - Replace (Dieing_Unit) with a Soul using The new unit's max life and mana
There are no leaks, but this makes a lot of optimizations on your map.

Also, dieing? That's not a word...

Are variables even effected by spelling? Also what do you mean by a lot optimizations... what exactly will it change other then adding the replacing the unit with a flag?
 
Triggering Player not only takes less time to execute, but it's less work for you to click through the options.
I shortened your conditions to make them go faster, as well. You had a needless "all conditions are true", as conditions automatically require all conditions to be true.

Don't use Dying Unit/Casting Unit/Hero Manipulating... use Triggering Unit for those guys. Again, it takes less time to execute and you don't have to click as much and figure out "which one is this called? Casting unit of doom and death?"

Spelling, that's just preference. I don't like to compromise spelling. If I'm short on words, I usually consult a thesaurus.
 
Status
Not open for further replies.
Top