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.
Next are a explanations for all commands implemented in this version.
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(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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
- 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
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
- 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.
- 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()
- 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()
- 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()
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.
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.
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