Hidden Triggers in TRNG
by AkyV

Page 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16

4. Combinations in Slot Memory Zone

The subject of the Slot Memory Zone is always a Moveable object slot (including Lara as LARA object slot).

 

Triggers for the executable combinations:

 

The basic formulas:

 

a, the version if you don't use big numbers:

 

Trigger1. An F292 to define the actual subject of Slot Memory Zone. (Hereafter we call that subject 'X object slot'.)

Trigger2. An F232 to put a value (Y) between 0 and 127 into the chosen variable. Or an F252 to put a value (Y) between -1 and -128 into the chosen variable.

 Trigger3. An F294 to force the chosen variable value into the chosen field.

 

b, the version if you use big numbers:

 

Trigger1. An F292 to define the actual subject of Slot Memory Zone. (Hereafter we call that subject 'X object slot'.)

Trigger2. An F263 to put a value (Y) between -65536 and 65535 into the chosen variable.

 Trigger3. An F294 to force the chosen variable value into the chosen field.

 

Changing the basic formula:

 

a, If the number you want to force is above 65535: see Chapter I-21.

b, If you want to accomplish something special with the formula: see Chapter 7. and 8.

 

Triggers for the condition combinations:

 

The basic formulas:

 

a, the version if you don't use big numbers:

 

Trigger1. An F292 to define the actual subject of Slot Memory Zone.

Trigger2. An F293 to put the value of the chosen memory zone field into the chosen variable.

Trigger3. A C43 trigger to study the chosen variable value if that is equal with a chosen number (A) between 0 and 31.

 

b, the version if you use big numbers:

 

Trigger1. An F292 to define the actual subject of Slot Memory Zone.

Trigger2. An F293 to put the value of the chosen memory zone field into the chosen variable.

Trigger3. A C40 trigger to study the chosen variable value if that is equal with a chosen number (A) between 0 and 65535.

 

Changing the basic formula:

 

