Papyrus condition for checking if PC is indoors or outdoors

Post » Fri Dec 02, 2016 3:46 pm

I'm working on a script for an armor piece that casts a different spell on the player depending on whether they're indoors or outdoors.


If you're outdoors, it casts a meteor shower like the one Alduin uses, and if you're indoors it casts a Fire Storm instead.


Problem is, I don't know how I'd write the condition out in Papyrus. For spell effects I could use IsInInterior, but Papyrus doesn't recognize that as a condition. I could always just have it cast both of them and attach the condition to the spell effects themselves, but then that would cause unnecessary clutter in the active effects menu and I'd like it to be as professional as possible.


Here's the specific piece of code in question.



if (selfRef.IsInInterior == 1)
KTPWarlordRareMeteorShower.cast(selfRef,selfRef)
else
KTPWarlordFireStorm.cast(selfRef,selfRef)
endif

Obviously the first line doesn't work as is, what could I substitute it with for the desired effect of running an interior/exterior cell check?

User avatar
Neliel Kudoh
 
Posts: 3348
Joined: Thu Oct 26, 2006 2:39 am

Post » Fri Dec 02, 2016 5:45 pm

IsInInterior is a bool function in papyrus. So just add () at the end, and change 1 to true or false.

User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Fri Dec 02, 2016 8:02 pm

Thanks, exactly what I was looking for.

User avatar
Mandy Muir
 
Posts: 3307
Joined: Wed Jan 24, 2007 4:38 pm

Post » Fri Dec 02, 2016 3:23 pm

But keep in mind that in some cases (rare however) there are outdoor cells that are made to look like interior cells.



Such as in some mountain locations where the actor is in a "crevice" looking up at the sky. It is all made to look like open air cell but there is no weather mechanics.


And world space like BlindCliffCaveWorld that is made to look interior but is actualy an outdoor cell.



So you may want to check this works in a variety of cells if it is important for it to work 100%.

User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Fri Dec 02, 2016 9:51 pm

oh, this may help you:




http://www.creationkit.com/index.php?title=Talk:IsInInterior_-_ObjectReference




Unfortunately this still will be a problem for mods that add cells that are sneaky like this. But this is Skyrim modding. "Perfect is the enemy of good".

User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm


Return to V - Skyrim