Dynaverse.net

Taldrenites => Starfleet Command Mission Scripting => Topic started by: rogerbacon on June 27, 2014, 08:35:06 pm

Title: Trying to add a comm button
Post by: rogerbacon on June 27, 2014, 08:35:06 pm
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?
Title: Re: Trying to add a comm button
Post by: TarMinyatur on February 20, 2015, 07:38:25 am
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.