Door script

Post » Tue Dec 29, 2009 6:18 am

Hi,

I need a door script saying something like "The door is jammed" or "The door is locked from the inside". I can't find anything in the construction set..
User avatar
Aaron Clark
 
Posts: 3439
Joined: Fri Oct 26, 2007 2:23 pm

Post » Tue Dec 29, 2009 7:51 pm

Easy:

Begin somescriptif ( Onactivate == 1 )	PlaySound3D, "LockedDoor"	MessageBox, "The door is locked from the inside."endifEnd


You should probably make the door an activator so that NPC AI doesn't go around and open it by accident. ;)
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Tue Dec 29, 2009 1:20 pm

Easy:

Begin somescriptif ( Onactivate == 1 )	PlaySound3D, "LockedDoor"	MessageBox, "The door is locked from the inside."endifEnd


You should probably make the door an activator so that NPC AI doesn't go around and open it by accident. ;)


Oh thanks! Well there's about 10 diffrent interiors with diffrent doors, so that would require a lot of new door activators hehe. It doesn't work at all with the ordinary doors? :)
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Tue Dec 29, 2009 7:02 am

You should be able to lock doors and require keys to open them. That should keep NPCs from unlocking them.
User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Tue Dec 29, 2009 12:56 pm

Oh thanks! Well there's about 10 diffrent interiors with diffrent doors, so that would require a lot of new door activators hehe. It doesn't work at all with the ordinary doors? :)


It will work with ordinary doors as well, but I think there's a risk of NPC's opening them. I might be wrong though, it's entirely possible that NPC's would also just trigger the message box when trying to pass through the door.

But since you'll need to make new objects in order to attach the script to them anyway, making them activators instead of doors shouldn't be too much additional work.
User avatar
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Tue Dec 29, 2009 6:01 pm

It will work with ordinary doors as well, but I think there's a risk of NPC's opening them. I might be wrong though, it's entirely possible that NPC's would also just trigger the message box when trying to pass through the door.

But since you'll need to make new objects in order to attach the script to them anyway, making them activators instead of doors shouldn't be too much additional work.


Indeed, what a fool I am.. I forgot that it will attach to all the doors around Vvardenfell if I don't create new ones ^^
User avatar
Solène We
 
Posts: 3470
Joined: Tue Mar 27, 2007 7:04 am


Return to III - Morrowind