www.tombraiderforums.com

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

Closed Thread
 
Thread Tools
Old 31-10-14, 17:18   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,505
Default TRNG Conditions for targeting

Instructions:

1. Copy the setup in your Script.
2. Build the Script.

Special instructions, if the Script doesn’t work/cannot be built:

1. If you already have a Parameters= PARAM_BIG_NUMBERS command at your level, then remove the same command of the setup you’ve just copied, and type the amount value of the removed command into the old command.
2. Open the Find Trigger Number window in Set Trigger Type panel, and copy-paste the underlined triggers there (one by one), to check them:

- If you removed the new Parameters= PARAM_BIG_NUMBERS command, you need to check if the big number index is still okay in the trigger (if it is a trigger about big numbers). If it is not, then choose the good one.
- Maybe you need to choose another variable, because you can’t use the variables (Global Byte Alfa1) I used in the setups. So choose another one now (if it is a trigger about variables), if it is needed.
You are never allowed to change Current Value variable!

Export the trigger you have changed, replacing the previous trigger in the Script.
3. Build the Script.

Don't forget: PARAM_BIG_NUMBERS position ID in the triggers, after the $ sign, must be typed in hexadecimal format!


Condition:
If X manual/automatic targeting is adjusted (in Options menu)

TriggerGroup= 1, $2000, 244, $5200, >;put the status of targeting mode into Global Byte Alfa1 (GBA1) variable.
$8000, 0, $X2B ; if GBA1=X


X codes are:

0: manual
2: automatic

Note:
If Lara is aiming with the lasersight manually, when automatic targeting is adjusted, that is considered as automatic targeting now.

Known bug:
The condition will take the data from “Targeting” menu item, but the data will be refreshed only if Lara extracts a weapon or if the player selects “Targeting” at the very first time.
You can prevent the bug in one of these ways:

= Don’t use the condition in the moment when the first level starts, or else the condition will fail. Use it a bit later (or much later), if you are sure that Lara extracted a weapon at least once. (So eg. if the condition is a GT_ALWAYS GlobalTrigger, then the GlobalTrigger must be disabled when the level starts.)
= You need to activate a “draw the weapon” (F53) trigger when the first level starts.
= You need a readme to tell the player to select targeting mode in the title (even if the required mode is selected) before starting the game.

Condition:
If Lara is just aiming at X enemy in the automatic way

TriggerGroup= 1, $2000, 244, $13FF, >;put the “memory address” of enemy being aimed into Current Value variable
$2000, 351, $0, > ;turn the “address” into the tomb (game) index of the object
$2000, 300, $0, > ;turn the tomb (game) index into NGLE (Room Editor) index
$8000, 255, $Y28 ; if Current Value is the number at Y position of PARAM_BIG_NUMBERS (Y=0: first position, 1: second position etc.), this is 0 in this example
Parameters= PARAM_BIG_NUMBERS, X


X code is:
The index of the object you can see in NGLE Room Editor.

“Automatic” is now:
- If automatic targeting is adjusted (in Options menu), and
- if Lara’s aiming with any weapon, not using the lasersight.

Note:
See a complex version of this, on TRF: enemy health bar tutorial.

Condition:
If Lara is just aiming at any enemy of X enemy slot in the automatic way

TriggerGroup= 1, $2000, 244, $13FF, >;put the “memory address” of enemy aimed into Current Value variable.
$2000, 351, $0, > ;turn the “address” into the tomb (game) index of the object
$2000, 245, $2FF, > ;set the object with that index as the subject of Item Memory Zone
$2000, 256, $3FF, > ;put the slot index of that enemy into Current Value
$8000, 255, $Y28 ; if Current Value is the number at Y position of PARAM_BIG_NUMBERS (Y=0: first position, 1: second position etc.), this is 0 in this example
Parameters= PARAM_BIG_NUMBERS, X


X code is:
The index of the object slot you can see in NG Center/Reference.

Condition:
If Lara is just aiming at any enemy in the automatic way

TriggerGroup= 1, $2000, 244, $13FF, >;put the “memory address” of enemy aimed into Current Value variable.
$8000, 1, $2E ;if Current Value >=1


Condition:
If Lara is just looking through the lasersight on any weapon, either shooting or not

TriggerGroup= 1, $8000, 2, $23,> ;if Lara's holding revolver
$8000+TGROUP_OR, 6, $23, > ;if Lara's holding crossbow
$2000, 244, $1200, >;put the "looking through" status of the lasersight/binocular into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Y028,> ;if GBA1 is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
$8000+TGROUP_OR, 0, $Y128,> ;if GBA1 is the number at Y1 position of PARAM_BIG_NUMBERS, Y1 is 1 in this example
$8000+TGROUP_OR, 0, $Y228,> ;if GBA1 is the number at Y2 position of PARAM_BIG_NUMBERS, Y2 is 2 in this example
$8000+TGROUP_OR, 0, $Y328,> ;if GBA1 is the number at Y3 position of PARAM_BIG_NUMBERS, Y3 is 3 in this example
$8000+TGROUP_OR, 0, $Y428,> ;if GBA1 is the number at Y4 position of PARAM_BIG_NUMBERS, Y4 is 4 in this example
$8000+TGROUP_OR, 0, $Y528,> ;if GBA1 is the number at Y5 position of PARAM_BIG_NUMBERS, Y5 is 5 in this example
$8000+TGROUP_OR, 0, $Y628,> ;if GBA1 is the number at Y6 position of PARAM_BIG_NUMBERS, Y6 is 6 in this example
$8000+TGROUP_OR, 0, $Y728 ;if GBA1 is the number at Y7 position of PARAM_BIG_NUMBERS, Y7 is 7 in this example
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2, X3, X4, X5, X6, X7


X codes are:
X0 is 16 – looking through the lasersight, no special action.
X1 is 17 – looking through the lasersight, plus, Lara is over a square having a grey frame (by Room Editor “B” button) for the mechanical scarab.
X2 is 24 – looking through the lasersight, plus, Lara shoots. (The effective shooting. I mean, it doesn’t matter now, eg., if Lara loads the shotgun.) Actually, it is useless with the revolver.
X3 is 25 - looking through the lasersight, plus, Lara is over a square having a grey frame and she shoots. Actually, it is useless with the revolver.
X4 is 80 – looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that.
X5 is 81 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she is over a square having a grey frame.
X6 is 88 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she shoots. Actually, it is useless with the revolver.
X7 is 89 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she is over a square having a grey frame, and she shots. Actually, it is useless with the revolver.

Condition:
If Lara is just looking through the lasersight on the crossbow, either shooting or not

TriggerGroup= 1, $8000, 6, $23, > ;if Lara's holding crossbow
$2000, 244, $1200, >;put the "looking through" status of the lasersight/binocular into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Y028,> ;if GBA1 is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
$8000+TGROUP_OR, 0, $Y128,> ;if GBA1 is the number at Y1 position of PARAM_BIG_NUMBERS, Y1 is 1 in this example
$8000+TGROUP_OR, 0, $Y228,> ;if GBA1 is the number at Y2 position of PARAM_BIG_NUMBERS, Y2 is 2 in this example
$8000+TGROUP_OR, 0, $Y328,> ;if GBA1 is the number at Y3 position of PARAM_BIG_NUMBERS, Y3 is 3 in this example
$8000+TGROUP_OR, 0, $Y428,> ;if GBA1 is the number at Y4 position of PARAM_BIG_NUMBERS, Y4 is 4 in this example
$8000+TGROUP_OR, 0, $Y528,> ;if GBA1 is the number at Y5 position of PARAM_BIG_NUMBERS, Y5 is 5 in this example
$8000+TGROUP_OR, 0, $Y628,> ;if GBA1 is the number at Y6 position of PARAM_BIG_NUMBERS, Y6 is 6 in this example
$8000+TGROUP_OR, 0, $Y728 ;if GBA1 is the number at Y7 position of PARAM_BIG_NUMBERS, Y7 is 7 in this example
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2, X3, X4, X5, X6, X7


