- Joined
- Nov 15, 2009
- Messages
- 225
Hey,
I'm working on a little bit different jump spell (trying not to save locations and stuff, just for testing).
And I used to work with custom values, but I want to break my habit..
So I tried working with Hashtables (yes first time :/ )
So my problem is:
Gives me always the same number
Is always 0...
If I test it ingame, the unit is just going up and down.
If I comment the hashtable lines and uncomment the UnitData lines it works perfectly.
Edit: Removed most parts of the trigger.
When it's finished I will upload this spell into an unprotected map anyway.
Thank you for your time, help is appreciated!
I'm working on a little bit different jump spell (trying not to save locations and stuff, just for testing).
And I used to work with custom values, but I want to break my habit..
So I tried working with Hashtables (yes first time :/ )
So my problem is:
JASS:
call BJDebugMsg(R2S(GetHandleId(u)))
JASS:
call BJDebugMsg(R2S(LoadReal(udg_JumpHash, GetHandleId(u), 0)))
If I test it ingame, the unit is just going up and down.
If I comment the hashtable lines and uncomment the UnitData lines it works perfectly.
JASS:
function UnitJump takes nothing returns nothing
set x = GetLocationX(p) + LoadReal(udg_JumpHash, GetHandleId(u), 0) * Cos(face * bj_DEGTORAD)
set y = GetLocationY(p) + LoadReal(udg_JumpHash, GetHandleId(u), 0) * Sin(face * bj_DEGTORAD)
endfunction
function Trig_Spell_Jump_Actions takes nothing returns nothing
call SaveReal(udg_JumpHash, GetHandleId(u), R2I(r1 * 0.075), 0)
call BJDebugMsg(R2S(GetHandleId(u)))
call BJDebugMsg(R2S(LoadReal(udg_JumpHash, GetHandleId(u), 0)))
endfunction
function InitTrig_Spell_Jump takes nothing returns nothing
set udg_JumpHash = InitHashtable()
endfunction
When it's finished I will upload this spell into an unprotected map anyway.
Thank you for your time, help is appreciated!
Last edited: