Hey Demigod,
If you've designed your team FSM properly, then your STATE1 should have 3 parts, Entry, Update, and Exit. So instead of sending your message constantly, only do it once when your FSM enters the STATE1 state
Code:
function State_STATE1()
{
//On Entry
msgGoHome(my, player1, MCgoHome);
msgGoHome(my, player2, MCgoHome);
msgGoHome(my, player3, MCgoHome);
...
while (...) //enter your transition logic here, or in a break; statement
{
//On Update
...
wait(1);
}
//On Exit
...
}
And i guess you'll want to destroy the message after it has been received too..
Code:
if(my._messageCommand == MCgoHome)
{
selectPlayerState(my, stateGoHome);
my._messageCommand=0;
}
Cheers,
Aris