• 🏆 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] Hashtable Help Please

Status
Not open for further replies.
Level 10
Joined
Sep 25, 2013
Messages
521
Ive created a system in which a unit moves continually in one direction for a duration and kills every unit in its path. While the unit is moving, the player looses control of that unit.

I have 2 separate versions of this unit. Version 1 has a collision size and does not kill units in its way. Version 2 has its collision size set to 0 so it can move through units easily and crush them.

In the trigger, when the unit casts it ability, "Rampage", the Version 1 unit is replaced by the Version 2 unit and then its ownership is changed to neutral extra and it is ordered to move to the target point of the casting ability.

The problem arises when the duration runs out and I want to return the unit to its original owner after returning that unit to a Version 1 unit. I have just started with hashtables so I don't exactly know whats going on. Any help would be much appreciated.

  • Mamukil Rampage Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rampage (Mamukil)(Newer Yet)
    • Actions
      • Hashtable - Save Handle Of(Owner of (Casting unit)) as 0 of (Key (Owner of (Casting unit))) in MamukilPlayerHashtable
      • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
      • Wait 1.00 seconds
      • Unit - Replace (Casting unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
      • Set Mamukil = (Last replaced unit)
      • Set RampagePoint = (MamukilTargetPoint offset by 1000.00 towards (Angle from (Position of Mamukil) to MamukilTargetPoint) degrees)
      • Unit - Change ownership of Mamukil to Neutral Extra and Retain color
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Order Mamukil to Move To RampagePoint
      • Unit Group - Add Mamukil to MamukilUnitGroup
      • Hashtable - Save 7 as 0 of (Key (Last replaced unit)) in MamukilHashtable
  • Mamukil Rampage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MamukilUnitGroup and do (Actions)
        • Loop - Actions
          • Set MamukilRemainingTime = (Load 0 of (Key (Picked unit)) from MamukilHashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MamukilRemainingTime Greater than 0
            • Then - Actions
              • Hashtable - Save (MamukilRemainingTime - 1) as 0 of (Key (Picked unit)) in MamukilHashtable
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Unit - Change ownership of (Picked unit) to (Load 0 of (Key (Owner of (Picked unit))) in MamukilPlayerHashtable) and Change color
              • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
              • Unit Group - Remove (Picked unit) from MamukilUnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
              • Custom script: call RemoveLocation (udg_RampagePoint)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Ok, hashtables are basically... well tables... You have 2 keys which you can imagine as Row and Column.
Look at the bottom
Before the red text are only suggestions for improvement.

First of all. This will break your spell.
  • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
  • Wait 1.00 seconds
  • Unit - Replace (Casting unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
For the point you can use a local variable, with custom script. For the Casting unit use Triggering Unit

  • Custom script local location loc_point //in teh very beginning of the actions
  • <<< Do some stuff >>>
  • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
  • Custom script set loc_point = udg_MamukilTargetPoint
  • Custom script call RemoveLocation(udg_MamukilTargetPoint)
  • Wait 1.00 seconds
  • Custom script set udg_MamukilTargetPoint = loc_point
  • Custom script call RemoveLocation(loc_point)
  • Custom script set loc_point = null
  • <<< Do some stuff >>>
  • Unit - Replace (Triggering) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • <<< Do some stuff >>>
  • At the end of the trigger
  • Custom script call RemoveLocation(udg_MamukilTargetPoint)
  • Custom script call RemoveLocation(loc_point)
  • Custom script set loc_point = null
Waits break the trigger thread. Global variables can be accessed by ANY trigger and if they are changed during this 1 second they WILL have different value. Local variables exist only in a particular execution of the code, their values can not be changed by outside sources.

Triggering Unit/Player do survive waits, meaning that they will correspond to the same value before the wait, they act a bit like locals . Everything else like Last Created Something do NOT survive waits.

Not teh best explanation but I do try to keep it simple and understandable.
  • Hashtable - Save Handle Of(Owner of (Casting unit)) as 0 of (Key (Owner of (Casting unit))) in MamukilPlayerHashtable
  • Hashtable - Save 7 as 0 of (Key (Last replaced unit)) in MamukilHashtable
You are saving both on row 0, bad idea, very bad idea >>> save the unit in row 1 and teh player at row 0
  • Hashtable - Save Handle Of(Owner of (Casting unit)) as 0 of (Key (Owner of (Casting unit))) in MamukilPlayerHashtable
  • Hashtable - Save 7 as 1 of (Key (Last replaced unit)) in MamukilHashtable
According you should be loading the unit from row 1 and the player from row 0

Note: I am not sure if key 0 exists in hashtables... I do not know if they work as arrays or are more user-oriented.

EDIT// OOOOH, now I noticed that you are actualy using 2 hashtables... you do not need 2...

EDIT2// Ok here is the real problem:
  • Else - Actions
  • Unit - Change ownership of (Picked unit) to (Load 0 of (Key (Owner of (Picked unit))) in MamukilPlayerHashtable) and Change color
  • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Unit Group - Remove (Picked unit) from MamukilUnitGroup
  • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
  • Custom script: call RemoveLocation (udg_RampagePoint)
You are loading
  • (Load 0 of (Key (Owner of (Picked unit)))
which at this point is Neutral Passive
You cast the spell as Player 1 Red but you are loading from Neutral Passive

A solution will be in teh first trigger to save at a new slot :
  • Hashtable - Save (Owner of (triggering Unit) as 2 of (Key Handle of(Last replaced unit)) in MamukilHashtable
And in the second trigger:
  • Else - Actions
  • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Handle of (Picked unit))) in MamukilPlayerHashtable) and Change color
  • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
For the custom scripts: New Action >> Custom Script
Just copy the text without "Custom script" from what I wrote and paste it into the newly created action.
the worst thing you can do is being afraid of scripting.

Example -From this:
  • Custom script set loc_point = udg_MamukilTargetPoint
You copy only this part:
set loc_point = udg_MamukilTargetPoint
Paste it into the newly created custom script action and you are done.

You should see:
  • Custom script: set loc_point = udg_MamukilTargetPoint
Edit// Oh, and hashtables are infinite in theory, so they can store infinite amount of "things"... in theory.

Edit// If you can not make the custom scripts work feel free to ask for help
 
Level 10
Joined
Sep 25, 2013
Messages
521
So ive put the hashtables in separate rows, 1 and 2. Custom scripts aside, im still having trouble making the unit return to its original owner. I need to store the value of the original player and then load it latter, but my method doesnt seem to be working.

I tried using Key of Triggering unit instead of last replaced unit when saving the data to the mamukilplayerhashtable, so that it would save the player number of the owner of the unit that casted the spell and not the owner of the replaced unit which would be neutral, but that didnt work.

  • Mamukil Rampage Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rampage (Mamukil)(Newer Yet)
    • Actions
      • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
      • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Triggering unit)) in MamukilPlayerHashtable
      • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
      • Set Mamukil = (Last replaced unit)
      • Set RampagePoint = (MamukilTargetPoint offset by 1000.00 towards (Angle from (Position of Mamukil) to MamukilTargetPoint) degrees)
      • Unit - Change ownership of Mamukil to Neutral Extra and Retain color
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Order Mamukil to Move To RampagePoint
      • Unit Group - Add Mamukil to MamukilUnitGroup
      • Hashtable - Save 7 as 1 of (Key (Last replaced unit)) in MamukilHashtable
  • Mamukil Rampage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MamukilUnitGroup and do (Actions)
        • Loop - Actions
          • Set MamukilRemainingTime = (Load 1 of (Key (Picked unit)) from MamukilHashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MamukilRemainingTime Greater than 0
            • Then - Actions
              • Hashtable - Save (MamukilRemainingTime - 1) as 1 of (Key (Picked unit)) in MamukilHashtable
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Owner of (Triggering unit))) in MamukilPlayerHashtable) and Change color
              • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
              • Unit Group - Remove (Picked unit) from MamukilUnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
              • Custom script: call RemoveLocation (udg_RampagePoint)
