**** TRscripting Languaje, Version 1.9, June 2001 *****
Tomb Raider FloorData Commands compiler.
by Turbo Pascal.

Contents

Overview

Scripting commands

Auxiliary commands

TR3 AI items IDs.

Final words


Overview :

The scripting files used in this program is not the same kind file mentioned in the official room editor manual from Eidos, where is used for deal with options like items names strings, levels names strings, levels order to play, etc. In some other games level editors, the "Script files" are used for specify commands that will be executed in-game play, this way the level designer can implement complex puzzles without need for a programmer. That is the way that I am using script file here, a TR command's list that will be executed when the level is running. Trscripting.exe is a program that compile Tomb Raiders commands from a Text file to a Tomb Raider file level. (TR1/Tub/TR2/TR3/TR4). The scripts commands are instructions assigned to some sectors, then the commands will be executed when LARA step on that sector. Note that the BEST AND EASIER WAY to put triggers commands in a tomb raider level is using TRITEM3D from RGbold, however the scripting file is used like a alternative to build some puzzles that can't be implemented with TRITEM3D, also because the commands/items/statics are defined in a TXT you can modify later all work that you made in your custom level. The advantage of using a scripting file is that you can combine several instructions for build tricky puzzles, also if you have a copy for your empty level, you can play around changing/adding items/commands in the scripting file and compile it to the level again. You can apply your scripting file to the level using the standalone DOS compiler TRscripting.exe or you can use TReditor3d version =>1.5 TReditor3d version =>1.5 has the compiler built on in, and you can use a TXT program at the same time that TReditor3d is running for edit the scripting file, you add some commands, then save the script file, switch to TReditor3d and build the level, then play the level to test the commands. Most Trscripting commands ask for a sector coordinate to apply the commands, the coordinates are the tile column & row in the room, TReditor3d now show in the status bar the column & row for each sector that you click at; use that info for your scripting commands, so it is ease to work simultaneous and find visually where you want to put a item/command/static in the room. For built scripting files you need to learn the available scripting commands and then write a kind program in a text file.

For the standalone compiler the syntax is:

TRscp  Levelfile  scriptfilenewlevelfile
 

where:
- Levelfile = is the empty Tomb Raider Level TR1,tub,TR2,TR3,tr4.
- Scriptfile = is the text file where you write your commands.
- newlevelfile = is the new level that will be created with the items,triggers, objects.

Example: TRscripting  mybase.tr2  mybase.scp   jungle.tr2

The program will copy the empty level mybase.tr2  to jungle.tr2 , then it will read the file mybase.scp and will compile all the commands and will put them to the new jungle.tr2 If the scripting file has syntax errors then TRscp will tell you at what line the error is and it will stop compiling. Correct the error and compile the scripting file again.

Sometimes you need to know the total items existing in the level file, you can find it out typing: Trscripting levelfile. With not script file name and trscripting will tell you the total items and cameras that the level file has.


The scripting commands

Introduction
PUT_ITEM
ADD_CAMERA
PUT_STATIC_MESH
PUT_SPOT_LIGHT
PUT_ALTERNATE
KILL_LARA
PUT_RGB_LIGHT
CLIMB_WALL
MONKEY_SWING
START_TRIGGER END_TRIGGER

Introduction
The scripting language is ease, YOU DON'T NEED TO BE A PROGRAMMER for write scripting files, here not exist loops instructions, gotos, there not exist variables assignment, etc. You only need to learn the commands and his parameters and write them in a text file, when you need to put a comment start the text line with the character " ; ". for example: ;This is a comment. If you put a comment in the same line where you put a command, DO NOT PUT A COMMA IN YOUR COMMENT!!. You can write the commands in uppercase or lowercase, the compiler will tell you if you make a syntax error, but the compiler WILL NOT VALIDATE the parameters, I mean if you put in your command room #10 but the level file only have 9, the compiler will not tell you anything.

Next are a explanations for all commands implemented in this version. 


PUT_ITEM:(Top)
-->Example: Will add a new item to the level, you need to track the item order for later use in the commands; so if your level already has 30 items, after using this command your new item order in the list is 31.

Syntax: Put_Item(Room,Column,Row,High,     ItemID,Angle,Align,     Flag,Amount, light/r, g,b)

