[Solved] Childkey problem...

Status
Not open for further replies.
Level 29
Joined
Mar 10, 2009
Messages
5,016
Im too tired so I posted this problem again...

I dont know why does the childkey in this code "call SaveInteger(udg_HASH, uID, 10, countnor+1) " cannot pass 34...I've put a debug message to indicate it and its in the function MH_TRACK...

Spell range is above 1500 (target point)...

Thank you in advance!...

SOLVED!
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
Just a quick idea, since you use a 0.03 periodic timer and a timer 1.
1/0.03 = 33,333333 ... instances of your periodic timer before the one second one fire.
I mean your problem could be here.
You really should use a struct instead of abusing hashtable, also use a timer recycling, like TimerUtils (even if the blue version is a fail), and finally an unit indexer :p

Debug messages, intuition, thinking, and patience are your best friends here.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,124
Having 50 abilities with 10 arrays each (esilly possible with some struct spells) is 500 global arrays. Surly creating large numbers of arrays could cause the JASS interpreter to run less efficiently?

call SaveInteger(udg_HASH, uID, 10, countnor+1) //THIS IS THE PROBLEM
call SaveUnitHandle(udg_HASH, uID, countnor, hook)

Problem I believe is hashspace collision. I think hashtables only let you store 1 item at a specific slot not 1 of each type of item. As such you are overwriting your instance data with unit handles breaking the spell.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
thanks guys...strangely, when I remove the "call TimerStart(t2, 1.0, true, function MH_RETRACK)" OR the codes inside the function MH_RETRACK OR remove the "call SaveInteger(udg_HASH, uID, 10, countnor-1)", it can pass 34 but the hook doesnt retract...

but here's another weird thing, if I pause the "t2" then resume it in the else part of "MH_TRACK", the first time I cast the spell, it cant pass 34 if you cast it a second time and so on...frankly idk why is this happening, maybe conflict like DSG said...

I cant use structs coz this is written in JASS but ofc I can convert to vjASS but I dont want to...

EDIT:
OK forget about this, I've solved the problem...basically countnor child ID is overwritten by previous child integers that is also countnor, so I tried to increase the base integer ID to 20 or above 10, that solves the problem since all uID is upto 10 only...
 
Last edited:
Status
Not open for further replies.
Top