• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

JNGP and Patch 1.24 . Need help understanding

Status
Not open for further replies.
Level 4
Joined
Oct 16, 2006
Messages
48
Hi . I'm recently trying to revive my old map for compatibility with 1.24.

I was reading through the tutorials for converting patch 1.24 in the tutorials section. I've some questions

I'm using JNGP. I tried compiling my script and got some error. In the Jasshlper error box, it seems that JNGP is adding some H2I function where I didn't add them.

for example , error box says

JASS:
set udg_temp_string=GetItemName((I2H(GetStoredInteger(udg_CacheDelInventario, I2S((GetHandleId(((GetTriggerPlayer() ))))), "Slot" + I2S(( GetForLoopIndexB())))))) // INLINED!!


I searched up my script and it says
JASS:
set udg_temp_string = GetItemName(GetPotionBackpackItem(GetTriggerPlayer(),GetForLoopIndexB()))

I didn't put any I2S or I2H on it. I'm assuming that jasshelper is very nice to add the I2x functions into my codes, is that correct?

If that's the case, I've replace my old I2H and H2I functions with

JASS:
function H2I takes handle hHandle returns integer
    return GetHandleId(hHandle)
endfunction

function I2H takes integer i returns handle
    call SaveFogStateHandle(MyHash,0,0,ConvertFogState(i))
    return LoadGroupHandle(MyHash,0,0)
endfunction

so technically I shouldn't be getting any errors should I?
However, for the codes above I'm still getting cannot convert Handle to Item.
Now this is weird because the question is WHY is jasshelper doing a H2I when the variable is for Item? It's as if jasshelper helped me halfway to get me stranded. Now I'm not sure I should be doing
 
Level 4
Joined
Oct 16, 2006
Messages
48
Okay I THINK i just solve it.

can someone confirm if this would be solved if I do a H2I on the result of GetPotionBackPackItem . and then do a Int2Item on the result..

i stopped getting the error , but I'm not sure if the variable there would set the Item Name correctly or some garbled integer
I can't confirm his myself cause the game won't run until i cover the other 30-40 error-laden scripts. In fact they won't even save. I hope it don't crash
 
Level 4
Joined
Oct 16, 2006
Messages
48
that's sweet, typecast everything in the beginning. I assume that would means 0 change to the implementations?

Anyway nvm already I've solved this after spending some time in wc3.net irc channel. Apparently. JNGP does not show certain syntax errors, I get someone to compiled it on ZINC and i fixed the errors.
 
Status
Not open for further replies.
Top