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 12-05-14, 16:18   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,377
Default TRNG – Trigger adjustment and identification

See the main windows of STT (Set Trigger Type panel):

- “Trigger (what to trigger)” window - hereafter: Window Trigger.
- “(Object to trigger <#>)” window - hereafter: Window Object.
- “Type (Activation mode)” window - hereafter: Window Type.
- “Timer (Parameter <&>)” window - hereafter: Window Timer.
- “(E)xtra” window - hereafter: Window Extra.

If you want to adjust an STT window, then these are your possibilities:

- type a number manually (only in some cases in Window Object or Window Timer), or
- choose an entry of the list that belongs to the window (in any window).

The lists have two types:

- the list is constant (Window Type, Window Trigger), or
- the list is various (Window Object, Window Timer, Window Extra), which means the list changes if you change the entry in another window. (For example, if you choose ACTION for Window Trigger, then you will see the Moveable objects just placed in the map, in Window Object. But eg. if you choose FLIPEFFECT for Window Trigger, then you will see the list of the effects in Window Object.)

1. Window ID numbers

If the window has a constant list, then the window doesn’t have an ID number.
But if the window doesn’t have a constant list, then the window has an ID number.

The ID’s are:

- the number you typed in the window, or
- the ID of the list entry you can just see in the window.

There is always a P button next to the windows with a list like that. If you click on the P button at a window, then the contents of the actual list of that window will open in a TXT file. (The last of these TXT’s will be automatically saved in Level Editor main folder.) In the TXT, you will see the ID for each entry of the list.

We need the window ID’s:

- to create trigger ID’s,
- to adjust triggers in some alternative ways,
- to define the name of a trigger,
- to export triggers into Script or into WADMerger.

Another method to find window ID’s:

Click on Hide Constants List button:

- to show the ID of the list entry which is just adjusted in the Window Object and Window Timer, and
- to remove Window Extra, if the window just exists – so you can’t use Hide Constants Lists for Window Extra ID’s.

Besides, I don’t recommend using Hide Constants Lists for Window Timer ID if Window Extra exists, in the cases of ACTION or FLIPEFFECT triggers, because a “false” number will show up in Window Timer now: the aggregated value of Window Timer ID and the 256-fold of Window Extra ID. (That “false” number is not really false, that is important for the proper trigger name – see the explanation in Chapter 4.)

Click on Hide Constants List again, to restore the default look of STT.

2. Trigger ID numbers

We need ID numbers to identify the different ACTION, FLIPEFFECT and CONDITION triggers in an easy way.
For example, you definitely see that “ACTION with Turn <#>ANIMATING moving fastly in clockwise of (E) degrees entry in Window Timer” is a too long identification. - Click on Button P next to Window Timer to open a TXT, where you can find that the ID of that entry is 3. So you can call this trigger “ACTION with Window Timer ID3”.
Moreover, we will use that ID as the ID of the whole trigger. So “ACTION with Window Timer ID3” is “ACTION with ID3” – that is why you see ACTION 3 printed in the top bar of STT now.

So trigger ID numbers are:

- Window Object ID, if the trigger is a FLIPEFFECT,
- Window Timer ID, if the trigger is an ACTION or a CONDITION.

Usually we use the ID’s really shortly, so A means ACTION, F means FLIPEFFECT, C means CONDITION.
So, for example:

- A3 is ACTION 3 trigger,
- F52 is FLIPEFFECT 52 trigger,
- C78 is CONDITION 78 trigger.

Naturally A3, F52, C78 etc. are not perfect descriptions for a trigger, because eg. when you say A3, then you don’t know which object will be turned with how many degrees. However, the essence of the trigger is well-identified by that A3 sign.

3. Alternative methods to adjust triggers

As I said above, if you want to adjust an STT window, then you need to select an entry from a list, if there is a list, or you need to type a number, if there is not a list.
But it is not always true, there are alternative methods to adjust STT windows.

a, Adjusting with texts:


- Adjusting the entry in Window Object, with “Find <#>” button: type one/more (fragment of) word(s) in the little window next to the button. Then click on the button so an entry of the actual list of Window Object will show up in Window Object, if that entry has that/those word(s)/fragment(s). Click again and again, so other entries like that will show up. Stop clicking if the proper entry is shown in Window Object.
The button is useless if there is no list in Window Object.
- Adjusting the entry of Window Timer, with “Find <&>” button: type one/more (fragment of) word(s) in the little window next to the button. Then click on the button so an entry of the actual list of Window Timer will show up in Window Timer, if that entry has that/those word(s)/fragment(s). Click again and again, so other entries like that will show up. Stop clicking if the proper entry is shown in Window Timer.
The button is useless if there is no list in Window Timer.

b, Adjusting with trigger ID’s:

Click on Find Trigger Number button to open Find Trigger Number panel. Type a trigger ID here:

- to adjust the proper entry in Window Trigger, and
- to adjust the proper entry in Window Object (for FLIPEFFECT) or in Window Timer (for ACTION or CONDITION).

Type eg. F58 then click on OK to close the panel. – Now that is what happens in STT:

- FLIPEFFECT entry will show up in Window Trigger (whatever was in that window so far), and
- “Animated Textures. Set <&>th frame in (E)th texture of first p-range” (i.e. Window Object entry of F58) will show up in Window Object (whatever was in that window so far).

c, Adjusting with the code of an exported trigger:

- For example, if you don’t know what the $2000, 91, $214 trigger code means that you typed in the Script, then copy/paste that $2000, 91, $214 in Find Trigger Number window of STT, click OK – and the STT will show what $2000, 91, $214 means.
- For example, if you don’t know what the [-24571] [357] [3843] trigger code means that you typed in WADMerger Animation Editor, then type that [-24571] [357] [3843] in Find Trigger window of STT, click OK – and the STT will show what [-24571] [357] [3843] means.

d, Adjusting with typing the ID of a list entry:

For example, you want to adjust Window Object ID58 of your FLIPEFFECT trigger.
First of all, choose FLIPEFFECT in Window Trigger. Then switch on Hide Constants List button. Delete whatever you see in Window Object, then type 58 there.
Now switch off Hide Constants List button – and you will see the list entry that belongs to ID 58, in the window: “Animated Textures. Set <&>th frame in (E)th texture of first p-range”.

Or, for example, you want to adjust “5th frame” Window Timer entry for an F58 trigger.
First of all, adjust somehow Window Object ID 58 of your FLIPEFFECT. Then switch on Hide Constants List button. Delete whatever you see in Window Timer, then type 4 there – which is the ID of “5th frame” entry.
Now switch off Hide Constants List button – and you will see “5th frame” entry in the window.

I said above that Window Timer ID’s will be “confused” if Hide Constants List button is on and if Window Extra exists. But it is not a problem now – I’ll explain why:
Window Extra exists for F58, so if Hide Constants List is on, then you will see the aggregated value of Window Timer ID and the 256-fold of Window Extra ID, in Window Timer. A Window Timer ID is never bigger than 255 if Window Extra exits, so the aggregated number in Window Timer could be bigger than 255 only if Window Extra ID is 1 or bigger.
So if you type 4 in Window Timer now, that is possible only if Window Extra ID is 0. So if you switch off Hide Constants List now, then “5th frame” for ID 4 will show up in Window Timer and “1st position” for ID 0 will show up in Window Extra.

4. The name of the trigger

If you look at the name of a trigger then sometimes it is easy to understand it. – For example

TRIGGER (0:0) for FINISH (5)

means this trigger will load Lara to the level that is the fifth level in the Script.
But you will probably understand eg. what this trigger name is supposed to mean, only if you open STT to check the trigger:

TRIGGER (31503:0) for FLIPEFFECT (64)

So I present a short explanation now:

A (X:Y) for B (Z)

is the general form of a trigger name.

A or B are texts.
X, Y or Z are numbers.

A:
It is the entry of Window Type (TRIGGER, PAD, CONDITION, KEY etc.).

B:
It is the entry of Window Trigger (ACTION, FLIPEFFECT, SECRET, PARAMETER etc.). – Except:

- If it is an executable/condition trigger with OBJECT entry in the window then you’ll see the Moveable object slot name here you see in the Window Object of the trigger now.
- If it is a CAMERA trigger for a static camera or an OBJECT trigger for a flyby camera, then you will see the “camera” word now.

X:
It is the ID of Window Timer.
But if Window Extra exists for ACTION or FLIPEFFECT, that will affect the value of X: X is the ID of Window Timer plus the 256-fold of the ID in Window Extra now. (Eg. if the ID in Window Timer is 3 and the ID in Window Extra is 5 then X is 3+5×256=1283.)

Y:
If you switch on/off One Shot or number (1, 2, 3, 4, 5) buttons in STT that will affect the value of Y (which is 0 by default):

One Shot on: +1 to Y
Button1 off: +2 to Y
Button2 off: +4 to Y
Button3 off: +8 to Y
Button4 off: +16 to Y
Button5 off: +32 to Y

Usually Button 1, 2, 3, 4 or 5 is pressed or released in STT when you want. (Though, number buttons don’t always have an effect.) But that is not true if the trigger is a CONDITION trigger, because the buttons will be pressed/released automatically, according to the actual ID of Window Extra:

ID0: none of them is pressed
ID1: only Button1 is pressed
ID2: only Button2 is pressed
ID3: only Button1+2 are pressed
ID4: only Button3 is pressed
ID5: only Button1+3 is pressed
ID6: only Button2+3 is pressed
ID7: only Button1+2+3 is pressed
ID8: only Button4 is pressed
ID9: only Button1+4 is pressed
ID10: only Button2+4 is pressed
ID11: only Button1+2+4 is pressed
ID12: only Button3+4 is pressed
ID13: only Button1+3+4 is pressed
ID14: only Button2+3+4 is pressed
ID15: only Button1+2+3+4 is pressed
ID16: only Button5 is pressed
ID17: only Button1+5 is pressed
ID18: only Button2+5 is pressed
ID19: only Button1+2+5 is pressed
ID20: only Button3+5 is pressed
ID21: only Button1+3+5 is pressed
ID22: only Button2+3+5 is pressed
ID23: only Button1+2+3+5 is pressed
ID24: only Button4+5 is pressed
ID25: only Button1+4+5 is pressed
ID26: only Button2+4+5 is pressed
ID27: only Button1+2+4+5 is pressed
ID28: only Button3+4+5 is pressed
ID29: only Button1+3+4+5 is pressed
ID30: only Button2+3+4+5 is pressed
ID31 or there is no Window Extra: Button1+2+3+4+5 is pressed

The only purpose of these automatically pressed/released buttons is to define the proper Value Y in the trigger name.
So don’t hit those buttons now or else you will change the Window Extra entry unintentionally.

Z:
It is the ID of Window Object.

5. Triggers exported into the Script


Adjust the trigger in STT, then hit Export Script Trigger button. It will open a TXT file (saved automatically in Level Editor main folder), like eg. this:

; Set Trigger Type - FLIPEFFECT 91
; Exporting: TRIGGER(532:0) for FLIPEFFECT(91)
; <#> : Lara. (Health) Lara invulnerable for <&>time with (E)effect
; <&> : 20 seconds
; (E) : Blinking transparency - fast
; Values to add in script command: $2000, 91, $214


Use CTRL+C to copy the code in the “Values to add in script command” line and then CTRL+V to paste it in a TriggerGroup command, in the Script.

So each trigger code has three numbers:

First number:
It is a hexadecimal number (Sign $ means the number after the sign is hexadecimal, not decimal):

- $2000 means the trigger is a FLIPEFFECT,
- $5000 means the trigger is an ACTION,
- $8000 means the trigger is a CONDITION, with PARAMETER in Window Trigger (i.e. if the condition is not about a Moveable object),
- $9000 means the trigger is a CONDITION, with OBJECT in Window Trigger (i.e. if the condition is about a Moveable object).

Second number:
It is decimal (because there is no $ sign now), it is Number Z decimal value in the trigger name.

Third number:
It is hexadecimal (because there is a $ sign now), it is the hexadecimal version of Number X in the trigger name.
Except - in the case of CONDITION triggers, if Window Extra exists, the third number equals:
Number X decimal value plus the 256-fold value of Window Extra decimal value, turning the aggregate into hexadecimal.

Text A and Number Y of the trigger name are not important now, because we can’t export Window Type entries, One Shot button or number button statuses into the Script.

6. Triggers exported into WADMerger Animation Editor

Adjust the trigger in STT, then hit Export AnimCommand button. Then adjust some further values in the windows popped up.
Then a TXT file (saved automatically in Level Editor main folder) will open, like eg. this:

Add a SetPosition anim command with following values:

Set Position [-24571] [357] [3843]

Infos about exported trigger
-------------------------------------------------------------------------------
Set Trigger Type - FLIPEFFECT 357
Exporting: TRIGGER(3843:0) for FLIPEFFECT(357)
<#> : Sprite. Show sprite with data in <&>Parameters for (E)Durate
<&> : Parameters=PARAM_SHOW_SPRITE, 3
(E) : 15 seconds


AnimCommand: Frame=5
-------------------------------------------------------------------------
------

You need to insert the numbers of Set Position entry of the TXT as a Set Position AnimCommand in WADMerger Animation Editor. (Naturally it is not really a Set Position AnimCommand. All we did is used the Set Position technique of WADMerger to add an exported command to the animation, because the WADMerger doesn’t have a “real tool” to add an exported command.)

So each trigger code has three numbers:

First number:
With FLIPEFFECT triggers, always -24576 means Frame0. It will change according to a linear way. I mean, it is -24575 with Frame1, -24574 with Frame2 etc.
With ACTION triggers, in “Yes” way, always -32768 means Frame0. It will change according to a linear way. I mean, it is -32767 with Frame1, -32766 with Frame2 etc.
With ACTION triggers, in “No” way, it depends on the ID of Window Object:

- If the ID is between 0 and 255, then -28672 means Frame0. It will change according to a linear way. I mean, it is -28671 with Frame1, -28670 with Frame2 etc.
- If the ID is in the next 256 value-sized interval (256-511) then the difference for the code values is 256, compared to the previous interval. So -28672+256= -28416 means Frame0, -28415 means Frame1, -28414 means Frame2 etc.
- If the ID is in the next 256 value-sized interval (512-767) then the difference for the code values is 256 compared to the previous interval. So -28416+256= -28160 means Frame0, -28159 means Frame1, -28158 means Frame2 etc.
- Etc.

If you’ve chosen “Frame -1” for all the frames, after hitting Export AnimCommand button, then the frame will be counted as Frame 255 now. (Because usually you can choose frames in a 0-254 interval.)

If you’ve chosen “No” for the ACTION, then the exported trigger will be executed only for the object named in the trigger, or if you’ve chosen “Yes”, then the exported trigger will be executed for the actual object that is just performing that AnimCommand.

Second number:
With FLIPEFFECT triggers, it is the ID in Window Object (i.e. it is the trigger ID).
With ACTION triggers in “Yes” way it is the ID in Window Timer (i.e. it is the trigger ID).
With ACTION triggers in “No” way it is the ID in Window Timer (i.e. it is the trigger ID), plus this number:

- Only if Window Object ID is in the first half of the 256-value sized intervals: 0-127, 256-383, 512-639 etc.:
C, which is the 256-fold of D. D is Window Object ID minus E-fold 256. E is the interval ID minus 1 – so if E is 0 that is the first interval (0-255), if E is 1 that is the second interval (256-511) etc.
- Only if Window Object ID is in the second half of the 256-value sized intervals: 128-255, 384-511, 640-767 etc.:
C minus 65536.

For example:
Window Timer ID is 78, Window Object ID is 53. This time E is 1-1=0, so D is 53-0×256=53. That is why C is 256×53= 13568. – So the second number is 13568+78= 13646 now.
Or: Window Timer ID is 17, Window Object ID is 733. This time E is 3-1=2, so D is 733-2×256=221. That is why C is 256×221=56576. – So the second number is 56576-65536+17= -8943 now.

Third number:
With FLIPEFFECT triggers it is the ID in Window Timer. But if Window Extra exists, then that will affect the third number value: the 256-fold of the ID in Window Extra will be added to the ID of Window Timer.
(Eg. if the ID in Window Timer is 3 and the ID in Window Extra is 15 then the third number is 3+15×256=3843.)
With ACTION triggers it is 0, but if Window Extra exists, then it is the 256-fold of the ID in Window Extra.

Text A and Number Y of the trigger name are not important now, because we can’t export Window Type entries, One Shot button or number button statuses into the Animation Editor.
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 04:29.


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