- Room: is the Room number where you want to put a item. (starting from 1).
- Column,Row : are the tile column and row where you want to put the item in the room. The columns start from  1 to the room width from left to right. The Rows start from 1 to the room long from back to front.
- High: Normally 0 for put the item at the floor height for the sector or you can send to UP the item with increment of 1/4 tile, so putting 4 will send the item one block UP over the floor.
- ItemID: Is the ID number for the item that you want to put. the only way to known the items available and his ID in your level is using the Program TRviewer by E. popov. Get the ItemID checking at the movables list, then enable the object toolbox and look the objectID.
- Angle: Orientation angle for the item, on increment of 90 degrees, this go from 0-3.
- Align: Alignment in the sector for the Item, 0=center, 1=front, 2=back, 3=left, 4=right.
- Flag: Normally 0, this is used for activation commands, some items can be activated using more that one command, (2 keys that open one door for example), if the flag item is 62 then the item start the level activated, if it is 0 the item start deactivated. How to use this properly is explained later in this document. This parameter is optional in the command and for default is 0.
- Amount: The amount of the same item in this sector, for most item this is 1 but it is useful when you put ammos and medipacks, for example you can put 3 for make LARA get 3 uzis ammo chip in this sector. Note that for keep track the items orders you must consider this parameter. This parameter is optional and for default is 1. - -Light/r: Light intensity for the item, the intensities goes from 0 to 255 where 0 is maximum clearness. this light intensity has a problem, the same value get different intensity in different items. * For LARA and Enemies put this value to 255 to get the light intensity from the room light ambient. * For statics items (keys, ammos, guns,medipacks etc) use the value 16. * For rest items (Doors, tramps etc) the correct light is variable, normally use 36 value. This parameter is optional for default is 16.
If the next g,b are included then light is interpreted as r.

- g,b: If this two paremeters are included then light parameter is interpreted as r and the item will be colored using full r,g,b values. (for tr3 and tr4 files only). the values go from 0-32 for each component.

In new empty levels created with TReditor there are only one already item in the list (LARA) so start counting your new items with #2. For Levels with already item from TRITEM program use "trscp levelfile" to get the total items in the level and start counting from that total+1.

Put_Item Example :
;Adding a wolf in a TR1 level ;
;Put a wolf (itemID 7) at the column 5 row 6, room #1.

Put_item(1, 5,6,0, 7,0,0) ; Wolf-Item #2 in the list order.
 

Note that YOU CAN PUT IN THE LEVEL ANY ITEM available in the movable list that shows popov's trviewer.


ADD_CAMERA:(Top)
This will add a new camera in the level, you must keep track of the camera order in the list for later use with the commands.

Syntax: Add_Camera(Room,Column,Row,high,Unknown)

- Room: is the Room number where you want to put the camera. (starting from 1).
- Column,Row : are the tile column and row where you want to put the camera in the room. The columns start from 1 to the room width from left to right. The Rows start from 1 to the room long from back to front.
- High: The high over the floor for the camera, you can send to UP the camera with increment of 1/4 tile, so puting 4 will send the camera one block UP over the floor.
- Unknown: This is an unknown parameter for the camera, this parameter is optional and for default is 0. I have not testing this parameter with different values yet, so I don't know for what it is for. In New level there is not camera on in, so start the count from 1. The camera is very easy and useful to use, you need to put a camera in front of some items (normally doors) then after activing the item you use the command for to swicth to that camera to show the item been activing. 


PUT_STATIC_MESH(Top)
This put a static mesh (Ornament) in a room.

Sintax: Put_Static_Mesh(Room,col,Row,high,    ID,angle,align,     Light/r,g,b)

-Room    =  Room where add the ornament.
-col,row  =  Column & row sector where put the ornament.
-High      =  High over the floor for put the ornament (normaly 0)
-ID         =  Object Id for the ornament.
-Angle    =  Angle orientation for the ornament (0-3)
-Align     =  Aligned in sector for the ornament (0-4)
-Ligh/R   =  This is the white light intensity for the ornament (0-31)
- g,b       =  Green,Blue component if colored light will be used in tr3/tr4 levels.

For tr1-tr4 levels just using the light field mean that you will use regular white light intensity for the ornament.

If you include the "g" and "b" fields then "light" field will be interpreted like "red" component and you will use the colored light for the ornaments in tr3-tr4 levels.

If you did not include light,r,g then regular white light with default room light intensity will be used.

Example:
    Put_Static_Mesh(1, ,5,5,0, 10,0,0, 16) ; white light
    Put_Static_Mesh(1, ,5,5,0, 10,0,0, 16,0,0) ; Red light
    Put_Static_Mesh(1, ,5,5,0, 10,0,0, 0,16,0) ; green light
    Put_Static_Mesh(1, ,5,5,0, 10,0,0, 0,0,16) ; blue light
    Put_Static_Mesh(1, ,5,5,0, 10,0,0) ; default white light from room.
 
 


