[Resource] IsInInteriorActual(ObjectReference akObjectRefere

Post » Tue Nov 20, 2012 12:27 pm

Hey everyone. So, if you haven't noticed by now, the IsInInterior() function can "lie" to you. Not in the strictest sense; it always lets you know if an area is technically an interior or not. The problem is that the designers at Bethesda occasionally use Exterior worldspaces that look, function, and for all practical purposes are, an interior. So, another method is required if you want to know if your ObjectReference is in a "functional" interior or not.

First, create a new FormList, which we are calling WorldspacesInteriors. Add the following Worldspace objects to the FormList:

AlftandWorld
Blackreach
BlindCliffCaveWorld
BloatedMansGrottoWorld
BluePalaceWingWorld
BrinewaterGrottoWorld
DarkwaterWorld
DeepwoodRedoubtWorld
EastEmpireWarehouse
EldergleamSancturaryWorld
FallowstoneCaveWorldStart
FrostmereCryptWorld
KatariahWorld
LabyrinthianWorld
LabyrinthianWorld03
LabyrinthianWorld04
MossMotherCavernWorld
RedEagleRedoubtWorld
ShadowgreenCavernWorld
SouthfringeWorld

Those are all of the worldspaces that I've identified from Skyrim.esm that look and act like interiors, even though their cells are classified as exterior. (If I missed one, let me know and I'll add it to the list!)

If you are using Dawnguard.esm as well with your mod, add the following as well:

DLC1AncestorsGladeWorld
DLC1DarkfallPassageWorld
DLC1ForebearsHoldout

(These could also be added to your FormList at runtime masterlessly, but that's beyond the scope of this tutorial)

Next, implement the following function in a script of your choice that needs this function:

FormList property WorldspacesInterior autobool function IsInInteriorActual(ObjectReference akObjectReference)    if akObjectReference.IsInInterior()	    return true	else        if WorldspacesInterior.HasForm(akObjectReference.GetWorldSpace())			return true		else			return false		endif	endifendFunction

Calling this function instead should reveal whether or not your ObjectReference is in an interior, even an exterior behaving like an interior.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Tue Nov 20, 2012 12:40 pm

Have you tried using Weather.GetSkyMode() == 3? Interiors should have no sky so wouldn't this be much simpler? This is what I've been using for my last two mods and no one has reported any problems.
User avatar
Prisca Lacour
 
Posts: 3375
Joined: Thu Mar 15, 2007 9:25 am

Post » Tue Nov 20, 2012 12:23 pm

Wow, that looks slick. Under what instances would 2 be returned?

Edit: I just tried this:

function IsPlayerInInterior()	if Weather.GetSkyMode() != 3		bInInterior = true	else		bInInterior = false	endifendFunction

It returned true in Brinewater Grotto, but false in Darkfall Passage.
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Tue Nov 20, 2012 2:34 pm

The CK wiki says "2 = Skydome only"

I'm guessing this is when you are in an interior that has "holes" that show the sky? :shrug:

- Hypno
User avatar
tannis
 
Posts: 3446
Joined: Sat Dec 09, 2006 11:21 pm

Post » Tue Nov 20, 2012 8:12 am

Yea. Either way, it doesn't work in Darkfall passage. However, I can probably cut down on the list of things to check for by just making exceptions for interiors that use a full sky.
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm


Return to V - Skyrim