steve40 Posted June 15, 2020 Share Posted June 15, 2020 Does anyone know a way of using papyrus to detect when a companion is in dialogue/command mode and force them out of that mode? I tried using "IsInCommandMode()" and "SetCommandState(False)" on Piper while she was in command/dialogue mode but it returned FALSE and did nothing. I presume this is because the "command mode" referred to in the Papyrus scripts is actually the NPC "Intimidation" dialogue, not the companion dialogue. Any ideas how I can manipulate the companion's normal command/dialogue mode? Link to comment Share on other sites More sharing options...
steve40 Posted June 15, 2020 Author Share Posted June 15, 2020 Well, I couldn't figure out how to force the companion out of dialogue command mode, but I managed to create a global function that checks if the player is commanding the companion: Actor Function CheckDialogueMode() Global {Check if player is in command mode with companion} Actor akCompanion = ((Game.GetFormFromFile(0x000289E4, "Fallout4.esm") as Quest).GetAlias(0) as ReferenceAlias).GetActorReference() Actor akTarget = Game.GetPlayer().GetDialogueTarget() If akTarget If akTarget == akCompanion Debug.Trace("[CWSS] Player is in dialogue command mode with Companion " + akCompanion) Return akTarget EndIf EndIf EndFunction I didn't use any Properties here because I'm using this function in a Utility script not attached to anything. Although I can't force the player/companion out of command mode, I can at least use the above function to know when to block the player from activating my furniture, which is a good-enough solution for me :) Link to comment Share on other sites More sharing options...
Carreau Posted June 15, 2020 Share Posted June 15, 2020 (edited) The command menu is not considered dialogue, it's its own separate menu, MultiActivateMenu. There are specific events thrown when an actor is placed into command mode (OnCommandModeEnter() and OnCommandModeExit() ), and OnMenuOpenCloseEvent() also throws an event for MultiActivateMenu. F4SE has a script in UI to force menus to open and close. So you can use CloseMenu() to force the menus to close. Easiest way to do this, would be to toss your companion into an alias, let the alias register for the menu open/close events, and then close the menu from there. Then you can have a script attached to the controlling quest that fills/clears the alias as needed. https://www.creationkit.com/fallout4/index.php?title=CloseMenu_-_UI EDIT: For correcting information Edited June 15, 2020 by Carreau Link to comment Share on other sites More sharing options...
Recommended Posts