Any help here?

millz-

New Member
Reaction score
25
JASS:
function StoreItemType takes string item, string abil, string abilbook, integer slot, string req, string bonus returns nothing
    call SaveStringBJ(abil,1,item,udg_Items)
    call SaveStringBJ(abilbook,2,item,udg_Items)
    call SaveIntegerBJ(slot,3,item,udg_Items)
    call SaveStringBJ(req,4,item,udg_Items)
    call SaveStringBJ(bonus,5,item,udg_Items)
endfunction

function Trig_Items_Init_Actions takes nothing returns nothing
    call StoreItemType("I03W","A01L","A01M",5,"lvl1","dmg+5")
endfunction

function InitTrig_Items_Init takes nothing returns nothing
    set gg_trg_Items_Init = CreateTrigger()
    call TriggerAddAction(gg_trg_Items_Init,function Trig_Items_Init_Actions)
endfunction


I have a global variable Hashtable type named Items

Can anyone see what's wrong with this small section of codes? When saving, it gives an error "Expected a name" on the first line. It has been bothering me for over 6 hours :confused:
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
JASS:
function StoreItemType takes string <expects a name, and a comma>, item, string abil,


You parse variable types, without any name to reference the value to.

JASS:
function meh takes string strVar, integer intVar, group grpVar returns nothing

endfunction
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
You can't name a variable as the same as a type, here item for a string.
Use item_string or so.

Also hashtables requires integers as keys and not strings like game cache.

and finally don't use the BJ but the natives ones.
 

millz-

New Member
Reaction score
25
It was really problematic, I tried changing back and forth string and integer as the key tried changing to all integer, all string, all didn't work. I also changed the name of the string parameter which was supposed to be "item" but "item" was a variable type and I didn't notice it until I post the codes in here Jass tags. Well, changing the name of the parameter didn't work too, so I decided to try with the NewGEN thing. And amazingly, after re-writing those codes, it worked.

and finally don't use the BJ but the natives ones.
Meaning?
 

millz-

New Member
Reaction score
25
Is TESH = the function list thing? If yes, well, I don't know if it's because mine is outdated or what, that list do not have anything called SaveStringBJ nor SaveStr.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Yes, you have to update it manually.
His autor doesn't support it now, but there are some unofficial versions.

Personnaly i use JassCraft for find functions (can be downloaded at www.wc3c.net), but it seems most people prefer using TESH.
 
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