FOSE Loops/GetNextRef Help Request

Post » Tue Nov 09, 2010 3:48 pm

Edit:

OK, can someone PLEASE give me a step-by-step guide to ref-walking? I've spent the best part of 2 hours now (since my original post/edit) trying to get this working, and getting no-where... I've tried mimicing other people's scripts, making my own, the lot, but once the game starts, I get an instant CTD.

What I want to do is Ref Walk through the NPCs and Creatures, and find the Ghouls, so I can deal with them in a certain way. It's the last part of my Mod, and it is driving me crazy :(
User avatar
Chris Jones
 
Posts: 3435
Joined: Wed May 09, 2007 3:11 am

Post » Tue Nov 09, 2010 7:40 pm

You should be able to adapt this:

short iEnableRefWalkref rCurrentRefBegin GameMode	if (iEnableRefWalk)			set rCurrentRef to GetFirstRef 200 1 0 ; Actors		Label 10		if rCurrentRef			if (rCurrentRef.GetIsRace Ghoul == 1)				if (rCurrentRef.GetDead == 0)	;maybe you want to skip if they're dead					; Do stuff with rCurrentRef				endif			endif			set rCurrentRef to Pencil01 ; Prevent apple bug			set rCurrentRef to GetNextRef			Goto 10		endif				set iEnableRefWalk to 0	endifEnd


Edit:
If you are looking for Feral Ghouls, they are creatures, so instead of checking race, you check:

			if (rCurrentRef.GetIsCreature == 1)        				if (rCurrentRef.GetIsCreatureType == 5)        					if (rCurrentRef.GetDead == 0)	;maybe you want to skip if they're dead        						; Do stuff with rCurrentRef        					endif        				endif        			endif


The tutorial for loops is here: http://www.cipscis.com/fallout/tutorials/loops.aspx
User avatar
Lily Something
 
Posts: 3327
Joined: Thu Jun 15, 2006 12:21 pm

Post » Tue Nov 09, 2010 3:55 pm

Thank-you, that is helpful :) I can't believe I've had such trouble with this!! But things seem to be working now :D Merci.
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm


Return to Fallout 3