PUT_SPOT_LIGHT(Top)
This will add a spot light in the level, you don't need to keep track about the spot lights in the level. The spot light will not affect walls,floor or ceiling light intensities, only Lara and enemies will be affected.

Syntax: Put_Spot_Light(Room, col,row,high, intensity,distance)

- Room : Room where you put the spot.
- Col,Row : Sector in the room where you put the spot.
- high : High over the floor for the spot, normaly this is 0 or you can send to up the spot in increment of 1/4 block.
- Intensity : White Light intensity for the spot, this goes from 0 to 31. For default this is value 16.
- Distance : How much tiles the spot light will cover in increment 1/4 sector, for default this is value 4 (one tile).


PUT_ALTERNATE(Top)
This is used for implement alternate rooms in a level, how to use this command is explained later in the Alternate room sections.

Syntax: Put_alternate(Normal_room, Alternate_room)

- Normal_Room : Normal Room number enabled when the level start.
- Alternate_Room : Alternate Room that will replace the normal room when the alternate mode is enabled.
 


KILL_LARA:(Top)
This command will make Lara die.

Syntax: Kill_Lara(Room, Column, Row)

- Room: is the Room number where Lara will die when she step the sector.
- Column,Row : are the tile column and row where you want to kill Lara when she step on it. The columns start from 1 to the room width from left to right. The Rows start from 1 to the room long from back to front.
 



 

PUT_RGB_LIGHT

This will add a colored spot light for TR3/TR4 levels, nothing happen if used in phd,tub,tr2.

Syntax: Put_RGB_light(Room,col,Row,high, r,g,b, intensity,distance);

-Room    =  Room where add the spot light
-col,row =  Column & row sector where put the spot light.
-High    =  High over the floor for spot light.
-R,G,B   =  Red,green,blue component for the light. (0-255 for each component).
-Intensity = How much power this spot will have? (0-255)
-Distance  = How much sectors the spot will cover in (sectors units).

Example:

       Put_RGB_light(1,2,2,5, 0,255,0, 128,1);

This will add a green spot light in a corner.
 
 
 

CLIMB_WALL

This will make a wall climbable.

Sintax: Climb_Wall(Room,col,row, climb_flag)

-Room       =  Room where the wall is.
-col,row    =  Column & row sector where the wall is.
-Climb_flag =  Sides in the wall that will be climbable, the availible

               values are:
               1 = climbable just the front side
               2 = climbable just the left side
               4 = Climbable just the back side
               8 = Climbable just the right side
 

You can sum the value's side for make climbable in the same wall severals sides, for example the value "3" will make climbable the front and left sides for the wall.

Example:

          Climb_Wall(1, 5,5, 15)

 This will make climbable all 4 sides for the pillar in the sector 5,5.
 

Note that this is some different to the way used in tritem where you put the trigger in the "standable neigbor sector", but in this command you must especify the sector where you put the wall.
I think this way is more intituive, however this give a a litle problem if you define two climbable walls too much close.

NEVER LET THAT A CLIMBABLE WALL SIDE SHARE A STANDABLE SECTOR WITH ANOTHER CLIMBABLE WALL, OR THE GAME WILL CRASH.



 

MONKEY_SWING

This will define a sector ceiling with monkey swing attrib.

Syntax: Monkey_Swing(Room, Column,Row)
 

- Room:           Room where the sector is.
- Column,row:   Column and Row for the sector.
 

Seems that you should not put another kind trigger in a monkey swing trigger.

This trigger must have to be defined in solid sectors ground, this mean, that is the sector is colisional with a
room below, then define the ceiling attrib in the room below. This normaly happen in room that is built using 2
stacked rooms where the top room has the ceiling and the bottom room has the floor.
 
 
 


START_TRIGGER & END_TRIGGER:(Top)

Introduction(Top)
This is the tricky part. These commands mark the start and end of a block of conditional commands that will be all apply to a sector. All conditionals commands between START_TRIGGER and END_TRIGGER will be be evaluated when Lara step on the sector.

Syntax:

Start_Trigger(Room, Column,Row) ;
          list of conditionnals commands.
End_Trigger()
 

- Room: is the Room number where you want to put the trigger.
- Column,Row : are the tile column and row where you want to put the trigger.

