callback->canBuildAt() return value

callback->canBuildAt() return value

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
alik83
Posts: 82
Joined: 08 Sep 2004, 15:32

callback->canBuildAt() return value

Post by alik83 »

I wonder if the callback->canBuildAt() returns TRUE if there's a reclaimable feature like a wreck on the test spot?
And how do you get the feature info in that spot? Is it possible?
Thx,
Alik

P.S.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I added these a while back:

Code: Select all

	int GetFeatures (int *features, int max);
	int GetFeatures (int *features, int max, const float3& pos, float radius);
	FeatureDef* GetFeatureDef (int feature);
	float GetFeatureHealth (int feature);
	float GetFeatureReclaimLeft (int feature);
I'm not sure about canBuildAt() though, there are int return codes all over the place and I don't really get their meaning (Plus Im too lazy to take a better look at it)
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

It returns true even if there is a reclaimable feature in the way. Internally spring uses an int where 2=totally clear, 1=clear but feature in the way, both get translated to true though.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Ok thx
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

SJ wrote:It returns true even if there is a reclaimable feature in the way. Internally spring uses an int where 2=totally clear, 1=clear but feature in the way, both get translated to true though.
Would it be possible to add 3=You are trying to place a moho and there is a Mex in the way?

So we could queue Mohos without having to reclaim/destroy them first.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

just a switch that would let us add a build order to a queue even though the engine thinks it won't be able to...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Shouldnt subAI behaviours autoreclaim the wreck then build ontop? Anyways if something else is on the position you gave, perhaps if it returned the unitID of the stationary unit blocking the way.
Post Reply

Return to “Engine”