www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 20-10-22, 05:27   #1
Nina Croft
Hobbyist
 
Nina Croft's Avatar
 
Join Date: Sep 2015
Location: Niš, Serbia
Posts: 85
Default TRNG - Elevator Tutorial

NGLE & TombEditor ELEVATOR Tutorial

What is the Elevator in NGLE Script?

It's actually a twoblock platform (TBP) which is defined in the Script as Elevator. This setup probably works for oneblock platform as well, although I haven't tested it yet.

Main Elevator features in game
  • TBP defined as Elevator has walkable FLOOR and walkable CEILING by default. Lara can stand on both the floor and the ceiling, when the elevator is stationary, and also while the elevator is moving up/down. Lara can also grab both the floor and the ceiling. When the elevator is stationary, everything's fine, but while the elevator is moving, Lara will behave strangely if you hang on the edge of the elevator floor/ceiling and try to pull up or shimmy.
  • Elevator can go up/down 10 floors, and all floors must be at the same distance. For the script, we need geometry clicks, which means 3 geometry sectors are 12 clicks in the Script command for the Elevator. We define the number of floors and the distance between them in the Script.
  • The Elevator can be called from any place in the level (outside the Elevator). For instance, Lara is on floor 3, the elevator is on floor 7, and you need it on floor 5. You can find a keypad on floor 3, Since you need the elevator on floor 5, just type „5“ in the keypad and the elevator will get to floor 5 from floor 7.
  • When Lara is inside the elevator, she can also bring the elevator up/down and select the floor where she wants to go. This is done by placing a fake switch (Animating slot) inside the elevator.
  • If Lara is standing at the bottom of the elevator shaft as the Elevator comes down, it will kill Lara. Also, if Lara stands on the elevator ceiling as it goes up and reaches the top of the elevator shaft, Lara will also die. This means that the elevator can also be used as a trap

In short, we define the Twoblock Platform as Elevator in the Script. We define the number of floors, the distance between them and the speed of the elevator. Then we add other objects, which should be moved along with the Elevator. That's one single command line in the Script, and the TBP will have the walkable floor and walkable ceiling, at 8-click distance How cool is that?



The objects we need in our WAD

We definitely need a Twoblock platform. For this example, my TBP is transparent.



Then we need an object which will actually be the elevator in game. For this tutorial I created a simple object in Metasequoia, 2048 units long, wide and high, with simple supporting pillars in the corners. I placed this object in an Animating slot. It is also possible to replace the TBP meshes with the meshes of the actual elevator, but the elevator object must be aligned perfectly with the TBP and have no collision, or the same collision as the TBP. In this example, however, we'll use the Animating slot for the elevator itself. IMPORTANT: This animated elevator object must have ZERO collision!



To operate the elevator, we need one real switch (keypad) and one fake switch. The real keypad switch is placed outside the elevator. We will use it to send the elevator to the desired floor when Lara is not inside the elevator. The fake switch is placed inside the elevator, and Lara will use it inside the elevator, to go to the desired floor. This fake switch is actually the same keypad, only imported into an Animating slot. The real switch to be used outside of the elevator must be assigned to Switch slots 1, 2 or 3 (the safest is to assigned it to slot Switch_type1).

- Fake switch in Animating slot (to be placed within the Elevator) - it will work as the real thing!


- Real switch to be placed outside the elevator (recommended slot 1)



Setup & Geometry

In this example, we'll have 5 floors, each floor at 3 sectors distance. This means that the elevator floor moves 3 sectors up/down, but elevator ceiling moves as well, at the same time. You can build various geometry and send the elevator up/down to reach a certain passage or the bottom of the elevator shaft. You can build an open elevator, or an elevator enclosed in a concrete shaft. Just have in mind that the distance between floors in clicks is the parameter you will need in the Script. Build the geometry you want around the elevator; all kinds of puzzles are possible with this fantastic command

In the Editor, place the Twoblock Platform on the bottom of the elevator shaft. This is Floor 1, and the Elevator is on Floor 1 when the game begins. Select the TBP and then select four squares below the TBP. Go to Add New Trigger and define this trigger as DUMMY.



Then we should select the Switch_type1 from our Wad and place it somewhere in the level. It can be placed on every floor if you want, on several places around the level. This switch must be a keypad object, and Lara will select the floor where the elevator should go. In our example we have 5 floors. The number of floors is important, because we must enter a correct OCB number in the OCB window for this switch. Add 26384 to the number of floors, to calculate the correct OCB. In our example, it's 26389(five floors). Then place the Switch trigger for Switch_type1 below the switch.





Then select the Twoblock platform in your room and place ActionNG trigger, and in the Timer field, select Elevator.Move elevator to floor number set in last keypad operation (A28). Add this trigger to the same square below the Switch_type1.



In the above screenshots, we could also see the Index number of the Twoblock Platform, which is 216. Note the Index number of Twoblock platform in your game, because we need it for the Script.



Scripting

First we must define our Twoblock Platform as an Elevator. In this example, the distance between the floors is 12 clicks, there are 5 floors, and the Index number of the TBP is 216 in my Editor. I must type the following command:

Elevator= 216, 12, 5... /unfinished for now

