• 🏆 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!

[Crash] One hashtable problem

Status
Not open for further replies.
Level 6
Joined
Oct 1, 2012
Messages
166
Hello
I'm not sure whether ot not I should post it here, but on JASS topics there were only posts about the lessons there, so I figured I'd ask it right here.

I wanted to save ability handle on the hashtable. The function in GUI crashes my World Editor and, besides, there's no way of loading the ability from hashtable and giving it to the unit (i couldn't find the way). I'm not completely familiar with JASS (as a matter of fact, I just started with it), but it doesn't seem coplex so I tried it and it works somehow. Yet, I encountered a problem with hashtables while using JASS. Same thing happens while writting CustomScript with GUI.

Here's my function:
  • function Trig_Zmienne_Przedmiotow_Actions takes nothing returns nothing
  • // Prawa Reka
  • //Dębowa Różdżka
    • call SaveItemHandleBJ("I00g", 0, 301, udg_Tablica_przedmioty)
    • call SaveIntegerBJ(29, 1, 301, udg_Tablica_przedmioty)
    • call SaveIntegerBJ(8, 2, 301, udg_Tablica_przedmioty)
    • call SaveAbilityHandleBJ("A02K", 3, 301, udg_Tablica_przedmioty)
    • call SaveIntegerBJ(3, 4, 301, udg_Tablica_przedmioty)
    • call SaveAbilityHandleBJ("A02I", 3, 301, udg_Tablica_przedmioty)
    • call SaveAbilityHandleBJ("A02J", 3, 301, udg_Tablica_przedmioty)
    • call SaveAbilityHandleBJ("A02H", 3, 301, udg_Tablica_przedmioty)
  • endfunction
  • //===========================================================================
  • function InitTrig_Zmienne_Przedmiotow takes nothing returns nothing
    • set gg_trg_Zmienne_Przedmiotow = CreateTrigger( )
    • call TriggerRegisterTimerEventSingle( gg_trg_Zmienne_Przedmiotow, 2.00 )
    • call TriggerAddAction( gg_trg_Zmienne_Przedmiotow, function Trig_Zmienne_Przedmiotow_Actions )
  • endfunction
I pasted it from my editor, the map is polish, but the names are irrelevant just now. This function saves data about one item - first line refers to the item itself. The second one is for required weapon skill (as it is a wand), then there's required level; next line stands for a dummy skill, so the wand would look somehow on the equipment window, then we have number of bonuses and the three bonuses themself. That's for the introduction.

When I tried saving the map, I got some error which turned my trigger off. I tried doing many things with it (removing BJ from the function name, as I don't know if it's relevant, I've seen some tutorial without it there; I also tried making different hashtables for different variable types, but it seems irrelevant [correct me if I'm wrong]). The crash itself reffered to the evenly numbered lines with statement as such:

Incorrect argument type (string)

(I could've translated it wrongly, but I guess it's understandable)

Firstly I tried doing everything with variables, but the arrays were far too big and all the triggers simply stopped working.
I would be very glad for any kind of help, I'm making the map for over a week now and I literally lost 5+ hours each day, I don't want it to be senseless.

Thanks for anything :)

EDIT: I didn't know how to make custom script window, so it looks klnda weird, sorry for that.
 
Level 6
Joined
Oct 1, 2012
Messages
166
Well, thank you, this solved the previous problems. But now I get an error in the second line as follows:

Incorrect argument type (integer)

I tried with quotes, without them, with inverted commas, I don't know what else might be wrong.

Nevermind, I got that myself. Hope it will work, thanks very much :)
 
Last edited by a moderator:
Status
Not open for further replies.
Top