Can you momentarily cut off NPC's ability to follow the play

Post » Mon Dec 05, 2011 10:14 pm

I have several flashback in my mod, where you go back in time to pre-war, and view another characters memories. But I just recently tested with a follower, and found that he would teleport to the nearest Navmeshed area within the flashback. This obviously killed the whole thing. Is there a way I can stop the followers from teleporting near me during the flashbacks? Or is this unavoidable? If so does anyone have any suggestions as to what I should do about it? Thanks for any help.

Gunmaster95
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Tue Dec 06, 2011 8:41 am

Ya gun, I have an answer for this as well. You may not like it as my answer requires FOSE. I did the same thing with UC for the training rooms. All of the followers were sent someplace else for the duration of the training. I used what is called a 'ref-walk' to target all followers and place them somewhere safe and immobilize them. Then when the training was over, they were woken up and came running back to the player. If you interested, I'll post a script. But if you want to wait and see if anybody has some non-FOSE solutions, I'd understand.
User avatar
Rachyroo
 
Posts: 3415
Joined: Tue Jun 20, 2006 11:23 pm

Post » Tue Dec 06, 2011 6:19 am

Alright. I would like to avoid using FOSE at all costs, as I have so far. And I may also end up cutting the flashbacks out anyway... it would remove my need for an answer to this. Since my last planned flashbacks would take alot of useless work that could be put elsewhere, and the way I set them up, they are kinda 'pointless." They dont help build the story much or anything. Unless I can find a none FOSE way, or find alot of other things I can improve my mod with, enough to use FOSE.
User avatar
Lovingly
 
Posts: 3414
Joined: Fri Sep 15, 2006 6:36 am

Post » Tue Dec 06, 2011 7:26 am

Right before the flashback, I would run a check to see which follower is present, then just grab their ref and SetActorsAI 0 on them. Total processing shutdown, so even default followers will still think they're in follow mode.. even if they're only a rendered ghost and not much more. No need to walk for unknown refs if you can just look at the persistant listed where the follower is placed in world and use that. Even their quest might give up their ref nice and easy. Your own followers you would know their refs.. any other mods followers I would ignore.
User avatar
Quick Draw
 
Posts: 3423
Joined: Sun Sep 30, 2007 4:56 am

Post » Tue Dec 06, 2011 3:31 am

Right before the flashback, I would run a check to see which follower is present, then just grab their ref and SetActorsAI 0 on them. Total processing shutdown, so even default followers will still think they're in follow mode.. even if they're only a rendered ghost and not much more. No need to walk for unknown refs if you can just look at the persistant listed where the follower is placed in world and use that. Your own followers you would know their refs.. any other mods followers I would ignore.

But wouldn't that only work for vanilla followers? What about all the ones added by mods?
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm

Post » Tue Dec 06, 2011 8:29 am

Yup, that's the whole point of the ref walk, it finds all followers vanilla and custom, creature or NPC. I don't know how you could account for custom followers without it. But somebody might know. If all you had to worry about was vanilla followers, then it would be as simple as running a check on each. Personally, I don't have an issue with FOSE. I installed it long before I ever started modding as so many mods I wanted to try required it anyway. But I know there are those out there who want to avoid it. Heck, I tried to avoid it at first with my mod as well.
User avatar
Makenna Nomad
 
Posts: 3391
Joined: Tue Aug 29, 2006 10:05 pm

Post » Tue Dec 06, 2011 12:32 pm

Alright, I too have had it since starting to use mods, so I will go ahead and use it. Plus it could open up possibilities for things I could do down the road. I suppose you should post the ref walk script, and then I can put it in and get it working.
User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Tue Dec 06, 2011 2:32 am

But wouldn't that only work for vanilla followers? What about all the ones added by mods?

It wouldn't work for them, but if it's an issue you think might become a problem, you could try setting up a "jerk trap" instead and catch them that way.
You intentionally move the player to a spot where you know the follower will appear at, but pull the player out fast with a MoveTo or SetPos and into the cut scene. Hopefully if there's no path to the player but it's in the same cell they'll stay in the dummy area. Maybe some kind of trigger spell at that spot might keep them there.. i dunno.. getting a ref seems to be the problem.
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Mon Dec 05, 2011 9:44 pm

