Local group

SFilip

Gone but not forgotten
Reaction score
634
if they can't then what's GetHandleGroup for? :rolleyes:
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
What the... I got this one from wc3sear.ch: System

Code:
function H2I takes handle h returns integer
    return h
    return 0
endfunction
 
// ===========================
function LocalVars takes nothing returns gamecache
    return InitGameCache("jasslocalvars.w3v")
endfunction
 
function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction
 
function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction
 
function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction
 
function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction
 
function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
 
function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
 
function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction

No GetHandleGroup :(


EDIT: nvm, made it myself.
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
Sorry being off-topic on that other thread.

Here is my GetHandleGroup function:

Code:
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

And here my code:

Code:
function Death_Passage_Move takes nothing returns nothing
 local group g1 = GetHandleGroup(GetTriggeringTrigger(), "g1")
 local group g2 = CreateGroup()
 local unit var1

 local real x = GetHandleReal(GetTriggeringTrigger(), "x")
 local real y = GetHandleReal(GetTriggeringTrigger(), "y")
 local real angle
 local real distance

    call DisplayTextToForce( GetPlayersAll(), "works" )

    call GroupAddGroup(g1, g2)
  loop
    call DisplayTextToForce( GetPlayersAll(), "works34252352345" )
    set var1 = FirstOfGroup(g2)
    exitwhen var1 == null
    call KillUnit(var1)
    set distance = DistanceBetweenPoints(Location(x, y), GetUnitLoc(var1)) + 1000.00
    set angle = AngleBetweenPoints(Location(x, y), GetUnitLoc(var1))+1.00
    call SetUnitPositionLoc(var1, PolarProjectionBJ(Location(x, y), distance, angle))
    call GroupRemoveUnit(g2, var1)
  endloop
endfunction

The display text and killunit are there for testing purposes. The text appears, but the units don't get killed.

Here is my other function, that starts the timer.

Code:
function Death_Passage_Actions takes nothing returns nothing
 local unit cast = GetTriggerUnit()

 local real x = GetLocationX(GetSpellTargetLoc())
 local real y = GetLocationY(GetSpellTargetLoc())
 local unit var1
 local group g1 = CreateGroup()
 local timer t = CreateTimer()
 local integer p = 0

  loop
    exitwhen p == 6
    set var1 = CreateUnit(GetOwningPlayer(cast), Death_Passage_Dark_Ball(), x, y, 0.00)
    call SetUnitFlyHeight(var1, 30.00, 20.00)
    set p = p + 1
  endloop

    call SetHandleHandle(t, "g1", g1)
    call SetHandleReal(t, "x", x)
    call SetHandleReal(t, "y", y)
    call TimerStart(t, 0.01, true, function Death_Passage_Move)
endfunction

Any help? :)
 

SFilip

Gone but not forgotten
Reaction score
634
well you should be using official kattana's system...the one he updated.
http://www.wc3jass.com/viewtopic.php?t=224

anyway a quick guess by looking at your code: it seems that you attach the variables to the timer, but then try to read it from GetTriggeringTrigger. try changing that to GetExpiredTimer.
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
SFilip said:
well you should be using official kattana's system...the one he updated.
http://www.wc3jass.com/viewtopic.php?t=224

anyway a quick guess by looking at your code: it seems that you attach the variables to the timer, but then try to read it from GetTriggeringTrigger. try changing that to GetExpiredTimer.

Thank you very much.

About the triggering trigger... what the late hours in the night can make to you :eek:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top