Here is a stripped (but compiling) version of the examples in the pdf.
By running the following script in the debugger, you can easily see that there is really something transmitted.
/**
* This is a stripped version of the message receiving example in MythExp2.pdf
*/
rule checkForNewMessages
minInterval 5
active
{
bool IsLastMessage = false;
static int messageCounter = 0;
// dump all messages
while (IsLastMessage == false)
{
if (aiCommsGetRecordPromptType(messageCounter) != -1)
{
int senderID = aiCommsGetRecordPlayerID(messageCounter);
int promptType = aiCommsGetRecordPromptType( messageCounter);
int data = aiCommsGetRecordData( messageCounter);
vector loc = aiCommsGetRecordPosition( messageCounter);
aiEcho("Player "+ senderID+ " has sent a message");
aiEcho("Contents:");
aiEcho(" promptType="+promptType);
aiEcho(" data="+data);
aiEcho(" location="+loc);
}
else
IsLastMessage = true;
messageCounter++;
}
}/**
* This is a stripped version of the example in MythExp2.pdf
*/
rule sendAMessage
minInterval 1
active
{
for (i= 0; < cNumberPlayers)
{
aiCommsSendPromptWithVector( i, cAICommPromptHelpHere, -1,
0, -1, -1, 5, kbGetMapCenter());
aiEcho("sendAMessage: Sending Message to Player "+ i);
}
}void main(void)
{
}
As a test, I chose this script for the first two players and watched the debugger output. I do not fully understand what I see though.
Why do I receive messages from player 0? My two players should be player #1 and player #2`, I suppose.
Anyways, I think this is really good news.
These are the interesting functions:
- long aiCommsGetRecordType( int id)
- long aiCommsGetRecordPromptType( int id)
- long aiCommsGetRecordPlayerID( int id)
- long aiCommsGetRecordResponse( int id)
- long aiCommsGetResponseData( int id)
- long aiCommsGetRecordData( int id)
- vector aiCommsGetRecordPosition( int id)
Just for completness: the original article with working link :-)
It does not contain anything interesting except page 11, I therefore did not bother to translate it.If it turns out to be what it seems to be in the first place, this would really mean a lot mre possibilities for scripting... :-)
[This message has been edited by kalus (edited 06-23-2003 @ 04:35 PM).]