For what its worth, here is my simplest example of a ref walk that captures all followers and moves them to one of two xmarkers I setup. This script can handle up to 8 followers. Any more and it will pile them all up on one xmarker. I don't know where I heard it but I heard that moving more than 4 NPCs to the same location can cause issues. The first part moves the followers to the xmarkers and knocks them unconscious, the second part revives them and they run back to the player themselves as the xmarkers are located in the same cell as the player would be for this script.
SCN UCACETerminal01ScriptShort TaskShort DoOnceShort NPCCountRef rCurRefBegin GameMode	If Task == 3 && DoOnce ==0					;start Actor follower move		set rCurRef to GetFirstRef 200 0 0			;All actors		Label 10		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				Set NPCCount to NPCCount + 1				If NPCCount > 4					rCurRef.moveto FollowerSPot1				Else					rCurRef.moveto FollowerSpot2				Endif				rCurRef.setunconscious 1				set rCurRef to GetNextRef				Goto 10			else				set rCurRef to GetNextRef				Goto 10			Endif		Endif        	Set DoOnce to 1	Endif	If task == 13 && DoOnce == 1					;recover NPC followers		set rCurRef to GetFirstRef 200 0 0; NPCs		Label 20		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				rCurRef.setunconscious 0				set rCurRef to GetNextRef				Goto 20			else				set rCurRef to GetNextRef				Goto 20			Endif		Endif		Set DoOnce to 2	EndifEnd

User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Tue Dec 06, 2011 1:57 am

Well I am in a navmeshable area, then it teleports the player into the cutscene, so I guess I will just have to use pkleiss solution and work FOSE into the mod.
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Tue Dec 06, 2011 7:13 am

Just an FYI, but there are some inefficiencies in that script with the goto statement parts. There doesn't need to be two of them with a small modification that I'm sure you can see yourself.
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am

Post » Tue Dec 06, 2011 7:58 am

I dont really. :/ I have only used FOSE once, and that was during the kidnapping scene in Verdict, but I got it from someone, so I literally know no functions with FOSE. Also would it be more efficient, if the NPC's didnt have to be moved? Since with your, they are moved away from the player, in my flashbacks, the player is moved away from them. So could you tweak that so it just sets the NPC's to unconcious? That way I dont have to worry about having too many in one spot, or any of that. Also possibly explaining a little bit, because like I said, all the fose functions are jibberish to me. :/
User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm

Post » Tue Dec 06, 2011 12:08 pm

Now streamlined for your specific needs...
SCN UCACETerminal01ScriptShort TaskShort DoOnceRef rCurRefBegin GameMode	If Task == 3 && DoOnce ==0					;start Actor follower move		set rCurRef to GetFirstRef 200 0 0			;200 = All actors		Label 10		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				rCurRef.setunconscious 1			endif			set rCurRef to GetNextRef			Goto 10		Endif        	Set DoOnce to 1	Endif	If task == 13 && DoOnce == 1					;recover NPC followers		set rCurRef to GetFirstRef 200 0 0; NPCs		Label 20		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				rCurRef.setunconscious 0			endif			set rCurRef to GetNextRef			Goto 20		Endif		Set DoOnce to 2	EndifEnd



set rCurRef to GetFirstRef 200 0 0 --> This is the start of the Ref walk, the 200 implies all actors (NPCs & Creatures see the FOSE command docs for a list of values you can enter here). The first zero is the cell depth which is used primarily in exterior cells to determine how many square cells to include in the search. The 'Ref walk' steps through all references in the cell depth area. For an interior cell the cell depth is 0 which implies the current cell as there are no adjacent cells in interior cells. The last zero is to include taken refs - which I have no idea what it does.

Label 10 --> This is a FOSE label. It is used in conjunction with the 'goto' statement. When the script gets to the goto statement, it will loop back to the 'lable' statement and continue. This way you can loop through code repeatedly. The '10' is just a value to identify the label/goto pair. Since you can have many label/goto pairs, each needs a different identifier.

if rCurRef --> This line simply determines if the ref in question is a valid ref. After looping through all of the refs in a cell, this will return zero which enables the loop to end and the rest of the code to be run.

if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1) --> This is a test to see if the ref is using the player as a package target (true for followers following the player) and if the current package of the ref is a follow package. In combination, these two check will only return true for Player followers.

rCurRef.setunconscious 1 --> This knock the ref unconscious - Duh!

set rCurRef to GetNextRef --> This sets the ref variable rCurRef to the next reference in the cell depth (the current cell for interior cells).

Goto 10 --> This sends the pointer for the next code instruction back to the 'label' statement so the ref walk can continue with the next reference.

The first part should be run before your flashback starts and the second part should be run after your flashback ends. For my purposes, thats what the Task variable was used for. The DoOnce was used to prevent the second part from running before the first part (and all other values of 'Task').

