HandleCommand Features
Posted: 04 Mar 2006, 12:37
Is there a full list of the current features supported by the HandleCommand call?
Open Source Realtime Strategy Game Engine
https://springrts.com/phpbb/
Code: Select all
// HandleCommand structs:
const int AIHCQuerySubVersionId=0;
struct AIHCQuerySubVersion ///< result of HandleCommand is version of this sub interface
{
AIHCQuerySubVersion(): commandId(AIHCQuerySubVersionId) {}
int commandId; ///< equal to 0
};
// These supported in sub version 1
const int AIHCAddMapPointId=1;
struct AIHCAddMapPoint ///< result of HandleCommand is 1 - ok supported
{
AIHCAddMapPoint(): commandId(AIHCAddMapPointId) {}
int commandId; ///< equal to 1
float3 pos; ///< on this position, only x and z matter
char *label; ///< create this text on pos in my team color
};
const int AIHCAddMapLineId=2;
struct AIHCAddMapLine ///< result of HandleCommand is 1 - ok supported
{
AIHCAddMapLine(): commandId(AIHCAddMapLineId) {}
int commandId; ///< equal to 2
float3 posfrom; ///< draw line from this pos
float3 posto; ///< to this pos, again only x and z matter
};
const int AIHCRemoveMapPointId=3;
struct AIHCRemoveMapPoint ///< result of HandleCommand is 1 - ok supported
{
AIHCRemoveMapPoint(): commandId(AIHCRemoveMapPointId) {}
int commandId; ///< equal to 3
float3 pos; ///< remove map points and lines near this point (100 distance)
};
Code: Select all
float3 pos1 = float3(0,100,0);
float3 pos2 = float3(50,100,100);
float3 pos3 = float3(100,100,0);
int groupid = cb->CreateLineFigure(pos1, pos2, 5, 0, 3000, 0);
// creates new figure group
cb->CreateLineFigure(pos2, pos3, 5, 0, 3000, groupid);
// width = 5 pixels, lifetime = 3000 frames
cb->SetFigureColor(groupid, 1.0, 0.0, 0.0, 1.0f); //red
Code: Select all
AIHCQuerySubVersion amq;
if (mAICallback->HandleCommand(&amq)>=1)
{
// new functions are supported
AIHCAddMapLine aml;
aml.posfrom=float3(1000,0,1000);
aml.posto=float3(1200,0,1000);
mAICallback->HandleCommand(&aml);
}
Code: Select all
AIHCAddMapPoint amp;
amp.pos=float3(1000,0,1000);
amp.label="Hello World";
mAICallback->HandleCommand(&);