Between Start_trigger and End_trigger you must write what I call conditionnal blocks commands. the conditionnal blocks commands contains a list of FDcommands that will be executed if the evaluation return true. all this conditionnals block commands will be evaluated when Lara steps on the sector. The FDcommands will be explained later.


Conditionnal blocks(Top)

**** If_Lara_on_ground_Do_with_Activate(flag,timer,state)
When LARA Step in the sector all next fdcommands will be executed until the fdcommand END(). If LARA Pass over the sector jumping (LARA never touch the sector) then the FDcommands list WILL NOT BE EXECUTED. All Items included in the FDcommands WILL CHANGE HIS STATE TO ACTIVES. (the Doors will get open, the enemies will wake up etc.)

- Flag = Normally this is 62, this field is used in combination with the item flag when was defined and with successives activation commands. How to use this properly is explained later in this document.
- Timer = This is the amount of seconds that the items will remain actives in the successives actives fdcommands. Put 0 to make the item stay active until a deactivate conditional block command is used.
- State = the value 1 mean that this condition will be evaluated only once, the value 0 mean that the condition will be evaluated each time that LARA touch the sector.

Normally this block is used for Open doors or activing tramps when LARA walk over a sector.

;This is a example:

;Start_trigger example, just one conditional command in the trigger

Start_trigger(1, 5,6) ; sector at room #1 column 5 row 6.
      If_Lara_on_ground_Do_with_Activate(62,0,0) ; If LARA touch the sector. . .
                 FDcommand list .
     end() ; end conditionnal block.

End_Trigger() ; no more conditionnal commands in this trigger. ;end example
 
 


**** If_Lara_on_ground_Do_with_Deactivate(flag,state)
Similar to the previous conditional block, if LARA touch the sector then the next FDcommand will be executed but this time all Items included in the FDcommands list WILL CHANGE HIS STATE TO DEACTIVATED. (the doors will get closed, etc.) If LARA Pass over the sector jumping (LARA never touch the sector) then the Fdcommands WILL NOT BE EXECUTED. Normally this block is used for close doors or deactiving tramps when LARA walk over a sector. Not all Items can be deactivated (the enemies for example).


***** Do_with_activate(flag,timer,state)
No conditions for execute the fdcommand and activing the items. The fdcommand will be executed when Lara pass touching or jumping the sector, the items included in the fdcommand will get actives. Normaly this block is used for wake up enemies when Lara enter to a place walking or jumping.


**** Do_with_Deactivate(flag,state) --TR2/TR3 only--
Inverse to the previous commands, the items included in the fdcommand list will get deactivated when Lara pass the sector walking or jumping. This command seems that only work for TR2/TR3 levels.


*** Trapdoor(flag,timer,state)
This trigger will make solid the trapdoor and like that are over the sector. You need to put this trigger when use trapdoors or bridges to prevent Lara fall down.


**** If_KeyLock_is_ON_Do_with_Activate(flag,timer,state,Item)
If the keylock Item specified at the item parameter is active then the fdcommand list will be executed, the items included in the fdcommand list will be activates. The item is the order item when you use the put_item command. This is used for implement keylocks, "if keylock X is ON then open the next door list." In the TR games there is a Key item that belong to each keylock item, so when LARA get the proper key and use it with the keylock then the items in the Fdlist (normaly doors) will get actives.


*** IF_Switch_is_ON_Do_with_Activate(flag,timer,state,Item)
Similar to the previous command but this time if the Item (the switch) later is pull off then all items in the list (normally doors) will get deactivated. This is used for implement land/water switches that open and close doors.
 


*** If_Item_is_picked_Up_Do_with_Activate(flag,timer,state,Item)
When the Item especify in the parameter is pick up for Lara then The fdcommands list will be executed and the items in the list will get actives. This is used for activing enemies, playing sounds etc, when Lara get some objects.


*** If_Item_at_Sector_Do_with_Activate(flag,timer,state,Item)
I am not sure about this command. The fdlist commands will be executed and the items will get actives when Any pushable box is moved over this sector, if the pushable Box items is especified in the item parameter then the pushable box can't be longer moved. I was unable to make deactivated the items when the Box is removed from the sector. I only has tested this command in TR1, so please test it in TR2 and TR3 and let me know the behavior.


**** IF_Lara_in_Combat_Do_With_Activate(flag,timer,state)
The Fdlist commands will be executed and the items will get actives when Lara walk over the sector and draw the weapons.