a, For smaller/bigger condition relations (if I say that or - if you're studying a sequence - any time):

- if you don't use big numbers:

 

= replace C43 trigger by C42 trigger to study the chosen variable value if that is smaller than a chosen number between 0 and 31, or

= replace C43 trigger by C41 trigger to study the chosen variable value if that is bigger than/equal with a chosen number between 0 and 31..

 

- if you use big numbers:

 

= replace C40 trigger by C39 trigger to study the chosen variable value if that is smaller than a chosen number between 0 and 65535, or

= replace C40 trigger by C38 trigger to study the chosen variable value if that is bigger than/equal with a chosen number between 0 and 65535.

 

b, If you're studying a sequence, and the condition need a tolerance: see Chapter I-18.

c, If the subject may have negative value in the examined property: see Chapter I-19. (I will always tell when it is needed.)

d, If the number you want to study is above 65535: see Chapter I-22.

e, If you want to accomplish something special with the formula: see Chapter 7. and 8.

 

4.1. The name of the field:

Explosion Mask. (Each bit a type of weapon able to do explode it (Long)

 

Executable combination:

Make (Y) meshes of (X) Moveable object slot shatterable

 

Y:

Each mesh of the object has a codebit in this field. - It is easy to understand:

 

Only Mesh0 is shatterable: Bit 0=Value 1

Only Mesh1 is shatterable: Bit 1=Value 2

Only Mesh2 is shatterable: Bit 2=Value 4

Only Mesh3 is shatterable: Bit 3=Value 8

Etc.

 

The values will be added with more meshes. For example, you can shatter the head (Mesh9) and the shield (Mesh11) of the skeleton now, that's why the default value of the skeleton in this field is 512+2048=2560, because Mesh9 has Bit9 (i.e. 512) and Mesh11 has Bit11 (i.e. 2048).

If all the meshes are shatterable, then the value is -1.

If none of the meshes are shatterable, then the value is 0.

Force: single.

 

Notes:

- The mesh keeps the collision after having shattered.

- Lara needs to aim with the lasersight.

 

Condition combination:

If (A) meshes of (X) Moveable object slot are shatterable

 

A:

'equal'

0: none of the meshes are shatterable

1, 2, 4 etc. or their aggregate (see above): this mesh is shatterable

'smaller' 0: if all the meshes are shatterable

Type: simple.

 

Note:

See a condition about a mesh having shattered in Chapter 1.1.29.

 

4.2. The name of the field:

First Animation Index (Short)

 

'Absolute' animations always calculate all the actual animations of the WAD, as if all the object slots of the WAD were only one, huge object slot. I.e. each absolute animation shows up only once in the case of that WAD. So eg. the absolute animation with ID=675 at that WAD doesn't belong to a concrete slot, it belongs to that WAD, there is no other Absolute Animation 675 of that WAD.

For example you'd like to know the absolute ID of Animation 0 (the first animation) of BADDY_1. Then open that WAD in NG Center\Tools\Animation Watcher, in 'Show PRESENT ANIMATIONS for current slot' mode. Choose BADDY_1 slot then see 'Anim' column. Choose the line of 0 (i.e. the line of Animation 0). See the value of 'ABS' column in the same line. Let's say it's 488. The value here is the Absolute Animation ID of that animation. So the absolute ID of Animation 0 of BADDY_1 is 488.

 

If you want to use triggers instead of NG Center to know an absolute ID of a first animation, then do this:

Activate a TriggerGroup with only F292, F293 triggers (in this order) to put the first animation absolute index of X object slot into a variable. - Maybe you can use this information in a condition or in some other way.

 

4.3. The name of the field:

First Mesh Index (Short)

 

Open the 'Select Object' panel in the Room Editor. Let's suppose this is what you see at BADDY_1: #RMI=80, #AMI=332.

#RMI=80 means if you find Mesh #80 in StrPix, then this is the first mesh of that BADDY_1 (i.e. the mesh you find as Mesh 0 in WADMerger Animation Editor). #AMI=332 is the so-called 'absolute index' of this mesh.

 

Activate a TriggerGroup with only F292, F293 triggers (in this order) to put the 'twice #AMI' value of X object slot into a variable. (It means the value in the example above is 2x332=664.) - Maybe you can use this information in a condition or in some other way.

 

4.4. The name of the field:

FootStep (Shadow below Lara or enemies) (Short)

 

Executable combination:

Force (Y) maximum size for the shadow of (X) Moveable object slot

 

Y: from 1 to any (probably 1 means about? 1 unit)

Force: single.

 

Notes:

- 'Maximum size' means the size of the shadow is changing when the object is moving. In the case of Lara the default shadow size is 160. Probably that 160 units wide (i.e. maximum sized) shadow will be realized for example when she is standing and still with her Animation103.

- Collision boxes are usually related to the shadow size. So using this combination means you force a shadow on the object, which shadow size is not related to the collision box size.

 

Condition combination:

If the shadow maximum size of (X) Moveable object slot is (A)

 

A: from 1 to any

Type: sequence.

 

Note:

The condition is useful if you want to change the size by the executable combination, and if you want to study if it has happened yet or not.

 

4.5. The name of the field:

Number of Meshes (Short)

 

Activate a TriggerGroup with only F292, F293 triggers (in this order) to put the mesh numbers of the slot into a variable. (For example, in the case of Lara object the value is 15, because her meshes come from Mesh0 to Mesh14.) - Maybe you can use this information in a condition or in some other way.

 

Note:

If you use an executable formula with this field then that is able to make some meshes invisible/visible. But I think it's better to use A50 or A51 triggers for that. (See more about that here: Chapter 1.1.29.)

 

4.6. The name of the field:

Pointer for Collision Procedure (Long)

 

Executable combination:

Enable pushable objects to be being pushed/pulled over (X) pickable items

 

We have an unfortunate problem in the freshest (?) TRNG patches: Lara can't push/pull pushables objects over pickable item - because the collision of the pickable item prevents it. (In fact, if the pushable object is placed on the pickable item in Room Editor, then Lara will be able to move it.)

We can fix the problem - though it is a bit complicated:

 

GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 1, 2, 3

TriggerGroup= 1, C30 ('if Lara is performing Animation120', i.e. when she is 'ready to push/pull'), C5 (with TGROUP_OR flag, 'if Lara is pushing/pulling a block')

TriggerGroup= 2, (the basic formula, forcing Value 0)

TriggerGroup= 3, * formula

 

*:

Trigger1. An F292 to define the actual subject of Slot Memory Zone.

Trigger2. An F263 to put a value between 1 and 65535 into Current Value variable.

Trigger3. An F263 to put a value between 1 and 65535 into the originally used variable.

Trigger4. An F288 to multiply the values of the two variables by each other.

Trigger5. An F294 to force Current Value value into the chosen field.

 

Let's see an example to understand - when the 'obstacle' is a big medipack:

First of all, some theory: 4549520 is the value of this field (the so-called 'collision pointer') in the case of big medipacks. If you force 0 in this field then the medipack will loose its collision, so Lara will be able to push/pull the pushable object over it. (Note that the 'usual' triggers to remove the collision are useless sometimes. Probably the case of pickable items is a problematic case like that.) Naturally our purpose is to restore the collision of the medipack (i.e. to restore the collision pointer 4549520) when Lara has finished pushing/pulling, so she can pick up the medipack if the pushable object isn't just on it. (Because she can't pick it up without collision.)

So the GlobalTrigger will study if Lara is ready to push/pull or pushing/pulling (TriggerGroup1). If she is then the GlobalTrigger will force 0 in the field (TriggerGroup2). But if she is not then the GlobalTrigger will force 4549520 in the field (TriggerGroup3). (Yes, the 'ready' part is necessary or else Lara can't be able to start pushing/pulling now.)

TriggerGroup2 defines the big medipack as the subject of Slot Memory Zone (F292), then forces 0 into a Long variable (F232), then forces that 0 of that variable into 'Pointer for Collision Procedure (Long)' field (F294).

The biggest number at a PARAM_BIG_NUMBERS ID is 65535. So we must split the collision pointer into a multiplication of two another numbers. For example: 4549520=1073x4240. You will place both 1073 and 4240 at a big number ID in the Script.

So TriggerGroup3 defines the big medipack as the subject of Slot Memory Zone (F292), then forces 4240 into Current Value variable (F263), then forces force 1073 into the same Long variable as above (F263). Then it multiplies 4240 and 1073 by each other (F288) to get 4549520 as the new value of Current Value. Then it forces Value 4549520 of Current Value into 'Pointer for Collision Procedure (Long)' field (F294).

 

Notes:

- This GlobalTrigger is always enabled. It causes all the medipacks loses the collision while Lara is pushing/pulling. (So even the ones which are not obstacles. And even when Lara is pushing/pulling in another situation, anywhere else.) But it doesn't matter at all. I mean, if she is pushing/pulling, she is not able to pick up any medipack, right? Even if we didn't fiddle with the collision. So who cares if they don't have collision while she's doing that?

- If you want to know a collision pointer of a pickable object slot, then see Chapter I-17.

 

4.7. The name of the field:

Unknown1 (Pheraps distance to enable the MIP version) (Short)

 

Executable combination:

Swap any object of (X) Moveable object slot for its MIP version farther than (Y) distance from Lara and swap it back closer than that

 

Y: from 1 to any (256 means 1 square distance now)

Force: single.

 

Notes:

- So, for example, if you have a BADDY_1 and a BADDY_1_MIP then you can select the value when they will be swapped for each other.

(Probably all the enemy objects with a MIP slot have a default distance for the swap. But it usually doesn't really matters because we don't really use MIP objects nowadays. And that default distance is usually large.)

- This combination is useful first of all in the case of enemy MIP's. I mean, you can define preset values for this action in the case of Animating objects (see AnimatingMIP Script command). - But the present combination is also useful with Animatings.

- It is a nice tool if you want to use a trick with two totally different objects: 'if Lara is closer to the object then the object will look as Object A, but if Lara is farther from the object then the object will look as Object B'.

(It also works with F341 trigger, but in that case the mesh tree of the two objects must be similar.)

 

Condition combination:

If any object of (X) Moveable object slot swaps for its MIP version farther than (A) distance from Lara and swap it back closer than that

 

A: from 1 to any

Type: sequence.

 

Notes:

- Don't misunderstand: what this condition studies is the distance itself, not the swap has happened in a distance or not.

- The condition is useful if you want to change the distance by the executable combination, and if you want to study if it has happened yet or not.

 

4.8. The name of the field:

Unknown2 (Usually it has value 50) (Short)

 

Executable combination:

Make (X) enemy slot detect Lara for an attack in (Y) distance

 

Y: from 1 to any units

Force: single.

 

Notes:

- The default value is 50. It possibly means 'with 50 units in front of Lara's vertical axis'. So, for example, if you force 1024 in this field at BADDY_1 slot, then BADDY_1 will wield his sword to hit the air in 1 square distance from Lara, without hurting her. (But I don't think this field is useful if the enemy attacks with bullets.)

- This combination is useful eg. in the case of AI_GUARD objects. I don't know the exact meaning of Y values now, but I know if Y is bigger then the enemy will detect Lara only if she is closer to him.

 

Condition combination:

If (X) enemy slot detects Lara for an attack in (A) distance

 

A: from 1 to any

Type: sequence.

 

Notes:

- Don't misunderstand: what this condition studies is the distance itself, not the attack has happened in a distance or not.

- The condition is useful if you want to change the distance by the executable combination, and if you want to study if it has happened yet or not.