• 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.

[Solved] How to convert integer to a handle?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

Edit: Figured it out. There is "GetHandleId." Tried looking for it, but for some reason it doesn't get highlighted as a native function, and it's not listed. But it works.

I'd like to be able to cast handles into child classes (e.g. region, button, dialog, etc.).

This guy provides a way to cast some agents into some handles but not all (regrettably the only useful conversions might be agent <-- unit/item).

But he provides a wealth of functions to turn any integer into a handle

http://www.thehelper.net/threads/typecasting.121176/

Is there a way to turn any handle into an integer, e.g.

JASS:
I2Region(H2I(myHandle)) //would give me the region that this handle represents
 
Last edited by a moderator:
Status
Not open for further replies.
Top