So, since i have two hashtables, it doesnt matter that they both are on the same row?

Im going to try and saving the key as triggering player
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
  • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Triggering unit)) in MamukilPlayerHashtable
  • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Set Mamukil = (Last replaced unit)
you are saving a reference to the old unit which gets replaced, you need to refer the replacing unit so this becomes:
  • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Set Mamukil = (Last replaced unit)
  • Hashtable - Save Handle Of(Owner of Mamukil) as 2 of (Key Mamukil) in MamukilPlayerHashtable
  • Then change ownership and all the rest
...wait what... doesn't replacing a unit and the n referencing the first unit give you the replacing... I may be wrong about this one...

  • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Owner of (Triggering unit))) in MamukilPlayerHashtable) and Change color
  • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Unit Group - Remove (Picked unit) from MamukilUnitGroup
  • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
  • Custom script: call RemoveLocation (udg_RampagePoint)
Code:
Owner of (Triggering unit)
There is no triggering unit or player in this trigger at all, the event is every one second.
Replace this with:
Code:
Key (Picked Unit)

Btw, you are still using 2 hashtables while you may do with only 1.
 
Level 10
Joined
Sep 25, 2013
Messages
521
Now i understand the fact that i don't have to use two hashtables now as long as I use separate rows, thank you. The problem here is returning the unit to its original owner.

