Scanning an exterior cell

Post » Tue May 17, 2011 1:28 pm

While my question is relatively self-explanatory, here is my problem:

There is an exterior worldspace cell that I want to scan for a particular item type, however the problem is that I want to do this on game-start and physically moving the player closer to the cell in order to use GetFirstRef 0 2 is rather... immersion-breaking. Might anyone happen to know a way of scanning an (exterior) cell? (I'm looking for persistent references within that cell).
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Mon May 16, 2011 11:16 pm

Hi Reneer (Guard Guru Extraordinar!)

will this work for you:

GetFirstRefInCell - Works the same as GetFirstRef but takes an additional parameter specifying the cell to scan. Note that if the specified is not loaded in memory, this function will only return persistent references. Use GetNextRef to iterate through the rest of the references in the cell.
(reference:ref) GetFirstRefInCell cell:ref type:int cellDepth:int includeInactiveRefs:int

I hope that will help you.


While my question is relatively self-explanatory, here is my problem:

There is an exterior worldspace cell that I want to scan for a particular item type, however the problem is that I want to do this on game-start and physically moving the player closer to the cell in order to use GetFirstRef 0 2 is rather... immersion-breaking. Might anyone happen to know a way of scanning an (exterior) cell? (I'm looking for persistent references within that cell).

User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Tue May 17, 2011 12:22 pm

Hi Reneer (Guard Guru Extraordinar!)

will this work for you:

GetFirstRefInCell - Works the same as GetFirstRef but takes an additional parameter specifying the cell to scan. Note that if the specified is not loaded in memory, this function will only return persistent references. Use GetNextRef to iterate through the rest of the references in the cell.
(reference:ref) GetFirstRefInCell cell:ref type:int cellDepth:int includeInactiveRefs:int

I hope that will help you.
I wish it did. I tried it out, but apparently it will not work with exterior cells at all, only interiors. Shame, as it would have been perfect. Thanks for the suggestion, though! :)
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm

Post » Tue May 17, 2011 2:45 pm

WOW, really? um... well if you are forced to move the player is there any trick you can use to hide this like play some short movie or use a load screen to "misdirect" the player as you do the necessary behind the scene work?


I wish it did. I tried it out, but apparently it will not work with exterior cells at all, only interiors. Shame, as it would have been perfect. Thanks for the suggestion, though! :)

User avatar
Nick Tyler
 
Posts: 3437
Joined: Thu Aug 30, 2007 8:57 am

Post » Tue May 17, 2011 10:05 am

WOW, really? um... well if you are forced to move the player is there any trick you can use to hide this like play some short movie or use a load screen to "misdirect" the player as you do the necessary behind the scene work?
Not really, unfortunately. OBSE would make the transition pretty painless, but it would still be noticeable and very immersion-breaking. :/
User avatar
Da Missz
 
Posts: 3438
Joined: Fri Mar 30, 2007 4:42 pm

Post » Tue May 17, 2011 10:19 am

OK, I have two more suggestions, both are a little wacky, one I think would work depending on the item you are looking to scan and the other I am not sure if it would work but I have tried such wacky ideas in the past and solved problems others told me could not be overcome with out new advancements in OBSE.

1. If your item can be an activator, fire a script spell in the cell and have the item report itself using a extremely large AOE.

2. Pop an NPC into the cell that has an AI package to pick up the item and use a script to count it (or what ever you are doing) in his inventory. Give the NPC super fast movement speed. Like I said this may not work at all but I thought I might toss out the idea anyway.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Tue May 17, 2011 2:28 am

OK, I have two more suggestions, both are a little wacky, one I think would work depending on the item you are looking to scan and the other I am not sure if it would work but I have tried such wacky ideas in the past and solved problems others told me could not be overcome with out new advancements in OBSE.

1. If your item can be an activator, fire a script spell in the cell and have the item report itself using a extremely large AOE.

2. Pop an NPC into the cell that has an AI package to pick up the item and use a script to count it (or what ever you are doing) in his inventory. Give the NPC super fast movement speed. Like I said this may not work at all but I thought I might toss out the idea anyway.
Thanks for the suggestions. I've actually in the process of coding a system that uses an AOE spell - I just hope it fires without the player being in the exterior cell. In theory it should work, as AOE spells can detect activators (at least to my knowledge).

The problem, of course, is that I'm actually doing all of this in the G.E.C.K for Fallout 3 (and thus I'm kinda out of my element)... I just figured I'd get more responses in the Oblivion modding section. :P
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Tue May 17, 2011 3:08 pm

This may not solve the issue, but you can use larger numbers on GetFirstRef. GetFirstRef 0 3 works for sure, and you could probably use 4 or higher as well...
User avatar
Alexandra Louise Taylor
 
Posts: 3449
Joined: Mon Aug 07, 2006 1:48 pm

Post » Tue May 17, 2011 2:00 am

This may not solve the issue, but you can use larger numbers on GetFirstRef. GetFirstRef 0 3 works for sure, and you could probably use 4 or higher as well...
Really? I don't want to be too much of a skeptic, so I'll try this out myself... but how far do you get using 3 and 4? Since 2 gets 25 adjacent cells (12 "left" and 12 "right" as I understand it) does 3 and 4 get 50 and 75? 'Cause that would be perfect...

Edit: Tested and only cell depth of 3 works, which isn't far enough. :(

Wrote up a quick script that ran through different cell depths and returned the furthest object. The farthest I got was around 15,600 units away, with a cell depth of 3. After a cell depth of 3, nothing was returned further on.

Back to trying the AoE thing... stupid G.E.C.K...
User avatar
Johnny
 
Posts: 3390
Joined: Fri Jul 06, 2007 11:32 am

Post » Tue May 17, 2011 8:22 am

The problem, of course, is that I'm actually doing all of this in the G.E.C.K for Fallout 3 (and thus I'm kinda out of my element)... I just figured I'd get more responses in the Oblivion modding section. :P


Hahahah! That made my day! xD
It's so true though, sadly, for some reason the modding community for Fallout seems a lot less populated. Or at least, on these forums.
User avatar
Dorian Cozens
 
Posts: 3398
Joined: Sat May 26, 2007 9:47 am

Post » Tue May 17, 2011 4:32 am

Hahahah! That made my day! xD
It's so true though, sadly, for some reason the modding community for Fallout seems a lot less populated. Or at least, on these forums.
Yeah. :P

I tried using an explosion to put a script effect onto the Talking Activators (I'm trying to find all the radio stations currently loaded into the game) but unfortunately it seems explosions only affect actors. :/
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm


Return to IV - Oblivion