Page 1 of 1
The corlab can assist??
Posted: 18 Dec 2010, 22:57
by meriton
The builder manager of my fledgling AI thinks that in BA, a corlab can assist nearby construction because canAssist is true, and buildDistance is 128.
Yet I know the UI doesn't allow ordering a corlab to assist construction.
Is the corlab able to assist construction? If not, how can I reliably determine that a unit can assist construction without hardcoding mod-specific knowledge?
I am using the Java interface.
BTW, is there some documentation of what exactly the attributes in UnitDef mean? (Most of them don't have any javadoc ...)
Re: The corlab can assist??
Posted: 18 Dec 2010, 23:07
by knorke
canAssist = true on the lab seems like a modmakers mistake, afaik factories can never assist, ony
be assisted. (is that the reason why nano towers are units and not buildings?)
I think buildDistance has no effect on factories either.
There are many cases like that, ie a unit might have
isTransport = true but ingame it will not be a useable transport unless it has some other tags such as
TransportCapacity set.
http://springrts.com/wiki/Units:FBI
http://springrts.com/wiki/Lua_UnitDefs
https://github.com/spring/spring/blob/m ... nitDef.cpp

Re: The corlab can assist??
Posted: 18 Dec 2010, 23:18
by FLOZi
My Diagnosis?
BAD
BABYSITTING MODDING.
Re: The corlab can assist??
Posted: 19 Dec 2010, 14:08
by meriton
Thanks for the links Knorke, they already proved helpful in another matter
I am not sure I understand your distinction between units and buildings though. How does the engine know whether a UnitDef represents a "building" or a "unit"?
Re: The corlab can assist??
Posted: 19 Dec 2010, 15:32
by knorke
How does the engine know whether a UnitDef represents a "building" or a "unit"?
I do not know.
Some things might be:
-only buildings have yardmaps?
-some tags like canFly=true will always make it a unit?
TEDClass?
Re: The corlab can assist??
Posted: 19 Dec 2010, 16:35
by Forboding Angel
tedclass is not used.
How does spring know? Easy. canMove = true/false,
Re: The corlab can assist??
Posted: 19 Dec 2010, 16:49
by slogic
Building does not have movedef (UnitDef->movedata == NULL). But for example NOTA mod has movable defences: Hatrack (armmllt). It HAS movedef but max velocity is 0.001.
Re: The corlab can assist??
Posted: 19 Dec 2010, 16:50
by slogic
Forboding Angel wrote:...canMove = true/false,
It is just for button in GUI. Do not rely on it. For exmaple it can be used to set rally point for factory.
Re: The corlab can assist??
Posted: 19 Dec 2010, 17:03
by Forboding Angel
Yar, I forgot about the obvious fact that a building won't have a movedef.
Does spring round maxvelocity=0, up to 0.1?Another way to do it would be to give the nanotower a massive footprint and 0 crushstrength so that it can't path anywhere.
Re: The corlab can assist??
Posted: 19 Dec 2010, 22:48
by FLOZi
knorke wrote:How does the engine know whether a UnitDef represents a "building" or a "unit"?
I do not know.
Some things might be:
-only buildings have yardmaps?
-some tags like canFly=true will always make it a unit?
TEDClass?
2 out of 3 ain't half bad.
