door_tut_4

Mini tutorial: How to attach a door (or multiple doors) to your build.

Hello and A Happy New Year!!!

Here is a quick and easy way to build doors that you link to your builds. Some of the features of this system are:

  • Can be used as a Master & Slave combo (double doors)
  • Can be used as a Single Door (using Master door)
  • Can have multiple door sets linked into a build.
  • Can operate so that one door opens/closes all, or each can operate independently.
  • And some more….

Let me start with the credits:

The scripts were made by Whitestar Magic. (Source: http://forums.osgrid.org/viewtopic.php?f=5&t=4511) Seems that WS has stopped being active on opensim communities, and that is a big loss!!
The door texture is from agf81 (http://agf81.deviantart.com/art/Door-Texture-33-294845671). I cut out the door myself. License on the original picture is: CC BY-SA 3.0

The Download Part.
Download the scripts and texture here: 

Door-tutorial
Door-tutorial
door-tutorial.zip
Version: 1.1
24.0 KiB
944 Downloads
Details...

Unzip this package using 7zip, winzip, winrar, etc. You should see 3 files in this package:

  1. Door-texture.jpg – The door texture.
  2. Master Linkable door script v1.5.lsl – The main door script.  Open this with notepad or even better Notepad++.
  3. Slave Linkable door script v1.5.lsl – Use this script for a ‘slave’ door to make double doors.

So lets get building.
Since the scripts have a lot of info within them, and you should be able to read the most important stuff, I’m going to show you how to make a master/slave combo door and link it to your building.

First thing we need to do is to build 2 doors and texture them.

Rezz a prim on the ground, and copy the parameters from the picture below.

door_tut_1
door_tut_1

Set the Size(Meters) part to:
X=3.0000
Y=3.0000
Z=0.0500

Then (*Important, don’t miss this!*)

Rotation (degrees)
X=90.000. Leave Y and Z to 0.

And finally cut the door in half by setting the ‘Path Cut’ to the following:

Path Cut (begin/end):
B=0.375
E=0.875

The size of the door doesn’t really matter, the rotation and Path Cut are important tho!!

At this time it a plan (maybe not a good plan, but it is a plan!) to add a texture.
Upload the door texture (or use one of your own) and apply it to the door. And things are messed up!

The door opens in a certain way, and the door knob is on the opposite side, and if you look at the back side of the door, everything is the other way around. The texture is tilted 90 degrees and much to big for the door.
Oh noes, the sky is falling down! We gonna die!

Nope!
Use the ‘Select Face’ to make things right.

First select the ‘Select Face’ option in the edit window, and touch the front of your door.

door_tut_3
door_tut_3

Open the “Texture” tab and change the following parameters:

Horizontal scale -2.0000

Rotation degrees 90.000

Horizontal offset -0.5000

Now select the other side of the door and change Horizontal scale from -2.000 to 2.000

This door is almost ready, only thing we have to do is give the door a name and add something in the description field.
Open the “General” tab and give the door a name, like ‘Door’.
Then (This is important in buildings with multiple doors) enter in the description field: DOOR_NUM=-xxxx  where  -xxxx is any 4 digit negative number you choose.

The door is ready to copy.

Make sure you are editing the door. Hold down the SHIFT-key on your keyboard, and drag the door to the right. And you have 2 identical doors. Flip the right door 180 degrees around so you have something like this:

door_tut_4
door_tut_4

Just a couple of more things to do and we are ready to use the doors.
First we have to put the doors together.
Hold down the SHIFT-key again and select the other door too. Both doors should have a yellow line around them at this point.

Select the align tool in the edit window, hold down the SHIFT-key and click on the right red arrow. The doors should snap together.

door_tut_5
door_tut_5

Create a new prim, and turn it into a door post or something. It doesn’t really matter how it looks, it’s just a base prim where we are going to link both doors on. I will use a default prim for this tutorial.

Select the right door and then hold down the SHIFT-key.
Then touch the left door and then the base prim.
Hit CTRL-L on your keyboard to link both doors to the base prim. Both doors should have a blue line around them, the base prim a yellow line.

door_tut_6

 

Finally, Scripting!
The final steps are 2 easy ones: we are going to add 2 scripts and we are ready to open the doors.

Edit the door, select ‘Edit Linked’ and touch the right door.
Open the “Content” tab and create a new script.
Name this script: Slave Linkable door script v1.5
Open the ‘Slave Linkable door script v1.5.lsl’ you have downloaded earlier with notepad and copy the script in to the new script.
Save the script in your door.

Do the same for the other door but this time use the ‘Master Linkable door script v1.5.lsl’.

Done!

Have fun opening doors!

Oddy

One thought on “Mini tutorial: How to attach a door (or multiple doors) to your build.”

Leave a Reply