So, I'm just getting into LUA, learning what I can from mixed tutorials, guides, and wikis. But inevitably along the way I'm gonna have questions that are a little harder to answer myself (I'm sure other people will too). So here's where we can all ask random lua questions. I'd appreciate any help.
So my question right now is, how can I use Spring's area command(a la area reclaim etc) for my own widget?
The question thread
Moderator: Moderators
Re: The question thread
no idea but maybe look at a widget that does something similiar and see if you can figure it out. for example the "factory guard" widgets makes builders guard factorys (orly) by giving them waypoints...i am sure giving reclaim commands is done in a similiar way.So my question right now is, how can I use Spring's area command(a la area reclaim etc) for my own widget?
Thats fail i think. I hate megathreads like http://springrts.com/phpbb/viewtopic.php?f=14&t=7571 because they are impossible to browse, search and any information in them is lost. Better have specific threads with good titles.So here's where we can all ask random lua questions
Re: The question thread
I like the idea. makes answering questions much easier, also there are quite less real lua questions in this forum, so perhaps a thread like this may be able to change this.Hobo Joe wrote:So here's where we can all ask random lua questions.
That's easy. See the wiki:Hobo Joe wrote:So my question right now is, how can I use Spring's area command(a la area reclaim etc) for my own widget?
http://springrts.com/wiki/Lua_CMDs#CMD.RECLAIM
-> CMD.RECLAIM is type of CMDTYPE.ICON_UNIT_FEATURE_OR_AREA
So instead of giving the featureid, just give the mappos + the radius,CMDTYPE.ICON_UNIT_FEATURE_OR_AREA
expect 1 parameter in return (unitid or Game.maxUnits+featureid)
or 4 parameters in return (mappos+radius)
i.e. Spring.GiveOrderToUnit(unitID, CMD.RECLAIM, {mapx,mapy,mapz,radius}, {})
Re: The question thread
jK wrote:Hobo Joe wrote: That's easy. See the wiki:
http://springrts.com/wiki/Lua_CMDs#CMD.RECLAIM
-> CMD.RECLAIM is type of CMDTYPE.ICON_UNIT_FEATURE_OR_AREASo instead of giving the featureid, just give the mappos + the radius,CMDTYPE.ICON_UNIT_FEATURE_OR_AREA
expect 1 parameter in return (unitid or Game.maxUnits+featureid)
or 4 parameters in return (mappos+radius)
i.e. Spring.GiveOrderToUnit(unitID, CMD.RECLAIM, {mapx,mapy,mapz,radius}, {})
Thanks a lot! I checked the wiki, but I missed that somehow.
@ knorke it's not meant to be something you browse through to find random answers, but somewhere you ask and it gets answered specifically. If we're lucky things that aren't in the wiki that are answered will be put there afterwards. :)