Then we want to add some items to our elevator, which will move along with it. In this example we need the inner keypad, which is on an Animating slot. We also need the elevator object, which is also on an Animating slot. As we add these two objects, we should note their Index number. In my example, the Elevator object is 219 and fake keypad (inner keypad) is 218.





Now, if we have an inner keypad in the elevator, and if we want to use it as a keypad switch, we must define this Animating object in the Script as a keypad switch, although it's fake This Animating object belongs to the Elevator= command. Therefore, after the number of floors, in the Elevator= command we add the inner keypad and define it, as follows:

Elevator= 216, 12, 5, EF_INNER_KEYPAD, IGNORE, 218, 20, 219

Now, 218 is the Index of the inner keypad, 20 is the speed of the elevator, and 219 is the Index of OTHER ANIMATED OBJECTS we want to add to our elevator. In this example, it's the elevator object (Animating). After the parameter of Speed, we simply list the Index numbers of all the animated objects we want to move with the elevator. In this example we have only one such object, which is Index 219.

The „IGNORE“ part of the command line is reserved for a DOOR you can add to the Elevator. If you decide to add a door, the elevator will behave as follows: When it is stationary, the door is opened. As soon as you press a button to move the elevator, the door will close and remain closed until the elevator stops. Since this door is attached to the elevator, it will move with the elevator up/down. If you want to add a door, then you should have a door for the elevator somewhere in your Wad (as Door_Type). Place the door where you need it, note its Index number, and then go to the Script and find the Elevator= command. Let's say that the door has index 220. The command line is as follows:

Elevator= 216, 12, 5, EF_INNER_KEYPAD+EF_SINGLE_DOOR, 220, 218, 20, 219

Of course, the inner keypad is not mandatory, and the elevator door isn't mandatory. Just two-block platform is mandatory, and it will have a floor and a ceiling, as I described above. In that case, you must add „Ignore“ parameters for the elevator flags, inner keypad and inner door, and just indicate speed.

All items that are dragged along with the elevator are added after the Speed (in this example 20). In the above example, I added the elevator item 219. You can also add a fence around the elevator, or some crates, or invisible collision, but all these items must be on Animating or Mip slots, and added to the Elevator= command (just add their Index numbers). In this example, let's say that I want to add a crate to the elevator. Its Index is 221, and it's a Mip slot, for instance. The script line will be

Elevator= 216, 12, 5, EF_INNER_KEYPAD, IGNORE, 218, 20, 219, 221

The speed can go up to 50, but the recommended speed is maximum 25-30 for the elevator to work with no glitches.

If the above explanation of Elevator command isn’t clear enough, here’s the simplified summary:

No Inner keypad, no Elevator door:
Elevator= 216, 12, 5, IGNORE, IGNORE, IGNORE, 20, 219
(216 - Index of twoblock platform, 12 - distance between floors, 5 - number of floors, 20 - speed, 219 - Index of the animated object attached to the twoblock platform)

No inner keypad, the door is attached:
Elevator= 216, 12, 5, EF_SINGLE_DOOR, 220, IGNORE, 20, 219
(216 - Index of TBP, 12 - distance between floors, 5 - number of floors, 220 - Index of door, 20 - speed, 219 - Index of the animated object (elevator object)

No door attached, but inner keypad attached:
Elevator= 216, 12, 5, EF_INNER_KEYPAD, IGNORE, 218, 20, 219
(216 - Index of TBP, 12 - distance between floors, 5 - number of floors, 218 - Index of keypad, 20 - speed, 219 - Index of animated object

Door attached, inner keypad attached:
Elevator= 216, 12, 5, EF_INNER_KEYPAD+EF_SINGLE_DOOR, 220, 218, 20, 219
(216 - Index of TBP, 12 - distance between floors, 5 - number of floors, 220 - Index of door, 218 - Index of keypad, 20 - speed, 219 - Index of animated object

You can then add all other animated objects which belong to the elevator and move with the elevator, by adding their Index numbers after the speed (separate by comma). These objects can be invisible side collisions, fences and other items, but they must be placed in an animated or MIP slot.

Remember that Lara can be killed by the elevator from both above and below.

The Elevator is a mighty thing. You can make wonders with it in the game. For example, you can use it to bring a pushblock up/down, or to reach a high ledge, or lower floors. There are dozens of possibilities to improve the gameplay with this great Script command!

NOTE: When the two-block platform is placed as Floor 1 in the Editor, you can lower the floor below it. It won’t affect the elevator (two-block platform). Where you put the TBP, that’s floor 1 for the elevator. You can create a nice gameplay with this, by placing something important at the bottom of the elevator shaft. Then you must go to floor 1 and send the elevator up, to gain access to that item.

ADDITIONAL NOTE: If the elevator is „silent“ while it moves up/down, you must add the samples to the sounds you use in your level. This is hard-coded, so as soon as you add the samples, it will be played while the elevator is moving. The samples/slots are 370 (for moving) and 371 (for stopping).


In Niš, by Nina Croft 2022
__________________
Alpha and beta tester of Dark City Part 2: The Gates of Hell by Lima

Last edited by Nina Croft; 20-10-22 at 14:47. Reason: fixed some formatting
Nina Croft is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.