The rest you should already understand...
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Tue Dec 06, 2011 9:43 am

Ahh that is simple enough. My flashback is started and ended via trigger, so I will just put either half on the start/end triggers. Thanks alot!!! I will let you know how it works.
User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Tue Dec 06, 2011 4:18 am

Ok I'm guessing this is bad, but it says the command Label is not found. I have checked and I have FOSE installed, and its the latest version. :/
User avatar
Samantha Pattison
 
Posts: 3407
Joined: Sat Oct 28, 2006 8:19 pm

Post » Tue Dec 06, 2011 8:01 am

You must have FOSE installed because GetFirstRef is a FOSE command and you didn't get an error with that statement - and it comes before the label part. Did you spell label lable by odd chance?
User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Tue Dec 06, 2011 7:31 am

No :/ This is the chunk of the script that at the start of the flashback, with the If tweaked so it works for me.

Begin GameMode	If Task == 1		set rCurRef to GetFirstRef 200 0 0		Label 10		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				rCurRef.setunconscious 1			endif			set rCurRef to GetNextRef			Goto 10		Endif        	Set Task to 2	EndifEnd


Its exactly what you typed, copied and pasted, just I changed it to task being 1, and setting it to 2, instead of DoOnce. I have a feeling like I had this problem before, I'm going to go check my age old topics from Verdict. I think when Cipcis gave me a similiar script, it didnt recognize label either.
User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am

Post » Tue Dec 06, 2011 4:59 am

I forgot to mention that you have to start the Geck with FOSE as well by using the 'Fose_Loader -editor' command in place of the geck.exe.


Scripts written with these new commands must be created via the G.E.C.K. after it is launched via fose_loader. Open a command prompt window, navigate to your Fallout 3 install direcory, and type "fose_loader -editor". Alternately you can create a shortcut to fose_loader.exe, open the properties window and add "-editor" to the Target field. The normal editor can open plugins with these extended scripts, but it cannot recompile them and will give errors if you try.

User avatar
Emily Jeffs
 
Posts: 3335
Joined: Thu Nov 02, 2006 10:27 pm

Post » Mon Dec 05, 2011 8:54 pm

Yea that did it. Now it saves just fine. Thanks!!!! I hope this works.
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am

Post » Tue Dec 06, 2011 7:15 am

It should. I used a version of that script four different times in UC without issue. Its also used in my enhanced vision helmet. So it should work except for user error. :D
User avatar
Allison Sizemore
 
Posts: 3492
Joined: Wed Jul 19, 2006 6:09 am

Post » Tue Dec 06, 2011 5:15 am

Alright it is not working. I had Fawkes with me, went into the flash back. It all looked good for a bit, but then poof. There he was. Right next to me. This is the script, with the fose part implemented in, and not functioning for some reason. :/

scn PGMQ2FlashBack1StartTrigSCRIPTfloat timerShort DoOnceShort StageShort Taskref rCurRefBegin OnTriggerEnter Player	If DoOnce == 0 && GetStage PGMQ2 == 45		Set DoOnce to 1		Set timer to 1		Disableplayercontrols 1 1 1 1 0 1 1		Set Stage to 1		Imod PGMQ2FlashBack1StartISM	EndIfEndBegin GameMode	If DoOnce == 1		If Timer > 0			Set Timer to (Timer - GetSecondsPassed)		ElseIf Stage == 1			HaussGhostGTCLRef.MoveTo PGMQ2FlashGhostMoveRef1			Set Stage to 2			Set timer to 1		ElseIf Stage == 2			HaussGhostGTCLRef.MoveTo PGMQ2FlashGhostMoveRef2			Set Stage to 3			Set Timer to 2.5		ElseIf Stage == 3			HaussGhostGTCLRef.disable			Player.RemoveSpell PipBoyLight			Set Stage to 4			Set Timer to 3.5			Imod PGMQ2FlashBack1ISM			Set PGMQ2.PCTimeOfDay To GameHour			Set GameHour to 10			FlashBack1RecepRef.enable			Player.Moveto PGMQ2FlashbackStartRef			ShowMessage PGMQ2Flashback1Message			Set Task to 1		ElseIf Stage == 4			EnablePlayerControls 1 0 0 0 1 0 0			Set Stage to 5			Set DoOnce to 2		EndIf	EndIfEndBegin GameMode	If Task == 1		set rCurRef to GetFirstRef 200 0 0		Label 10		if rCurRef			if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)				rCurRef.setunconscious 1			endif			set rCurRef to GetNextRef			Goto 10		Endif        	Set Task to 2	EndifEnd