X codes are the same as above.

Condition:
If Lara is just looking through the lasersight on the crossbow, not shooting

TriggerGroup= 1, $8000, 6, $23,> ;if Lara's holding crossbow
$2000, 244, $1200, >;put the "looking through" status of the lasersight/binocular into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Y028,> ;if GBA1 is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
$8000+TGROUP_OR, 0, $Y128,> ;if GBA1 is the number at Y1 position of PARAM_BIG_NUMBERS, Y1 is 1 in this example
$8000+TGROUP_OR, 0, $Y228,> ;if GBA1 is the number at Y2 position of PARAM_BIG_NUMBERS, Y2 is 2 in this example
$8000+TGROUP_OR, 0, $Y328 ;if GBA1 is the number at Y3 position of PARAM_BIG_NUMBERS, Y3 is 3 in this example
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2, X3


X codes are:
X0 is 16 – looking through the lasersight, no special action.
X1 is 17 – looking through the lasersight, plus, Lara is over a square having a grey frame (by Room Editor “B” button) for the mechanical scarab.
X2 is 80 – looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that.
X3 is 81 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she is over a square having a grey frame.

Condition:
If Lara is just looking through the lasersight on the revolver, either shooting or not

TriggerGroup= 1, $8000, 2, $23,> ;if Lara's holding revolver
$2000, 244, $1200, >;put the "looking through" status of the lasersight/binocular into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Y028,> ;if GBA1 is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
$8000+TGROUP_OR, 0, $Y128,> ;if GBA1 is the number at Y1 position of PARAM_BIG_NUMBERS, Y1 is 1 in this example
$8000+TGROUP_OR, 0, $Y228,> ;if GBA1 is the number at Y2 position of PARAM_BIG_NUMBERS, Y2 is 2 in this example
$8000+TGROUP_OR, 0, $Y328 ;if GBA1 is the number at Y3 position of PARAM_BIG_NUMBERS, Y3 is 3 in this example
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2, X3


X codes are the same as above.

Condition:
If Lara is just looking through the lasersight on the crossbow, shooting

TriggerGroup= 1, $8000, 6, $23,> ;if Lara's holding crossbow
$2000, 244, $1200, >;put the "looking through" status of the lasersight/binocular into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Y028,> ;if GBA1 is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
$8000+TGROUP_OR, 0, $Y128,> ;if GBA1 is the number at Y1 position of PARAM_BIG_NUMBERS, Y1 is 1 in this example
$8000+TGROUP_OR, 0, $Y228,> ;if GBA1 is the number at Y2 position of PARAM_BIG_NUMBERS, Y2 is 2 in this example
$8000+TGROUP_OR, 0, $Y328 ;if GBA1 is the number at Y3 position of PARAM_BIG_NUMBERS, Y3 is 3 in this example
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2, X3


X codes are:
X0 is 24 – looking through the lasersight, plus, Lara shoots. (The effective shooting. I mean, it doesn’t matter now, eg., if Lara loads the shotgun.)
X1 is 25 - looking through the lasersight, plus, Lara is over a square having a grey frame and she shoots.
X2 is 88 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she shoots.
X3 is 89 - looking through the lasersight, plus, Lara used a ladder, and didn’t hang on a ledge after that, and she is over a square having a grey frame, and she shots.


The easiest solutions to use the conditions:
- The TriggerGroup ID is referred by a C15 trigger. There is a TRIGGER placed in the map, overlapped with the CONDITION trigger. The TRIGGER will be executed if Lara is in the trigger zone when the CONDITION is true.
- The TriggerGroup ID is referred by the IdConditionTriggerGroup field of a GlobalTrigger.


Made using TRNG 1.2.2.7.

Last edited by AkyV; 26-08-16 at 21:19.
AkyV is offline  
Closed Thread

Bookmarks

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 00:12.


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