Page 1 of 1

HandleCommand Features

Posted: 04 Mar 2006, 12:37
by krogothe
Is there a full list of the current features supported by the HandleCommand call?

Posted: 04 Mar 2006, 13:48
by Tobi
no

Posted: 04 Mar 2006, 17:24
by Bobris
Actually it is in IAICallback.h. In 0.70b2 there was nothing. And I added this:

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)
};
If you don't understand something, just ask ...

=)

Posted: 04 May 2006, 23:07
by Firenu
would be great if you could supply a code example that draws lines via aicb

=)

Posted: 04 May 2006, 23:31
by Rafal99
Writing lines example:

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
This should write "V" letter on the top-left corner of the map.

Posted: 05 May 2006, 08:24
by Bobris
Example is here:

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); 
    }
Of course you can skip now checking of subversion if you don't support versions before 0.70b3

Posted: 05 May 2006, 16:31
by Rafal99
Oh sorry for my offtopic.

So this means that it is now possible to make labelled point via aicb, yea? :o
Good job!

Posted: 05 May 2006, 17:23
by Bobris
Yes, like this:

Code: Select all

AIHCAddMapPoint amp;
amp.pos=float3(1000,0,1000);
amp.label="Hello World";
mAICallback->HandleCommand(&amp);
These new map painting commands are exactly same that "human" can do in normal play. So they are visible to alies and in replays.

Posted: 05 May 2006, 17:47
by AF
Yay my ally cursor groupAI can be fixed now!!!

Posted: 09 May 2006, 22:05
by Veylon
Cool. Now I don't have to make the letters out of lines. Thanks a lot!

Posted: 10 May 2006, 10:23
by AF
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.......

Posted: 11 May 2006, 20:56
by Veylon
Well, i suppose if you kept a list of what's around, you could copy what's going to get deleted and then reinsert it...or something...

Anyway, I'll fiddle with the different ways and see what comes up.