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

Post » Tue Dec 06, 2011 8:11 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:


Cipscis always puts in his examples - set the ref to something before calling GetNextRef
set rCurRef to Pencilset rCurRef to GetNextRef

User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Tue Dec 06, 2011 7:35 am

Ok I tried setting it to something else first, but it still does not work. I will upload it and send you a link pkleiss.
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Tue Dec 06, 2011 1:05 pm

It's possible that whatever script handles Fawkes' behaviour is moving him to the player once it detects that the player has moved away. Try using http://geck.gamesas.com/index.php/Disable/http://geck.gamesas.com/index.php/Enable instead of http://geck.gamesas.com/index.php/SetUnconscious.

When reverting the followers to their previous state, I recommend you store them in a form list instead of performing another reference walk. Something like this (based on pkeliss' last script posted):
Spoiler
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.Disable				rCurRef.ListAddRef FollowersList ; Replace "FollowersList" with whatever form list you want to store the followers in			endif			set rCurRef to Pencil01 ; Prevent "Apple" bug in which GetNextRef doesn't update rCurRef properly			set rCurRef to GetNextRef			Goto 10		Endif		Set DoOnce to 1	Endif	If task == 13 && DoOnce == 1					;recover NPC followers		Label 20		set rCurRef to ListGetNthForm FollowersList 1		if rCurRef			rCurRef.Enable 0			ListRemoveNthForm FollowersList 1			Goto 20		Endif		Set DoOnce to 2	EndifEnd

I don't have Fallout 3 or the GECK installed right now, so I haven't been able to compile or test it, but hopefully it should work as intended.

Cipscis

EDIT:

Thought I'd mark the occasion:

This is my 4,700th post.

Cipscis
User avatar
Genocidal Cry
 
Posts: 3357
Joined: Fri Jun 22, 2007 10:02 pm

Post » Tue Dec 06, 2011 6:23 am

I am assuming that using a list to restore the followers is simply more efficient than a second ref-walk. As for the apple bug, is it necessary to assign a value to rCurRef before the GetFirstRef statement too? Or does the bug only manifest after the GetNextRef statement? Thanks for the tips once again. Gun's issue was a dirty save issue anyway, he just didn't post an update.
User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Tue Dec 06, 2011 8:33 am

Gun's issue was a dirty save issue anyway, he just didn't post an update.
Ah, that would explain it. I'm glad to hear your script worked in the end.

The reason why I'd prefer to use a form list isn't really because I think it would be more efficient (I don't know for sure if it would or not, although I would expect it to be if there were a lot of references to walk through), it's more that it just feels neater to me. Once the player's followers have been found once, I'd rather store their references somewhere instead of having to search for them again when I need them later. It could also be technically possible to screw something up via a false-positive in the "reset" phase if you use a second reference walk, but that situation is so unlikely it's probably not worth considering.

As far as I know, the "apple bug" fix is only required before http://fose.silverlock.org/fose_command_doc.html#GetNextRef.

Cipscis
User avatar
Del Arte
 
Posts: 3543
Joined: Tue Aug 01, 2006 8:40 pm

Post » Mon Dec 05, 2011 8:40 pm

This is my 4,700th post.
Cipscis


You're already a master in my book. And how 'bout them kiwis in the World Cup. Nice job versus Italy!
User avatar
Multi Multi
 
Posts: 3382
Joined: Mon Sep 18, 2006 4:07 pm

Post » Tue Dec 06, 2011 5:47 am

This is a great resource. I'm currently using a ref walk loosely based on this code to add the chance of an explosion for NPCs killed while wearing certain power armor. I'm sure I'll think up several more uses for it.
User avatar
CRuzIta LUVz grlz
 
Posts: 3388
Joined: Fri Aug 24, 2007 11:44 am

Previous

Return to Fallout 3