**** End()
This Mark the end of the conditionnal block. 
FDcommands(Top)
Now I will explain the available fdcommands that must be written inside the conditionnal command block.
>>>> Item(item_order)
This will Active or Deactivate the item specified in Item_order parameter, The item will be activate when used in conditionals command that active items.

for example:

Put_item(1, 8,6,0, 7,0,0) ; Wolf-Item #2 in the list order.
Put_item(1, 2,3,0, 56,0,0) ; Door-Item #3 in the list order.
Put_item(1, 5,9,0, 57,0,0) ; Door-Item #4 in the list order.
Put_item(1, 7,2,0, 58,0,0) ; Door-Item #5 in the list order.

Start_trigger(1, 2,3) ; sector at room #1 column 2 row 3.
       If_Lara_on_ground_Do_with_Activate(62,0,0) ; If Lara touch the sector.
              Item(2)
              Item(3)
              Item(4)
              Item(5)
      end() ; end conditionnal block.
End_Trigger() ; no more conditionnal commands in this trigger.
 
 

The above example will wake up a wolf, and will open 3 doors when Lara walk over the sector 2,3 in room #1. For close the doors the scripting commands look like this:

Start_trigger(1, 9,4) ; sector at room #1 column 9 row 4.
      If_Lara_on_ground_Do_with_Deactivate(62,0,0) ; If Lara touch the sector.
               Item(3)
               Item(4)
              Item(5)
     end() ; end conditionnal block.
End_Trigger() ; no more conditionnal commands in this trigger.
 
 


>>>> Switch_Camera(Camera,Delay,Zoom-Out,OnlyOnce)
This will switch to the camera especified at the camera parameter.

- Camera : Camera Order in the camera list.
- Delay : Delay in seconds that the game will use this camera before switching back to the normal camera. Put 0 for use this camera until Lara step on another sector or draw the weapons or press the Insert key.
- Zoom-Out :Put 1 for enable the "zoom out" effect when the normal camera switch to the new camera. Put 0 for no "zoom out" effect. This only work for TR1/TR2 game version, unfortunately this effect was removed in TR3.
- OnlyOnce: Put 1 for switch to the camera just once, or put 0 for switch to the camera every time that the trigger is called.

When you use this command alone, the camera will point to LARA from the camera position view. When this command is combined with the look_at_item command the camera is used to point to another Item. The zoom out effect only work when the camera is used to point LARA.

Example:

;look at LARA From a corner Room.
Add_Camera(1, 9,9, 8); Camera #1-room 1-column row 9 9 and 2 blocks high.

Start_trigger(1, 2,2) ; sector at room #1 column 2 row 2.

     Do_with_Activate(62,0,0) ; If LARA on the sector.
              switch_camera(1,4,1,0) ;
    end() ; end conditional block.

End_Trigger() ; no more conditional commands in this trigger.

In the above example when LARA step in the column 2 row 2 the camera will focus on LARA from the corner for 4 seconds using the zoom-out effect.
 



 
>>>> Look_at_Item(Item)
Will make LARA look at the item specified in the item parameter. When is used in combination with switch_camera command you can make the Camera point to the item. First look the item with the look_at_item command then use the switch_camera command, the camera will point the item pointed for the look_at_item command.

Example:

Add_Camera(1, 5,5, 4);Camera #1 room 1 column row 5 5 and 1 block high.
Put_item(1, 5,7,0, 60,0,0); Item #2 Id 60 (Door) at column-row 5 & 7.

Start_trigger(1, 2,2) ; sector at room #1 column 2 row 2.
       Do_with_Activate(62,0,0) ; If Lara on the sector.
                  Item(2) ; active the door.
                  Look_at_item(2) ; Look the door.
                  switch_camera(1,3,0,0) ; focus the camera at the item ; for 3 seconds.
      end() ; end conditionnal block.
End_Trigger() ; no more conditionnal commands in this trigger.
 

Note: The camera can only be pointed at Items that are already activated or at static items like armos, medipacks, guns, etc. so you can't point the camera at closed doors for example. If you need to point to deactivated items you need to do a trick, you add at the same Item position a static "invisible" item, then point the camera to that invisible item. "Invisibles" items are some items that exist in the Movables list but when his objectID is used the item is not rendered.


>>>> Play_Sound_Track(Track)
Play the sound track specified at the track parameter. In the TR1 game version this is a internal sound track embbeded in the phd file. In TR2 this is a CD track number. In TR3 this is a internal sound in the cdaudio file.

For TR3 sounds, you can use the program CDwad.exe for open cdaudio.wad file and hear and find out the number for each sound.
 