Youre saying to go like this at the end of the 2nd trigger:
  • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Picked unit)) in MamukilPlayerHashtable) and Change color
The problem is that the owner of the picked unit is currently neutral, so its just going to keep it as a neutral unit instead of change it to the original players control.

I'm trying to make it so if Player Red uses the ability, it will store that Red used the ability for that particular unit and will return to reds control by the end of the spells effect.

So i did this:

  • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Owner of (Triggering unit))) in MamukilPlayerHashtable
I thought this would save who owns it before the unit's ownership is changed and then recall that player value later at the end of the trigger system, but its not working. Im going to keep trying
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Damn, it has been so long since I was forced to use GUI hashtables..

1. you seem to use "MamukilRemainingTime" but you never store a value into the hashtable. And then you check if "MamukilRemainingTime" is greater than 0, but it will always be 0 since there's nothing there.

2. you can't use triggering unit inside a unit group.. it should be picked unit and not owner of triggering unit.
 
Level 10
Joined
Sep 25, 2013
Messages
521
I save the value of 7 to 1 in the Mamukilhashtable in the first trigger. Then every 1 second it sets the MamukilRemainingTime by loading 1 from Mamukilhashtable for the picked unit. If its value is above 7 it just subtracts 1 until it is at 0.

And that system is currently working. The only problem is changing the unit ownership back to the original player. And yeah, i need to use picked unit, i agree. I was just frustrated and trying random shit out. I really am confused here why its not loading the saved player so it can return the mamukil back to its original owner.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Ops. Didn't see that one on the bottom.

Take a look at this:
  • Mytrigger
  • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Triggering unit)) in MamukilPlayerHashtable
You SAVE the owner, while using the triggering unit key. You then add triggering unit to a unit group. So if you use picked unit as a key, it should load properly. NOT owner of picked unit, just picked unit.
 
Level 10
Joined
Sep 25, 2013
Messages
521
So this is what i have now, ive removed the special effects so theyre just out of the way.

  • Mamukil Rampage Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rampage (Mamukil)(Newer Yet)
    • Actions
      • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
      • Hashtable - Save Handle Of(Owner of (Casting unit)) as 2 of (Key (Picked unit)) in MamukilPlayerHashtable
      • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
      • Set RampagePoint = (MamukilTargetPoint offset by 1000.00 towards (Angle from (Position of (Triggering unit)) to MamukilTargetPoint) degrees)
      • Unit - Change ownership of (Last replaced unit) to Neutral Extra and Retain color
      • Unit - Order (Last replaced unit) to Move To RampagePoint
      • Unit Group - Add (Last replaced unit) to MamukilUnitGroup
      • Hashtable - Save 7 as 1 of (Key (Last replaced unit)) in MamukilHashtable
  • Mamukil Rampage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MamukilUnitGroup and do (Actions)
        • Loop - Actions
          • Set MamukilRemainingTime = (Load 1 of (Key (Picked unit)) from MamukilHashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MamukilRemainingTime Greater than 0
            • Then - Actions
              • Hashtable - Save (MamukilRemainingTime - 1) as 1 of (Key (Picked unit)) in MamukilHashtable
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
              • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Owner of (Picked unit))) in MamukilPlayerHashtable) and Change color
              • Unit Group - Remove (Picked unit) from MamukilUnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
              • Custom script: call RemoveLocation (udg_RampagePoint)
