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

[Trigger] Limited replacing trigger hashtable condition doesn't work

Status
Not open for further replies.
Level 2
Joined
Feb 29, 2012
Messages
8
I made a trigger that replaces a hero with a different one when he reaches a certain level. But when a player has more of these heroes, I only want only the first to level up to be replaced. So I've created a hashtable to store the replaced units per player and put it into the condition of the trigger, but it doesn't work.
  • Wildling
    • Events
      • Jednotka - A unit Leveled up
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Load (Key (Triggering unit)) of (Key (Owner of (Triggering unit))) from WildlingHash) not equal to 1
          • (Unit-type of (Triggering unit)) equals Wildling
          • (Level of (Triggering unit)) equals 5
    • Actions
      • Hashtable - Save 1 as (Key (Triggering unit)) of (Key (Owner of (Triggering unit))) in WildlingHash
      • Jednotka - Replace (Triggering unit) with a Wildling Alpha using Stará jednotka je relativnĂ life and mana
      • Hrdina - Set (Last replaced unit) Hero-level to 5, show level-up graphics
I tried it with booleans too, that didn't work either. Additional question, even though it says they are, the level-up graphics don't show, how would I make them to?
 
Don't you have to check for "Hero-Level" in conditions.

Edit: You should use the Unit-Type Nr not the Key (Handle-ID) of the Triggering Unit, i know there is no save Unit-Type in Hashtable do it this way.

  • Trigger
    • Events
    • Conditions
      • Your Conditions without this Hashable not equal 1 check
    • Actions
      • Set Unit_Type = (Unit-type of (Triggering unit))
      • Custom script: set udg_Int = udg_Unit_Type
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load Int of (Player number of (Triggering player)) from WildlingHash) Equal 0
        • Then - Actions
          • Hashtabelle - Save 1 as Int of (Player number of (Triggering player)) in WildlingHash
          • Unit - Replace ....
          • Hero - Set LVL -....
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top