Page 1 of 1

Where the heck is getStr() defined?

Posted: Sun Jul 07, 2013 4:41 am
by ibanix
I'm trying to improve wiki documentation, and try as I might I can not find the definition for getStr (or getDex, getCon, etc).

Filename?

Thanks.

Re: Where the heck is getStr() defined?

Posted: Sun Jul 07, 2013 5:03 am
by ibanix
Apparently uses _M:getStat in \games\engines\default\engine\interface\ActorStats.lua as by:

-- Note that the engine also auto-defines stat specific methods on the form: self:getShortname().
-- If you stat short name is STR then it becomes getStr()


Which, I have to say, is really annoying for anyone code diving :/

Re: Where the heck is getStr() defined?

Posted: Sun Jul 07, 2013 5:05 am
by HousePet
Some functions seem to be auto generating.

Re: Where the heck is getStr() defined?

Posted: Sun Jul 07, 2013 5:29 pm
by Doctornull
In the larger projects I've worked on, when we auto-generate code, we also try to auto-generate the documentation for that code, because it's kind of horrible to ask people to read auto-generated code.

Re: Where the heck is getStr() defined?

Posted: Sun Jul 07, 2013 11:29 pm
by darkgod
Thing is it doesnt autogen code, it autogen the functions themselves at runtime (and this is said somewher in the actorstats docs IIRC)