• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

I2U in 1.24

Status
Not open for further replies.
Level 3
Joined
Sep 11, 2004
Messages
63
Code:
function I2U takes integer i returns unit
  return i
  call DoNothing()
  return null
endfunction

"i" is a stored integer from gamecache, stored as integer from GetHandleId(h)

The function I2U doesn't seem to work in 1.24, yes it compiles fine thanks to "call DoNothing()" but you can no longer retrieve the unit handle from "return i", I2Timer, I2Effect or I2AnyGameObject don't work in 1.24 too.

I know there are new hash table methods implemented in 1.24 to store game object handles, but it would be too much work to do a total conversion, I wonder if there is a way to make a 1.24 compatible I2U or I2Anything without switching to hashtable.

Thanks.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You could store the handle in a hashtable with the key (or whatever it's called in wc3) being the handle too.

call Store_or_whatever(GetHandleId(h),0,h)


And now it's a simple retrieval of

h = Retrive_or_whatever(GetHandleId(h),0)


Can't think why you would ever need this.
 
Level 3
Joined
Sep 11, 2004
Messages
63
I tried everything but still can't store or load any object handle with the old method, so I had to convert them into the SaveSomeHandle hash stuff. Anyways thanks for the replies.
 
Status
Not open for further replies.
Top