Unlike Doors, opening Gates use a movable object rather than a sliding sector. You can use any object for this purpose, but practically all the RAS gates use the "Rastrillo". (There are various flavours.) I'll stick to using this object in this tut.
Use the EBrowser to place the Rastrillo in the closed position in you doorway. It is up to you if you want to make a channel in the doorway for the gate to slide into. It will happily slide into a solid wall but it looks more convincing if it has a channel. Save the position/orientation in a temporary file.
You can put all your gates in the same file as Doors. First make some
# then create the gate:
# take the Position/Orientation/Scale from the temp file you saved with EBrowser
gate1.Frozen=1 # dunno what this is for
gate1=Sparks.SetMetalSparkling(gate1.Name) # This makes sparks if you hit the gate.
gate1din=Objects.CreateDinamicObject(gate1.Name) # Assigns data to handle moving.
You now need a couple of functions in DefFuncs.py:
These functions will handle all your gates. I have put in default args for the distance of travel. These should work fine for the majority of gates but if you have an extra big one you can pass args in the function call to alter them for that particular gate.
You can use a lever to open in the same manner as doors, but you must tell the functions which gate you want to open:
# to alter the displacement use:
gate1.OnTurnOnArgs=(gate1din,3000,600,) # adjust values until it moves far enough.
For other different objects you can make other functions based on these, customised to the object in question.
Locks work like levers, but you need a KEY.
First, pick one of the lock plates and position it with the EBrowser.
Generate script to a temp file.
Create lock with this code:
Make the key first
darfuncs.SetHint(gate1key,"Key") # This name will show onscreen
Stars.Twinkle(gate1key.Name) # this is optional
You can place the key anywhere with EBrowser or give it to an enemy.
If you give it to an enemy, create it at 0,0,0 and omit the Orientation setting.
Bear in mind that the key must be created before the enemy can take it.
#Make the lock
darfuncs.SetHint(gate1lock.obj, "Lock")# put appropiate name here
Use the settings you saved in the temp file. (Position),(Orientation) The last arg is the Scale. Unlike the Lever code the Scale will have effect.
That about covers the subject.
A word on Elevators. They work in much the same way as Doors and Gates, except you ride up and down on them. They can be slide sectors or dinamic objects or sometimes a combination of both. You just have to give them greater displacement settings. They can get complicated if you want to be able to 'call' them from different floors, especially if you want them to stop at multiple levels. It can be done but I won't go into all that at the moment.