Taldrenites > Starfleet Command Mission Scripting

Trying to add a comm button

(1/1)

rogerbacon:
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?

TarMinyatur:
Where do you want this button to appear? On the fleet command bar? What's your goal? There is a hotkey to launch Fighters and PF's.

Navigation

[0] Message Index

Go to full version