>>>>> Found_Secret(number_Secret)
Tell to the game that LARA has found a secret area. number_secret is the secret number starting from 1. The total secret number is specified at the tombpc.dat and can be edited with jenny program or mister Petrich Program. You can put more secret that the total, so when the level is completed you can get: Secrets found: 8/5


>>>>>>> Alternate_On()
This enable the Alternate room mode, when the alternate room mode is enabled the engine replace all normal rooms for the alternate rooms defined. Read the alternate room section before start using this command.


>>>>>> Alternate_Off()
This disable the Alternate room mode, when the alternate room mode is disabled the engine use all normal rooms instead the alternate rooms defined. Read the alternate room section before start using this command.


>>>>>> Alternate_Flag(Flag)
I don't know how this command is used, feel free to test this command and let me know what you discover.


>>>>> Underwater_Flow(flow)
Make the water flow to one direction and intensity in the sector. - Flow is the direction and intensity, use the values 0,1 or 2 for make the water flow from front to back direction (Z is decreased), 0 is the most strong flow intensity. Use 3,4,5 for make the water flow from right to left direction (X is decreased). Use 6,7,8 for make the water flow from back to front direction (Z is increased) Use 9,10,11 for make the water flow from left to right direction (X is increased).

The explained above is taken from the Rosetta document, but it don't work in my TR1 test, so try this command in tr2 and tr3 and use different values and let me know what you discover.
 


>>>>>> Effects(Effect_number)
I don't know how this command is used, the official room editor manual from Eidos show a list of effect_numbers available but I don't know if they work in TR1-TR3 levels.

I checked at some original levels from the CD and seems that this command is also used for select a "switch sound" because it is normally used in a if_switch_is_On...trigger feel free to test this command and let me know what you discover.


>>>>>> End_Level()
Tell to the game engine to end the level.


>>>>> End()
Mark the end of a conditionnal command block.


AUXILIARY COMMANDS :

COPY_TRIGGER & PASTE_TRIGGER
ACTIVATION FLAG
ALTERNATE ROOMS
HOW IMPLEMENT KEYS-LOCKS
HOW IMPLEMENT SWITCH
HOW IMPLEMENT COLLAPSIBLE FLOORS
HOW IMPLEMENT TRAPDOORS

COPY_TRIGGER & PASTE_TRIGGER(Top)
This 2 commands are used to apply the same trigger command from a sector to several sectors.
- Copy_Trigger(roomx, column,Row) This will take note about the triggers commands specified at the sector column,row in the room Roomx
- Paste_Trigger(roomx, column, Row) This Will apply to the sector at column, row in the room roomx the same trigger noted for the last copy_trigger() command.

Example:

Copy_Trigger(1, 5,6) ; take note about the trigger in this sector.
Paste_trigger(1, 8,9) ; Apply the same Trigger to all next sectors.
Paste_trigger(1, 2,2)
Paste_trigger(1, 1,4)
Paste_trigger(1, 3,2)
Paste_trigger(2, 7,9)
 
 

Warning: Also the floor/ceilings slants commands will be copied with the copy_trigger command, so be careful.
 



 
ACTIVATION FLAG(Top)
The put_item command and the conditionnal block commands use the flag parameter, this is used to activate/deactivate a item using more that one command.

Normally when you put a item you use the value "0" in the flag parameter, but if you put the value "62" then the  item will start the level active. When a Item get his Flag the value "62" then the item is get activated.

The values that the Item's flag can have are: 0,2,4,8,16,32 or any value resulting for add some of these values. 2+4+8+16+32 = 62 (the activation value) So you can activate an Item by using a maximum of 5 different commands.

If you want for example make active a item using 2 command do this:

- Put the Item with value flag "0" (the starting flag value)
- use the first active command using the flag value "2".
- use the second active command using the flag value 4+8+16+32= 60. So 2 + 60 = 62 then the item will get active.

Note that the activation flag mean using the whole 5 values position, so if you use in one command the flag value "2" and in another command the same flag value "2" will NOT GIVE YOU the flag value "4", you still have the value "2" in the flag, and you will need to use the rest position values for get the "62" value.



 
ALTERNATE ROOMS(Top)
The alternate rooms feature is a ease and useful trick to implement the illusion that somewhat was changed in a room. In all TR version you found levels where there are some rooms that when LARA pull a switch the room then is filled with water or some floor are raised, or some walls are gone, etc.

