Cell Walk/Ref Walk Tutorial?

Post » Tue May 17, 2011 12:40 am

I've seen lots of mods that use scripts that stop at each item/npc in a cell and do stuff to them (I believe that's the techinal term) and I thought "What a great idea, I could use something like that for my mod" but alas my efforts have proved fruitless. So I was wondering if there was anywhere that I could read up on both Ref Walk theory and its application. I basically want to step through a cell and interigate each refrence, then run a different script for each possible result. So far my results have been Nothing Happens or CTD.
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Tue May 17, 2011 6:40 am

Check out http://www.gamesas.com/index.php?/topic/1112886-how-to-make-a-script-that-influences-every-npc-close-to-you/ thread.

The script at the end is what you need :)
User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Tue May 17, 2011 5:05 am

I've seen lots of mods that use scripts that stop at each item/npc in a cell and do stuff to them (I believe that's the techinal term) and I thought "What a great idea, I could use something like that for my mod" but alas my efforts have proved fruitless. So I was wondering if there was anywhere that I could read up on both Ref Walk theory and its application. I basically want to step through a cell and interigate each refrence, then run a different script for each possible result. So far my results have been Nothing Happens or CTD.

This is the only documentation i've found: http://cs.elderscrolls.com/constwiki/index.php/GetFirstRef
For the FO3 version, the Form_Type codes are different: http://fose.silverlock.org/fose_command_doc.html#Form_Type_IDs
When you are doing a ref-walk loop, you are only specifying one of these types for that loop.
I prefer to run the ref-walk in quest scripts, which makes it easy to set how often the walk runs, and it will always be centered on the player's current cell.
The things i've seen (done) to make it CTD are:
1. 'Do stuff' to a ref that is zero - you need to check if getfirstref or getnextref returns zero before 'doing stuff' to it;)
2. having the GOTO command in the wrong place, so the loop keeps running getnextref after already returning zero on the previous loop.

The tutorials i've had were by reading posts here on the forum
User avatar
Annick Charron
 
Posts: 3367
Joined: Fri Dec 29, 2006 3:03 pm

Post » Tue May 17, 2011 4:14 pm

This is the only documentation i've found: http://cs.elderscrolls.com/constwiki/index.php/GetFirstRef

There is documentation available for the FOSE version in the FOSE documentation and on the GECK Wiki:
  • http://fose.silverlock.org/fose_command_doc.html#GetFirstRef
  • http://geck.gamesas.com/index.php/GetFirstRef
For more useful information, I've written a tutorial on loops, hosted on http://www.cipscis.com/, that includes examples of useful types of loops like reference walking loops - http://cipscis.com/fallout/tutorials/loops.aspx

Cipscis
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Tue May 17, 2011 2:05 am

I don't know if this will help, but I just posted a http://www.fallout3nexus.com/downloads/file.php?id=14342 on the nexus concerning ref walks. You have your mod include it as a master, and use a script to add an item to its form list, and it places a copy of that item in the inventory of every actor (NPCs, supermutants, radroaches, etc.) that the player comes in contact with. The item you add is generally supposed to be a token with a script. Even if you're trying to do something different, the code might be useful.
User avatar
Juliet
 
Posts: 3440
Joined: Fri Jun 23, 2006 12:49 pm

Post » Tue May 17, 2011 4:18 pm

Thank you all for the response, it looks like I got some more reading to do.

@Imp of the Perverse
I downloaded your utility as soon as you announced it was available in your other thread. I cracked it open and had a look around, I think it will be a very big help. Thanks for putting it out there.
User avatar
phil walsh
 
Posts: 3317
Joined: Wed May 16, 2007 8:46 pm


Return to Fallout 3