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:
 
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
 
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.
 
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?
 
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.
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top