Triggered door tutorial

Lithtech Jupiter engine
Post Reply
User avatar
Spawn
Admin
Admin
Posts: 1130
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

Triggered door tutorial

Post by Spawn » Sat Jan 26, 2019 7:48 pm

(Found this tutorial in the files from my first version of the website, seems that I never reposted it)

HOW TO MAKE A TRIGGERED DOOR


You can make doors in a lot of ways, one of the most difficult way is the triggered one
I'll show you how to make a automatically opened (triggered) door

We want the door to open before we reach it, and we should be able to run through it without
waiting for it to open

Ok.. here we go!

Create the needed rooms and the door

Image

Image

I have made 2 identical rooms connected to each other by a door (128x64, height x width),
and the door should work both ways

Adding the worldmodel

The first thing we need to do is to bind the door to a worldmodel. To make it swing open
like a regular door, use the 'rotating door' or make it sliding by using the 'slidingdoor'
Let's do the sliding door first!

Image

Select the door and rightclick, then choose 'Selection' and 'Bind to Object'

Image

And use a 'Worldmodel' called 'SlidingDoor'

Image

Now enter the properties tab

Image

There is now a few things that needs to be done

1 ) Set the 'BoxPhysics' to 'false'
2 ) Go to the 'options'

Image

Just copy the settings above.
Set 'PlayerActivate' to 'False' to hide the open/close hud in the game
Also set the 'ActivateType' to '<none>'

The two lines mentioned above is what makes the difference between triggered doors
and normal doors, that you can open/close by clicking on them.

3 ) Select a 'OpeningSound' and a 'ClosingSound' for the door.
4 ) 'Commands' You won't need any commands on the SlidingDoor for now
5 ) 'MovingDir' this tells the door which way it should move

Image

From the directions in the demo, if you set

x = 1.0 will pull the door towards you
x = -1.0 will push the door the opposite way
y = 1.0 will make the door go up
y = -1.0 will make the door go down
z = 1.0 will make the door go right into the wall
z = -1.0 will make the door go left into the wall

I've chose y=1.0, because I want my door to go up when it opens

6 ) 'MoveDist' means how far the door goes when it opens, I have a door which is
128 x 64. So I'll set mine to '128', then the door stops right above the opening


7 & 8 ) 'OpeningTime' & 'ClosingTime' tells the door how long time in seconds it should
use to open and close, '1' should do fine

9 ) 'MoveDelay' tells the door if there should be a delay from when the trigger is activated,
and the door moves

10 ) 'OpenWaitTime' tells the door how long it should stay open, I normally use 5 seconds.



Adding the Triggers

Now it's time to add the 'Triggers', place your marker about 16 units above the floor.
Rightclick and choose 'Add Object'

Image

Choose the 'playertrigger' and go to it's 'properties'

Image

1) 'Dims' tells DEdit how big (units) the triggerarea should be, I use the values mentioned below
that way I won't have to stop and wait for the door to open.

Image

These values should be increased if you're making a bigger door than the one I'm
making in the demo.

Image

2) 'NumberOfActivations' Decide how many times you should be able to open the door
0 = infinite

And now the 3rd and last point:

Commands

This is what makes the whole thing communicate with each other,

The 'Playertrigger' should have one line that tells the SlidingDoor to open

Image

write in 'mgs SlidingDoor00 on'

This will send a message to the door when you enter the trigger area, and the door will open.


Voila! You have a triggered door!!

To make it triggered from both sides, just copy the trigger and move it to the other side
of the door. It will automatically change name to PlayerTrigger01.

But, as I mentioned earlier..

You can also do this by using the 'RotatingDoor'

The trigger procedure is the same exept for the name of the door,
Write 'msg RotatingDoor01 on'

And instead of using the SlidingDoor, use RotatingDoor.
The procedure is almost the same though, with 2 exceptions

Image



1) Make sure that the RotatingDoor object is placed in the center of the door, and in one of the
sides, You'll figure it out quick if you study the Lta file included in this tutorial

2) The movement of the door is set to 90 degrees by default, so there's no need to
modify any of those settings.

That's it!

DOWNLOAD DEMO (PREFAB)

written by SPAWN 2004
Image

Post Reply