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.