ID => Handle ?

Jedi

New Member
Reaction score
63
1@
What are you talking about?Hashtables don't work like that.If you are the creator of the map, you should now what you want to load.

JASS:
function LoadValues takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local integer id = GetHandleId(t)
    //I want my unit back!
    local unit u = LoadUnitHandle(hash, id, 0)
    //And my timer dialog
    local timerdialog td = LoadTimerDialogHandle(hash, id, 1)
    ....
endfunction

function start takes nothing returns nothing
    local timer t = CreateTimer()
    local integer id = GetHandleId(t)
    //I want to save a unit
    call SaveUnitHandle(hash, id, 0, unit)
    //And a timer dialog
    call SaveTimerDialogHandle(hash, id, 1, td)
    call TimerStart(t, 5, false, function LoadValues)
    set t = null
endfunction


2@
A timer is a handle
JASS:
local handle h = CreateTimer()

But I am not sure what you mean :D
 

Romek

Super Moderator
Reaction score
964
> What are you talking about?Hashtables don't work like that.
Hashtables were never mentioned...

> A timer is a handle
Try:
JASS:
local handle h = CreateTimer()
call TimerStart(h, 5, true, null)


This is worth taking a look at. If it no longer works, then unfortunately there's no way of typecasting from integer to handle.
 

Romek

Super Moderator
Reaction score
964
> There is no problem in converting handle to timer, but I need to convert timer to handle
That little script demonstrated that problem to the person who posted above me.

Read the last sentence in Post #3.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
You can convert a handle to an integer using GetHandleId(), and convert it from an integer to a handle using the typecasting library.

Although, that method isn't really needed so much anymore. What exactly are you trying to do? =)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top