• 🏆 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] Save/Load Unit HandleID

Status
Not open for further replies.
Level 11
Joined
Nov 15, 2007
Messages
781
  • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at loc facing 90.00 degrees
    • Set unit = (Last created unit)
    • Set unit2 = Circle of Power 0001 <gen>
    • Custom script: set udg_int = GetHandleId(udg_unit)
    • Custom script: set udg_int2 = GetHandleId(udg_unit2)
    • Hashtable - Save int2 as 1 of int in Table
    • Hashtable - Save int as 1 of int2 in Table

  • Actions
    • Set unit = (Triggering unit)
    • Custom script: set udg_int = GetHandleId(udg_unit)
    • Set unit2 = (Load 1 of int in Table)
    • Custom script: set udg_int2 = GetHandleId(udg_unit2)
    • Game - Display to (All players) for 5.00 seconds the text: (String(int))
    • Game - Display to (All players) for 5.00 seconds the text: (String(int2))
When I save/load the second unit's HandleID in this manner it returns 0. What am I fucking up and how do I do it right?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I remember a time when "GetHandleId()" and saving it, wasn't working, but "SaveUnitHandle()" did work. I guess it should be the same, but, somehow, one works, the other doesn't.
 
Status
Not open for further replies.
Top