g2mXagent Posted October 26, 2018 Share Posted October 26, 2018 (edited) i know there is some function like IsDoingFavor() or condition function IsInFavor() for Companion.but is there a way to directly determine the player's status?this is my way:;Property Faction Property CurrentCompanionFaction auto ;Function int Function IsFollowerInFavorState() Actor[] playerFollowers = Game.GetPlayerFollowers() int index = 0 while (index < playerFollowers.Length) if (playerFollowers[index].IsInFaction(CurrentCompanionFaction) && playerFollowers[index].IsDoingFavor()) Return 1 ;Yes, you are currently controlling a companion! endIf index += 1 endWhile Return 0 ;No. EndFunction It is inefficient and difficult to use. I need a smarter way to do this. Edited October 26, 2018 by g2mXagent Link to comment Share on other sites More sharing options...
Reneer Posted October 26, 2018 Share Posted October 26, 2018 Sounds like the event https://www.creationkit.com/fallout4/index.php?title=OnCommandModeGiveCommand_-_Actor is what you are looking for. Link to comment Share on other sites More sharing options...
SKKmods Posted October 26, 2018 Share Posted October 26, 2018 If (Alias_Companion.GetActorReference().IsCommandedActor() == TRUE) ;Alias property direct from Followers Quest Elseif (Alias_DogmeatCompanion.GetActorReference().IsCommandedActor() == TRUE) ;Alias property direct from Followers Quest Link to comment Share on other sites More sharing options...
g2mXagent Posted October 27, 2018 Author Share Posted October 27, 2018 (edited) Thanks for the two tips. I have improved my approach now. this is script:... Event OnCommandModeEnter() ;mark the player in command mode. endEvent Event OnCommandModeExit() ;mark the player not in command mode. endEvent It can partially work properly. suppose I have 4 companions, it can only work randomly on a single companion, other companions did not respond.I tried to change the [Reference Alias] to [Ref Collection Alias], after that, all companions no longer responded ... ... ** oh, I use [Unlimited Companion Framework], it allows multiple companions.I am thinking, can I apply OnCommandModeEnter() to Player? Edited October 27, 2018 by g2mXagent Link to comment Share on other sites More sharing options...
GguyWesker101 Posted October 28, 2018 Share Posted October 28, 2018 If by controlling you mean if you have a companion with you at the time, then yes. Use "Getinfaction: Currentcompanionfaction" as a requirement to make something trigger only if that target of the requirement is your follower, and use "Getinfaction: HasbeenCompanionfaction" to make it only fire/not fire if the companion has never been recruited before/has been recruited before. Link to comment Share on other sites More sharing options...
g2mXagent Posted October 28, 2018 Author Share Posted October 28, 2018 On 10/28/2018 at 11:55 AM, charliedfsf said: If by controlling you mean if you have a companion with you at the time, then yes.Use "Getinfaction: Currentcompanionfaction" as a requirement to make something trigger only if that target of the requirement is your follower, and use "Getinfaction: HasbeenCompanionfaction" to make it only fire/not fire if the companion has never been recruited before/has been recruited before. GetInFactionhttps://www.creationkit.com/index.php?title=GetInFactionit say: This console command works if used in Console, but doesn't work if used as Condition. and when i use it in Conditions, It turns purple: and it didn't work. Link to comment Share on other sites More sharing options...
SKKmods Posted October 28, 2018 Share Posted October 28, 2018 If you are interested in base game companions CurrentCompanionFaction is always the current fill of either Alias_Companion or Alias_DogmeatCompanion on the Followers Quest. Be careful with HasBeenCompanionFaction, most base game companions initialize as members with rank -1 which GetInfaction returns TRUE, so you need to check for GetFactionRank() >= 0 to actually test if they HAVE BEEN or ARE AVAILABLE as a companion. It's the base activation logic for SKKUnlockAllCompanions. PS GetInfaction works fine as a condition in Fallout4, thats a Skyrim page. Link to comment Share on other sites More sharing options...
werr92 Posted October 28, 2018 Share Posted October 28, 2018 (edited) If by "controlling a companion" you imply having someone with you, then I would approach this whole thing different. Create an alias which is "External Alias Ref -- Followers -- Companion". Mark it 'Optional' and 'Allow Reserved'. Then when you need to check something, say in a stage fragment script, I would call a function on it there (just when needed). For that I would add a script on the quest itself, where to keep custom funtions (as a library) to be called in action -- in a stage fragment, as an example above. Check, if alias contains reference first (meaning, the companion is with us) -- this is why we ticked it 'Optional', and then everything else, such as going into a STATE within script where you wait for events likeOnCommandModeEnter()but for that, you must register your quest script for a remote event from this Reference Alias. For instance:Scriptname TestQuestSCR extends Quest ReferenceAlias property RA01 auto ;That ReferenceAlias, discussed earlier Actor ActorREF01 = NONE Function CheckCompanionIfAny() ;to be called from the quest fragment scripts, ect ActorREF01 = RA01.GetActorRef() if ActorREF01 != NONE RegisterForRemoteEvent(ActorREF01, "OnCommandModeEnter") GoToState("CommandModeStateCheck") endif endfunction Event Actor.OnCommandModeEnter(Actor akSender) if akSender == ActorREF01 ;do your filthy stuff UnregisterForRemoteEvent(ActorREF01, "OnCommandModeEnter") GoToState("Finished") endif endevent STATE Finished ;finished working. Waiting for the next external call of CheckCompanionIfAny() ENDSTATE Edited October 28, 2018 by werr92 Link to comment Share on other sites More sharing options...
g2mXagent Posted October 29, 2018 Author Share Posted October 29, 2018 Already beyond my knowledge, I need time to understand. Link to comment Share on other sites More sharing options...
Recommended Posts