I've taken the Mul_FreeForAll as my starting point and I want to add a button to every ship at the beginning of the mission. I followed the scripting guide but the button is not appearing.
In CommonShip.h I added
enum eCommStates
{
CommonShipBaseState,
};
In CommonShip.cpp I have
void tCommonShip1::mSetupCommState()
{
tTeamInfo* CommonTeam = fMissionInfo->mGetTeamHandle( mGetTeam() );
CommonTeam->mRegisterCommMessage(CommonShipBaseState, CommonShipBaseState, mGetShipID(), kLaunchFightersButton, kFighterSpawned_msg);
CommonTeam->mGotoCommState(mGetShipID(), CommonShipBaseState);
}
In MissionText.h and .cpp I've set up the appropriate text label and message
In CommonShipBaseState I have a simple debug message (but I can't even get this far since the button never appears)
void tCommonShip1BaseState::mOnCommButtonPress( tShipInfo* ship, int32 buttonID, tShipInfo* targetShip )
{
if (buttonID == kLaunchFightersButton)
{
fMissionInfo->mDebugMessage("This is where I should launch a PF.");
}
}
Can anyone tell me where I might have missed something?