I want to lock the doors but...

Post » Thu Aug 16, 2012 10:25 pm

This is my code.
These lines are placed on NPC's script.
The thought is simple... when you go to sleep, lock the doors ref i tell above.
But it is not working. Even if the NPC is sleeping so the package check is 1 the doors are not locked

ScriptName 00SellusGraviusref NPCbegin GamemodeSet NPC to GetSelfif getIsCurrentPackage 00SellusGraviusSeydaNeenSleeping00x8 == 1SellusGraviusOfficeExteriorDoor1.Lock 99SellusGraviusOfficeExteriorDoor2.Lock 99endifif getIsCurrentPackage 00SellusGraviusSeydaNeenSleeping00x8 == 0SellusGraviusOfficeExteriorDoor1.UnlockSellusGraviusOfficeExteriorDoor2.UnlockendifEnd

I know i can do this in-package but i want to do it in-script :smile:
Can anyone help me?
Thanks
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Fri Aug 17, 2012 9:49 am

Scripts don't really run all that often when the player isn't in the same cell. There are exceptions, but that's not fun to debug/explore/abuse. If this is the only thing you're doing, then just use the package.
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Fri Aug 17, 2012 3:44 am

Well... package run on background. For example The same npcs has an eating package. For not stealing purposes I have added custom food to be spawn in his inventory when the package is running and dissapear then the package is not running. This woks with no problem. Now the problem with the doors...

The package of this npc actually works as the "trigger" to lock/unlock doors. I could define a time of day, or a weather status, even a area trigger to do this. Besides I chose the sleeping/no-sleeping state of an npc. This should work and the doors had to be locked.
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm


Return to IV - Oblivion