Still doesnt work. Its not saving the player of the original unit as it should. I want to be able to load that player but instead it keeps loading neutral, which doesnt make sense because i saved the player value from the triggering unit which is before it was replaced as a neutral unit.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Not in the cast trigger silly. It should remain triggering unit there. Picked unit is for the second (loop trigger) trigger.

edit: like this:
  • Mamukil Rampage Cast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Rampage (Mamukil)(Newer Yet)
    • Actions
      • Set MamukilTargetPoint = (Position of (Target unit of ability being cast))
      • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Triggering unit)) in MamukilPlayerHashtable
      • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
      • Set Mamukil = (Last replaced unit)
      • Set RampagePoint = (MamukilTargetPoint offset by 1000.00 towards (Angle from (Position of Mamukil) to MamukilTargetPoint) degrees)
      • Unit - Change ownership of Mamukil to Neutral Extra and Retain color
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Mamukil using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Order Mamukil to Move To RampagePoint
      • Unit Group - Add Mamukil to MamukilUnitGroup
      • Hashtable - Save 7 as 1 of (Key (Last replaced unit)) in MamukilHashtable
  • Mamukil Rampage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MamukilUnitGroup and do (Actions)
        • Loop - Actions
          • Set MamukilRemainingTime = (Load 1 of (Key (Picked unit)) from MamukilHashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MamukilRemainingTime Greater than 0
            • Then - Actions
              • Hashtable - Save (MamukilRemainingTime - 1) as 1 of (Key (Picked unit)) in MamukilHashtable
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Unit - Change ownership of (Picked unit) to (Load 2 of (Key (Picked unit)) in MamukilPlayerHashtable) and Change color
              • Unit - Replace (Picked unit) with a Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
              • Unit Group - Remove (Picked unit) from MamukilUnitGroup
              • Hashtable - Clear all child hashtables of child (Key (Owner of (Picked unit))) in MamukilPlayerHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilUnitHashtable
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MamukilHashtable
              • Custom script: call RemoveLocation (udg_RampagePoint)
 
Level 10
Joined
Sep 25, 2013
Messages
521
  • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Picked unit)) in MamukilPlayerHashtable
So like this? or should i change the picked unit to triggering unit as well.

Edit:
I tried both ways and neither worker. Seriously, I am highly confused and Ive been trying different things for hours now lol

Edit:
Okay, I have done exactly like what you showed. The unit still changes to a neutral owner. Is there some other way of doing this, am i doing this all wrong?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
This really bugs me:
  • Hashtable - Save Handle Of(Owner of (Triggering unit)) as 2 of (Key (Triggering unit)) in MamukilPlayerHashtable
  • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Set Mamukil = (Last replaced unit)
Rearange as:
  • Unit - Replace (Triggering unit) with a Rampaging Mamukil |c00FFFF00(Elite)|r (Haradrim) using The old unit's relative life and mana
  • Set Mamukil = (Last replaced unit)
  • Hashtable - Save Handle Of(Owner of Mamukil) as 2 of (Key Mamukil) in MamukilPlayerHashtable
You are saving the key to the old unit which stops existing after it is replaced. Accordingly you have no reference to it and loading the key of the new unit does NOT give you the key to the old unit. (?)

Otherwise your trigger must look exactly the same as what Chaosy made

Edit// This is in the wrong trigger, move it to the first
  • Custom script: call RemoveLocation (udg_RampagePoint)
 
Status
Not open for further replies.
Top