Simple Question! About ForgroupBJ and its parametes

newtonrox

Member
Reaction score
2
when you call ForGroupBJ(group, function)

can your "function" have parameters? like:

call ForGroupBJ( udg_ALLMAP, Trig_Add_skill(Dummy, Item) )
 
No, this isn't allowed... This is a shame, as it'd help ALOT !
You best way is to use globals...
 
the function must not take any arguments or return anything

so the function you are calling should look like this:

JASS:
function A takes nothing returns nothing
endfunction

function B takes unit u returns nothing
endfunction

function C takes nothing returns boolean
endfunction

function main takes nothing returns nothing
    local group MyGroup = CreateGroup()
    call ForGroup(MyGroup, function A) // valid
    call ForGroup(MyGroup, function B) // not valid, function B has arguments
    call ForGroup(MyGroup, function C) // not valid, function C returns a value
endfunction
 
thank you guys!


i could not believe that this was the mistake i was making...
the editor did not let me compile XD

and i agree! that rly would help us alot

globals ftw -.-"


one more question:

is it better to use GetLastCreatedUnit() or a global?
the global would be overwritten if two ppl used my spell at the same time? if so, what's the point of using a global instead of GetLastCreatedUnit()?
can that lead me to an error?
 
No, there is no chance of this happening, as triggers use the same thread, and pile up in a line, so if there is no wait in a trigger, it won't overlap with another trigger ;)

Just set the unit to a global variable and you're good ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • 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 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