This trick is implemented using 2 different rooms, you build the first room in his normal state, then you build another room at the same position with the changes that you want to show, when the game start LARA will see the first room, then when LARA pull a switch (or any other trigger), you tell to the TR engine to show the secound room instead the first one, and you did it!, this give the illusion that the this is one unique room that now has some changes on in.

The command to tell to the TR engine that two rooms will be alternated is: Put_alternate(Normal_Room, Alternate_Room)

For example:

Put_alternate(1,2); will tell to the TR engine to show room#1  in normal mode and to show room#2 in the Alternate mode.

The normal_room number MUST BE LOWER than the alternate_room number. When the game start the alternate mode is disabled and the normal rooms are used. To select the alternate/normal mode use the commands:

- Alternate_On() ; Now all alternate rooms defined in the level will be used instead the normals rooms.
- Alternate_Off() ; To switch back to use the normal rooms instead the alternate rooms.
 

Some Notes:

* The alternate rooms not necessary must be the same size than the normal room, it can be bigger or lower.
* The X,Y,Z alternate room position not necessary must be the the same than the normal room, but when the alternate room is switched LARA must be stand at a x,y,z coordinate inside the alternate room; the same for to switch back.
* You Can't define items or ornaments in the alternate room, all items and ornaments MUST HAVE TO BE DEFINED in the normal room, when the alternate room is switched all items/ornament/enemies will be changed to the alternate room at the same x,y,z coordinates.
* You can't link the normal room with his alternate, (portal-attribs or portals-views), if you do that the game will crash.
* The alternate room can have his own triggers and his own portal-attribs and portal-view to others rooms.
* Those others rooms linked with the alternate room must have ti use the normal-room number in the portal attrib and portal view instead the alternate room number.
 


HOW IMPLEMENT KEYS-LOCKS(Top)
Each keylock item has his proper key item, so LARA can't use a key to open the wrong keylock.

- You Put a closed door somewhere.
- You put the "key" item somewhere in the level.
- Then you put the keylock at floor sector (not in sector with wall) but for look realistic this floor sector should have a wall behind.
- Put at the same sector where the keylock is a if_keylock_is_On...trigger

The trigger will be executed when LARA use the proper key in the keylock. Next is a example, note that the ID objects are not real.

Put_item(1, 7,8,0, 58,0,0) ; Door-Item #2 in the list order.
Put_item(2, 6,2,0, 108,0,0) ; Key for keylock-1 Item #3 in the list order.
Put_item(1, 2,3,0, 116,0,0) ; Keylock-1 kind at sector 2-3 Item #4 in the list order.

Start_trigger(1, 2,3) ; sector at room #1 column 2 row 3 where the keylocks.
      If_keylock_is_ON_Do_with_Activate(62,0,0,4) ; If LARA turn ON the keylock.
                            Item(2); Open the door    |_______ Keylock #4 in the item list order.
     end()

End_Trigger()
 

Note that if you put more that one same keylock item ID in the room, the proper key item will work with all the same keylocks types. Also note that a keylock CAN'T BE turned OFF later.


HOW IMPLEMENT SWITCH(Top)
The switch are implemented almost in the same way that keylock, but the switch can be turned OFF later.

- You put the switch at floor sector (not in sector with wall) but for look realistic this floor sector should have a wall behind.
- Put at the same sector where the switch is a if_swicth_is_On...trigger, the trigger will be executed when Lara pull down the swicth.

- When Lara pull Up the switch the Items previously actives will get deactives.

Next is a example, note that the ID objects are not real.
 

Put_item(1, 7,8,0, 58,0,0) ; Door-Item #2 in the list order.
Put_item(1, 2,3,0, 116,0,0) ; Switch item at sector 2-3 Item #3 in the list order.

Start_trigger(1, 2,3) ; sector at room #1 column 2 row 3 where the swicth is.

   If_Switch_is_ON_Do_with_Activate(62,0,0,3) ; If Lara pull down the switch.
                          Item(2); Open the door  |_______ Swicth #3 in the item list order.
  end()

End_Trigger()



 
HOW IMPLEMENT COLLAPSIBLE FLOORS(Top)
Collapsible floors are items that get breakdown when LARA climb on In, and they need a trigger to be actives.

- Put the collapsible floor item raised over the solid floor.
- Put at the same floor sector the Do_with_activate...trigger.

Next is a example, note that the ID objects are not real.

Put_item(1, 2,3,4, 32,0,0) ; Collapsible floor at sector 2-3 Item #2 in the list order. ; one block Up over the solid floor.

