HandleCommand Features
Moderators: hoijui, Moderators
HandleCommand Features
Is there a full list of the current features supported by the HandleCommand call?
Actually it is in IAICallback.h. In 0.70b2 there was nothing. And I added this:
If you don't understand something, just ask ...
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)
};
Writing lines example:
This should write "V" letter on the top-left corner of the map.
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
Example is here:
Of course you can skip now checking of subversion if you don't support versions before 0.70b3
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);
}
Yes, like this:
These new map painting commands are exactly same that "human" can do in normal play. So they are visible to alies and in replays.
Code: Select all
AIHCAddMapPoint amp;
amp.pos=float3(1000,0,1000);
amp.label="Hello World";
mAICallback->HandleCommand(&);
Veylon, I've tried thata nd it doesnt work as you'd want it.
It palces a marker down, to move the marker or change its contents you need to delete it and create a new one which is problematic, because deleting it means you delete anything within 1000 pixels fo the position, and creating ti makes the minimap do aimation and sounds get played.
There's also no way of changing the colours, and it's networked so you wotn see eit unelss you're controlling the AI.
I've started suign your skywrite class, and I've added the numbers 123456789 : and adapted ti slightly to accept lowercase letters, all thats left are the rest of the alphabet (J onwards) though I took a few that looked similar such as my 5 and the S....
I also re-orientated the letters so that they face the camera straight up rather than sideways.......
It palces a marker down, to move the marker or change its contents you need to delete it and create a new one which is problematic, because deleting it means you delete anything within 1000 pixels fo the position, and creating ti makes the minimap do aimation and sounds get played.
There's also no way of changing the colours, and it's networked so you wotn see eit unelss you're controlling the AI.
I've started suign your skywrite class, and I've added the numbers 123456789 : and adapted ti slightly to accept lowercase letters, all thats left are the rest of the alphabet (J onwards) though I took a few that looked similar such as my 5 and the S....
I also re-orientated the letters so that they face the camera straight up rather than sideways.......