Hello
I need to know how to access the "category" field of unitdefs from lua.
The wiki specifies nothing and having tried just "category" brings up an error.
Specifically what i need is to check whetever a certain unit belongs to a category, i dont really know how to do that either once i have the category field as a string.
Accessing category unitdef
Moderator: Moderators
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Accessing category unitdef
The wiki tells you on this page http://springrts.com/wiki/Lua_UnitDefs, where the format of the modCategories table is specified. For example:
returns true if and only if the unitDefID has category ship.
Code: Select all
UnitDefs[unitDefID].modCategories['ship']
Re: Accessing category unitdef
Works like a charm, thanks.