Start_trigger(1, 2,3) ; sector at room #1 column 2 row 3 where the colapsable floor is.

   Do_with_Activate(62,0,0) ; If Lara climb in the colapsable floor.
        Item(2); Active the colapsable floor to get breakdown.
  end()

End_Trigger()
 



 
HOW IMPLEMENT TRAPDOORS(Top)
Trapdoors are regular doors but that Open down to the floor, they are implemented exactly in the same way that regular Doors, using a keylock trigger or a switch trigger or a normal if_lara_on_ground...trigger. But they need a extra trigger at the same sectors where they are, this extra trigger is the TRAPDOOR trigger.

- Put the Trapdoor at the sector that you want.
- Put at the same floor sector the Trapdoor trigger.
- Active the Trapdoor with a normal keylock, switch or any other active trigger.

Next is a example, note that the ID objects are not real.
 

Put_item(1, 2,3,4, 32,0,0) ; Put a trapdoor at sector 2-3 Item #2 in the list order.

Start_trigger(1, 2,3) ; sector at room #1 column 2 row 3 where the trapdoor is.
    Trapdoor(62,0,0) ; Make solid the follow trapdoors.
          Item(2) ; make this trapdoor solid
    end() End_Trigger()
 

Start_trigger(1, 2,6) ; sector at room #1 column 2 row 6 where a switch is.
   If_Switch_is_ON_Do_with_Activate(62,0,0,3)
          Item(2); Open/close the trapdoor
  end()
End_Trigger()

Important Note:
The trapdoor is most used to cover sectors collisional with the room below.

Because YOU CAN'T PUT triggers at sector colisional with room below, YOU WILL NEED TO PUT THE TRAPDOOR trigger in the solid floor sector in the room below instead the sector at room where the trapdoor is.



  AI items (Artificial inteligence)
===================================
These are the especial TR3 AI iterms that can be assigned to some
enemies in regular way, putting them at the same sector where the enemy is.

If you are going to test this AI items, doit with the monkey or with some
human enemies, most AI items will not work with tigers and some other enemies.
 

ItemID #74, (Guard).
---------------------------------
Assign this item to some human badies, when the enemy get active, he
will keep in the sector making guard until he see Lara.
 

ItemID #76, (Go to sector).
-----------------------------------

Firt put item #76 to a monkey, thern put another item #76 on another
sector in the room, when the monkey get active, he will walk to the sector
where you put the secound #76. Once there, the monkey will wall around the
sector.

I think this Item #76 can be used with some others goodies characters.
 
 

ItemID #78, (Wait for Lara and walk to the sector).
-------------------------------------------------------

Firt put item #78 to a human badie or godie, then put another item #78
on another sector in the room, when the human get active, he will wait for
Lara get close, then he will walk to the sector where you put the secound #76,
always waiting for Lara to follow him.

ItemID #75 (Amboush)
-----------------------
Firt put item #75 to a human badie, then put another item #75
on another sector in the room, when the human get active, he will run
to the sector where you put the secound #75, and will wait for Lara for
start attacking her.

I personaly have'nt tried this ai item, but some peoples say that work.
 

ItemId #76 y #79. (Patrol)
------------------------------
Give item #76 to a human character, then put a item #76 on another
sector in the room, then put a Item #79 en another sector in the room,
when the human get active, he will walk to the secound item #76 and then
will make patrol from secound item #76 to the item #79.
 

ItemID#77 (Unknown)
------------------------
Was used over a raptor (itemid # 28 in the level crash.tr2, they put
item #77 over the raptor, then another item #77 over another two sectors.
I don;t know what behavior give this item.
 


Final words:

Well, now I feel my Treditor3d more like a "real editor" because it build now populated levels for his self, the "Fenician Temple II" was completely built using just Treditor3d & Rview, and also for TR1 I guess that the 95% features are implemented (finally after one year hard work!).

Next I will add to Treditor3d features for TR2 & TR3 like climbable walls, step-sound, sound-sources and custom shapes, whish me luck.

I have not tested all commands in all TR version in all case, so if you don't found a command working, please let me know. I Hope you found this compiler useful.
 

-All info about the Tomb Raider command was taken from the Rosetta Stone Document written by Yury Zivago. -All Info not included in the Rosseta document was taken from RGbold's TRitem program.
- The zoom-out effect and the combat mode and some other useful info was discovered for me. :-)

I expect to see great levels with killer puzzles now from all you, get fun, see you...
 

                                 Turbo Pascal