Way to determine current cell or encounter zone?

Post » Sat May 28, 2011 5:00 pm

Are there any script functions that can be used to determine the current cell OR encounter zone that the player is in, and in turn if that cell is in contained in a particular formlist?
User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Sat May 28, 2011 2:25 pm

As far as I know, FOSE's http://fose.silverlock.org/fose_command_doc.html#GetParentCell is the only function that can do this. In order to determine if a non-reference form is in a form list, use FOSE's http://fose.silverlock.org/fose_command_doc.html#ListGetFormIndex.

Cipscis
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Sat May 28, 2011 12:51 pm

Thanks! Although, I'm still bewildered as to why the script isn't working . . . here's the relevant snippet:

ref currentCellshort stateshort CellIDBegin GameModeset currentCell to player.getParentCell          ; working correctlyset CellID to -1set CellID to ListGetFormIndex ULCellProcList currentCell     ; problem with this line?if CellID >= 0	printToConsole "Cell Processing..."	set state to 1elseif CellID <= -1	printToConsole "Cell Not in Process List..."	set state to 2endifEnd


The ULCellProcList parameter is a FormList containing cells that I want to be processed.

The CellID variable never seems to return anything other than the -1. Is the syntax for the ListGetFormIndex wrong?

Thanks!
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am

Post » Sat May 28, 2011 8:07 pm

The ULCellProcList parameter is a FormList containing cells that I want to be processed.

The CellID variable never seems to return anything other than the -1. Is the syntax for the ListGetFormIndex wrong?

I can't help with the synatx (I'm not familiar with FOSE, though from my reading of ListGetFormIndex it looks like it should work), and it would certainly be easier if it can work with a list crawl, but I just got on to say (and in response to your original question) there are a few commands you can use to determine cells, but they all rely on you knowing specifically what you're looking for (which is why the FOSE command is so useful). However if your list is short, you can do a sequence of static checks with http://geck.gamesas.com/index.php/GetInCell. The other cell-related commands are http://geck.gamesas.com/index.php/GetInSameCell, http://geck.gamesas.com/index.php/GetInWorldspace, and http://geck.gamesas.com/index.php/GetInZone. The latter could actually be used as a de-facto list if you made a new encounter zone, assigned cells to it, and checked against the zone. Of course, this assumes the cells you want don't already have zones. I know, not terribly helpful, but there they are anyway.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Sat May 28, 2011 7:00 pm

I'm using ListGetFormIndex the same way you are, but for something different, and it works.

set iFormIndex to ListGetFormIndex rWeaponRepairList rBaseInvObj


According to the FOSE docs, GetParentCell returns a base object, so yours should work too, I would think. I know that ListGetFormIndex always returns -1 when searching for a reference in a list, but that shouldn't apply here?

Edit: HugePinball posted something in this thread that might help:
http://www.gamesas.com/index.php?/topic/1079066-saving-formlists/page__p__15717978__hl__listaddref__fromsearch__1&#entry15717978
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am


Return to Fallout 3