Alot of that is just moving the player, and doing the flashback stuff, but I wanted to leave it in just incase. The follower disabler part is at the bottom. It should do it when the player is moved, as when Task is set to 1. But something in there is not working.
User avatar
BethanyRhain
 
Posts: 3434
Joined: Wed Oct 11, 2006 9:50 am

Post » Tue Dec 06, 2011 4:38 am

A couple of things. First I don't know why you have two game mode blocks. I never understood why some one would have two and I don't know how the processing of each in turn is affected. Second, you are moving the player to the flashback in the same frame as you are starting your ref walk. I would prefer to see the ref walk take place in a frame (stage) prior to moving him. Third, I didn't think moving the player with moveto would move his followers too any way. Was fawkes unconscious when he arrived at the player? I would simply add the ref walk (unconscious) as a stage and the ref walk (conscious) as another before and after the stage that moves the player.
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Mon Dec 05, 2011 8:55 pm

Ok I think I did what you meant. And Fawkes would not show up until I walked in the small navmeshed area (due to the receptionist standing there) and he was fully concious and functioning. I could talk to him, he could move, pretty much normal. I did it again after these changes, and it still did not work. I had the part that sets them to unconscious now, as a stage, right before moving the player (Which worked fine so it did something) then the setting them conscious again is in the end trigger as a stage as well, but I think right after moving the player. Here is the script now.

scn PGMQ2FlashBack1StartTrigSCRIPTfloat timerShort DoOnceShort Stageref rCurRefBegin OnTriggerEnter Player	If DoOnce == 0 && GetStage PGMQ2 == 45		Set DoOnce to 1		Set timer to 1		Disableplayercontrols 1 1 1 1 0 1 1		Set Stage to 1		Imod PGMQ2FlashBack1StartISM	EndIfEndBegin GameMode	If DoOnce == 1		If Timer > 0			Set Timer to (Timer - GetSecondsPassed)		ElseIf Stage == 1			HaussGhostGTCLRef.MoveTo PGMQ2FlashGhostMoveRef1			Set Stage to 2			Set timer to 1		ElseIf Stage == 2			HaussGhostGTCLRef.MoveTo PGMQ2FlashGhostMoveRef2			Set Stage to 3			Set Timer to 2.5		ElseIf Stage == 3			set rCurRef to GetFirstRef 200 0 0			Label 10				if rCurRef					if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)						rCurRef.setunconscious 1					endif				set rCurRef to GetNextRef				Goto 10				Endif        		Set Stage to 4		ElseIf Stage == 4			HaussGhostGTCLRef.disable			Player.RemoveSpell PipBoyLight			Set Stage to 5			Set Timer to 3.5			Imod PGMQ2FlashBack1ISM			Set PGMQ2.PCTimeOfDay To GameHour			Set GameHour to 10			FlashBack1RecepRef.enable			Player.Moveto PGMQ2FlashbackStartRef			ShowMessage PGMQ2Flashback1Message		ElseIf Stage == 5			EnablePlayerControls 1 0 0 0 1 0 0			Set Stage to 6			Set DoOnce to 2		EndIf	EndIfEnd


Am I just setting this up incorrectly or something? It should do the refwalk, then once completed, move the player. And it moved the player and all like normal, just didnt set Fawkes unconcious.
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Tue Dec 06, 2011 12:38 pm

Add a Printoconsole command to see it it got there to set Fawkes unconscious:

	if (rCurRef.GetPackagetarget == player) && (rCurRef.GetCurrentAIpackage == 1)		rCurRef.setunconscious 1                           PrintToConsole "Set unconscious -  %n", rCurRef	endif

User avatar
lexy
 
Posts: 3439
Joined: Tue Jul 11, 2006 6:37 pm

Post » Tue Dec 06, 2011 1:19 am

I completely agree with RickerHK. Aside from some messed up indentation, its looks right. The only difference with my script (that works) is the nested DoOnce variable that prevents the ref walk stage from repeating the next frame, but setting the stage to 4 should do the very same thing.

Edit: Package up your mod and send it to me as an esp and tell me where to find these two scripts and I'll play with it. I think I recall that sometimes you need to set the rCurRef to something before the GetFirstRef command. Like 'Set rCurRef to Apple' or the like. I don't have that in my script, but I seem to recall that its needed sometimes to keep the code from borking. :shrug:
User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Next

Return to Fallout 3