-
I know it's not implemented as a base EPF feature yet but I was hoping to get some basic integration with the vanilla deploy menu working. Currently I have this override void OnCharacterDataLoaded(EDF_EDbOperationStatusCode statusCode, EPF_CharacterSaveData characterData, Managed context)
{
Tuple2<int, string> characterContext = Tuple2<int, string>.Cast(context);
PrintFormat("PMCW: OnCharacterDataLoaded: Player %1", characterContext.param2);
if (characterData)
{
LoadCharacter(characterContext.param1, characterContext.param2, characterData);
}
else
{
// deploy menu needs faction set before opening
PlayerController playerController = GetGame().GetPlayerManager().GetPlayerController(characterContext.param1);
if (!playerController)
return;
SCR_PlayerFactionAffiliationComponent fac = SCR_PlayerFactionAffiliationComponent.Cast(playerController.FindComponent(SCR_PlayerFactionAffiliationComponent));
Faction def = GetGame().GetFactionManager().GetFactionByKey("PMC"); // @TODO load faction from persisted state
PrintFormat("PMCW: OnCharacterDataLoaded: Setting player %1 faction to %2", characterContext.param2, def.GetFactionKey());
fac.SetFaction(playerController, def);
// assign new player to their own new group, they can invite or join others later
SCR_PlayerControllerGroupComponent playerControllerGroupComp = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(characterContext.param1);
if (!playerControllerGroupComp)
return;
playerControllerGroupComp.RequestCreateGroup(); //requestCreateGroup automatically puts player to the newly created group
SCR_DeployMenuMain.OpenDeployMenu();
}
} But upon player death I am struggling to get the deploy menu to open again, I replaced the call to GetGame().GetCallqueue().Call(SCR_DeployMenuMain.OpenDeployMenu); But it doesn't open and the player is just left with a black screen after death, nothing obvious from the logs so I'm guessing something is just silently returning out, any ideas what I'm missing here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This logic does not work. It is executed on the server and will not work in multiplayer. |
Beta Was this translation helpful? Give feedback.
This logic does not work. It is executed on the server and will not work in multiplayer.