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

[Solved] How to convert integer to a handle?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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