View topic - The corlab can assist??



All times are UTC + 1 hour


Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: The corlab can assist??
PostPosted: 18 Dec 2010, 22:57 

Joined: 11 Jul 2009, 13:03
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 ...)


Top
 Offline Profile  
 
PostPosted: 18 Dec 2010, 23:07 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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
:?


Top
 Online Profile  
 
PostPosted: 18 Dec 2010, 23:18 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
My Diagnosis?

Image

BAD BABYSITTING MODDING.


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 14:08 

Joined: 11 Jul 2009, 13:03
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"?


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 15:32 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
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?


Top
 Online Profile  
 
PostPosted: 19 Dec 2010, 16:35 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
tedclass is not used.

How does spring know? Easy. canMove = true/false,


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 16:49 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
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.


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 16:50 
AI Coder

Joined: 17 Mar 2008, 19:03
Location: RF
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.


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 17:03 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
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.


Top
 Offline Profile  
 
PostPosted: 19 Dec 2010, 22:48 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
knorke wrote:
Quote:
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. :wink:


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.