• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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