Jump to content

Prevent NV companions from entering a cell?


Belthan

Recommended Posts

Is there a generic way in FNV to prevent any NPC with

SetPlayerTeammate 1

from entering a cell? My FNV mod has a "Tranquility Lane" type simulation where companions shouldn't be able to follow, but they do.

 

FO3 companions didn't follow into Tranquility Lane. MQ04Script enumerates vanilla companions and sets them to use their Wait package, but even companions from mods are left behind when the script calls

Player.moveto MQ04StartBench

Companions are also left behind if I use the same command from the console, so it isn't because of some magic in MQ04Script. I suspect it may be because there are no portals or indirect paths between the TL worldspace and the Wasteland worldspace. Ditto for the TL interior cells (they have portals to the TL worldspace, but no connection to the Wasteland worldspace).

 

My FNV mod has a similar setup (simulation is an interior cell with no portals at all, accessed via activators which call player.moveto), and yet companions still follow into the simulation. Is the behavior of the moveto function with regard to companions different between FO3 and FNV, or am I missing something?

 

Obviously, the activator could enumerate known companions and set them to wait, but that still wouldn't prevent companions from third-party mods from following. I suppose I could check GetPlayerTeammateCount in the activator script and pop up a message that says "you can't enter the simulation until you dismiss your followers", but that would probably break immersion worse than having your companions with you in the simulation.

 

As always, any advice is appreciated!

 

Belthan

Link to comment
Share on other sites

In one of the game updates (1.2.0) the devs did this:

 

- Companions will always fast travel with you, unless told to wait or sent away

 

 

 

That's a quote from the update notes from the Beth site. They did it because the companions were getting lost a lot. They also added their markers on the map at that time.

 

:smile:

Link to comment
Share on other sites

That completely explains the difference between what I'm seeing in FNV and what I saw in FO3, thanks! I assume they didn't provide an undocumented function to temporarily disable that feature? For now, I'll enumerate known companions in the activator script the way the Lucky 38 script does, but if anybody can think of a workaround that will work with 3rd-party companions I'd love to hear it.

Link to comment
Share on other sites

  • 1 month later...

I suppose you could have a trigger surrounding the coc/door teleport marker that scripts npcs with that variable set to 1 to teleport somewhere else and toggle their AI but the exact syntax might be tricky to figure out. You'd also have to figure out how to get them back when you leave.

 

Possibly adding an AI package that conditions to only activate when in that cell and has a moveto command in it's on start result script, but you'd have to add it to any NPC that might be entering your cell and if you're trying to take an "Anyone Follows" type mod or mod added companions into account that's gonna be almost impossible.

Link to comment
Share on other sites

  • 4 weeks later...

Actually I think there is an option in the AI tab to prevent them from going in interior cells. Gotta double check that but look in AI tab in a package flag see if there is a flag prevent from something. Maybe I'm wrong but I remember there was something like that.

Another thing is set a condition that if the player is indoor set package to wait.

Link to comment
Share on other sites

I'm actually trying to find a generic method that works for all followers from other mods. I can easily prevent vanilla followers and NPCs I created from entering the simulation, but it looks like 3rd party NPCs will require a compatibility patch specifically for the mod the NPC is from. Which I may eventually do for popular companion mods, but in the meantime I've settled for a rationalization. By design, the simulation gives you the same outfit you were wearing in reality, because your clothes are an intimate, integral part of your immediate, short-term self image and maintaining that continuity makes you feel more relaxed. When CARA scans your brain, she apparently decides the same is true for Willow and replicates her too. :smile:

Link to comment
Share on other sites

Belthan,
I am aware of your general reluctance of using NVSE scripting unless there are no other feasible options. The following is the best approach I can think of at the moment. It should be able to handle both vanilla and 3rd party-made companions.
This segment should run from an activator/quest script, just before entering the simulator. It scans the nearby cells for teammates who are currently following the player, and makes them remain at their position. TempWaitingList is a standard form list; TempGuardPackage is a standard Guard-type AI package, both of which you will have to create.
	set rActor to GetFirstRef 200 3 0
	while IsFormValid rActor
		if rActor.GetPlayerTeammate == 0
		elseif rActor.GetCurrentAIPackage == 1
			AddFormToFormList TempWaitingList rActor
			if rActor.HasVariable "Waiting"
				rActor.SayTo player FollowersWait
			else
				rActor.SetPlayerTeammate 0
				rActor.AddScriptPackage TempGuardPackage
			endif
		endif
		set rActor to TeddyBear01
		set rActor to GetNextRef
	loop

Later, once you exit the simulator, run the below segment to re-gather them to follow you again:

	while rActor := ListRemoveNth TempWaitingList 0
		if rActor.HasVariable "Waiting"
			rActor.SayTo player FollowersLetsGo
		else
			rActor.SetPlayerTeammate 1
			rActor.RemoveScriptPackage
			rActor.EVP
		endif
	loop
Link to comment
Share on other sites

An interesting sidenote:

 

Any NPC that is toggled as a teammate will always follow the player when he/she fast-travels/moves to another cell, regardless of its current AI package, unless that NPC has a script, and in its script there exists a variable named "Waiting", that is set to 1.

Moreover, when "Waiting" equals 1, the NPC will not follow the player when fast-traveling/switching cells, even if the NPC is on a follow package.

 

This is all new to F:NV, and is part of the mostly hardcoded companion-wheel system.

Link to comment
Share on other sites

i think there is a condition isplayermovingtonewspace and you can say something like this

if isPlayerMovingIntoNewSpace == 1 && plyer.isInInterior == 0 ;this code will only trigger once moving from outside to inside

scan all your companion refs to set package to waiting
set doOnce to 1 ;makes the code below trigger once

elseif isPlayerMovingIntoNewSpace == 0 && player.isInInterior == 0 && doOnce == 1

;this triggers when you're outside right after coming from inside cause the flag doOnce is set to 1 when you moved from outside to inside..so when you come back out this runs first thing
scan all your companion refs change package
set doOnce to 0 ;only once..gets reset when again moving from exterior to interior

endif

and put it on a really small delay to prevent CTD

alternatively you can individually check each companion ref see if you have them hired and then see if their current package is guard/follow then uncheck it that way probably less power hungry but a bit more code

Edited by africaisstarving
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...