The Detector
by Bedazzled
Download Detector WADs

The detector object is a new piece of equipment which Lara can use to locate the position of pickups & enemies in real time. It comes in two models, both of which can be downloaded from the link above.

1 - The pointer detector which is found in the ng2 wad.

2 - The radar detector which is found in the ng wad.

Both detectors use the Quest_Item 1 slot, replacing the Amulet of Horus which should be renamed to 'Detector' in the English.txt file using the NG scripter.

For reference both models are shown in the picture below.

In order to use the Detector and enable its various features a range of new script commands are used. I will list each of these command parameters and their functions in turn.

Command Syntax:
Detector= Flags (DTF_...), MetricScale, MetersOfRange, Target Item array.

Scope: To use in [Level] section.

Flags (DTF_...) field

This field is used to set the various features of the detector. Currently you can use the following flags.

DTF_ENGAGE_ALWAYS

Using this flag means the detector will always be on screen until all the targets have been located.

DTF_ENGAGE_IN_RANGE
Using this flag means the detector will automatically be shown on screen when a target is within the range set by the Metres of range parameter. For example if the range is set to 50 metres the detector will be shown when Lara is within a distance of 50 metres or less from the target. When she moves farther away the detector will be hidden.

DTF_ENGAGE_INVENTORY
Sets the detector like other equipment. She has to pick it up and it must be selected from the inventory. To remove it from the screen select it again in the inventory and choose cancel.

DTF_REQUIRED_ITEM

This flag works in conjunction with the engage flags described above to signal that the detector must be contained in the inventory before it will be enabled.

For example using these flags. 

DTF_ENGAGE_ALWAYS+DTF_REQUIRED_ITEM
Would mean the detector is constantly shown on screen only after Lara picks it up. Until then it would not be shown.

NOTE: if you choose the DTF_ENGAGE_INVENTORY flag the DTF_REQUIRED_ITEM flag is not required as the game engine will insert it automatically.

Used with DTF_ ENGAGE_IN_RANGE the DTF_REQUIRED_ITEM flag requires that two conditions have been met before the detector is shown. These are.

1 - The detector must be in Lara's inventory.

2 - A target must be within the specified range.

DTF_RADAR_MODE

By default the detector works in pointer mode. Use of this flag will force the detector into radar mode. There are large differences between them and some fields and flags will only work for a specific mode.

DTF_NONE
Use this if you don't want to set any specific flags in this field.

The operating modes

Pointer mode

In this mode the detector resembles a compass and shows the direction of the current target (this is the first target in the target item array list which has not been found or in the case of enemies killed).

Pointer mode only works on one target at a time. When the first target is picked up or killed the pointer will point to the second target in the list and so on.

DTF_SWINGING_POINTER
This flag only works in pointer mode. By default the pointer will remain fixed pointing directly to the target. By the use of this flag the pointer can be given a more realistic swinging motion.

DTF_INVERSE_VPOINTER

This flag only works in pointer mode. By default the floating line shown on the scale at the right side of the detector shows the vertical position of Lara relative to the target, while the fixed line at the centre of the scale shows the position of the target. Using this flag will reverse these, resulting in the floating line representing the target and the fixed line representing Lara.

In pointer mode the pointer is always relative to the direction Lara is facing. When the pointer is on the red marker it means Lara is looking in the direction of the target.

Radar mode

In radar mode the detector will scan all targets which are within range at the same time.

Note: The range shown on the radar screen is different from the range at which it will be activated. The range shown on the scale is given by the formula 6 * MetricScale, where 6 is the fixed number of division lines on the radar screen. For example if you set 2 metres for the Metric Scale a target will only be shown if it's 12 metres or less from Lara. In Radar mode the target is always shown to the north on the radar screen and Lara will need to face North to determine if the target is to the left or right of her.

DTF_FAST_RADAR_SCAN

This flag only works in radar mode and means the scanning of targets will be faster. Remember the position and distances to targets are only updated when the sweeping beam of the radar touches them.

MetricScale field

The value entered in this field is used to assign the distance in metres for each division on the vertical scale of the detector in pointer mode, and the distance in metres represented by each gridline in radar mode. If you enter IGNORE in this field a default value of 2 will be used.

In game, one block represents a distance of 2 metres so setting a value of 2 in the MetricScale field will result in each division on the detector representing one block in game.

For example if the radar screen showed a target 3 squares from Lara's position (the centre of the radar panel) the target would be 3 tiles or 6 metres from her. In pointer mode the Metric Scale works only on the vertical panel at the right side of the detector.

It's very important to set a suitable value for Metric Scale when using radar mode because it determines the maximum radius from Lara which will be scanned. You should use a large value in order that targets are picked up from a long range; on the other hand if using the detector in pointer mode it's better to use a low value such as 2.

MetersOfRange field

This field is used only if you have used the flag DTF_ENGAGE_RANGE. The value entered in this field is the distance in metres from Lara which targets must be within before the detector is shown in game. When using the radar mode detector a reasonable value would be the same as the value set for the MetricScale.

Target Items array fields

In this field you enter one or more indices of items (only movables allowed) which you have placed into the level. If entering several each one should be separated by a comma.

It's most important to enter the correct number found by clicking on the object you want to target in the level editor.

Do not use the numbers given in the Slot Movables indices list found in the reference section of the NG scripter shown below.

Example script

Detector= DTF_REQUIRED_ITEM + DTF_ENGAGE_IN_RANGE + DTF_SWINGING_POINTER + DTF_INVERSE_VPOINTER, 2, 30, 365,372,373,375,377.

In the example above the value '2' is the MetricScale; the value '30' is the MetersOfRange value and all other numbers are the indices of the target items.

The list of array items works in different ways depending on which detector mode is being used. 

Pointer mode

The detector will show the position of only one item at a time. In the example above it will first show the position of the item with index 365 even if an item further along the list is actually closer to Lara. Only after this item is picked up or killed will the detector target the next item with index number 372. 

Because of this you should never use items which cannot be picked up or killed, such as a door, as the detector would never move from that target item.

Radar mode

In this mode all targets are simultaneously tracked but only targets within the visibility range equal to (6*MetricScale) will be shown on the radar screen. The radar screen shows objects in various ways depending on their vertical position, when the target is at the same floor height as Lara or it's shown as a small blinking circle. It's also shown as a circle if it is 2 blocks higher or lower than Lara's position.

If the target is higher than Lara it's shown as a triangle with it's apex pointing north, if the object is below Lara by 4 metres or more the triangle will point to the south. The same shapes will appear in the vertical panel on the right side of the detector.

Giving the Player Instructions

When the player picks up the detector it's possible to have instructions on its use appear and remain on screen until Lara moves to a different tile. This is achieved by the use of two new flipeffects and two further entries in the script plus a txt file.

To make the required script entry, open your levels script in the NG scripter and add this line of text to the level section. This is needed to position the text on screen and also to reduce the font to a more suitable size.

TextFormat= CL_METAL, FT_TOP_CENTER+FT_SIZE_HALF_HEIGHT, IGNORE, IGNORE

Next select the Strings tab. From the Section dropdown box select [ExtraNG]

Click the 'Add new Extra String button' and in the text box at the bottom of the window enter the following without the quotes. '@info_pointer_detector.txt' then click the update button. The result is shown below.

Now save and build your script.

Two new flip effects are required; the first prints the instructions on the screen and is activated by a pickup trigger for the detector in the normal way, remembering to place 64 into the OCB code box of the detector. The parameters for this flipeffect are shown below.

To remove the text from the screen set an area surrounding Lara which triggers this flipeffect.