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 20-05-15, 06:30   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,505
Default TRNG Vitality special

Instructions:

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

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

1. Check TriggerGroup, and GlobalTrigger ID’s and change them if you are already using the ID in another TriggerGroup/GlobalTrigger.
2. 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.
3. 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 changed TriggerGroup/GlobalTrigger ID’s, then you also need to change the TriggerGroup/GlobalTrigger ID in the trigger (if it is a trigger about a TriggerGroup/GlobalTrigger).
- 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, Global Short 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.

Command:
Make Lara invulnerable against the direct attack of X enemy

'Direct attack' means sword, bite etc. I.e. the command doesn't work with bullets. (Hurts caused by traps are also not included now.)

TriggerGroup= 1, $5000, X, $36, > ; defining the enemy with its X ID code you see in Room Editor
$2000, 255, $1 ; force 0 for the „contact flags” parameter

You need a continous activation. So Lara will be invulnerable till you stop the continous activation
Activate an F118 in “continuous” mode for TriggerGroup#1 to start the continous activation. – Activate an F192 for the same TriggerGroup to stop the continous activation.
Or activate TriggerGroup#1 with a GlobalTrigger, with a continuous condition (eg. GT_ALWAYS) to start the continous activation. – If the condition goes false or you disable the GlobalTrigger with an F109 that will stop the continous activation.

Notes:

- You cannot specify the enemy, using invulnerability with F91. But this command is able to do that.
- 'If Lara collides with X object' conditions will probably fail if you are just using this command on X object in the same time.

Condition:
If X Moveable object is died/ruined (general condition)

Use this condition if you have problems with C14 trigger to examine the death of the enemy:

- Because C14 is not savegame-stable. I.e. you can't study the death of the enemy if you save the game after the death, and you load that savegame after that. So, if you still want to examine the death after the load.
- Because C14 won't work with special deaths. (Eg. if you blow up a non-living Moveable object with A14.)

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $F00, > ; put the actual death status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $W026; if GBA1 >= than the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, 100

The easiest solutions to use the conditions:
- The TriggerGroup (1) 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 (1) ID is referred by the IdConditionTriggerGroup field of a GlobalTrigger.

Condition:
If X Moveable object is died/ruined in Y special way

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $2710, > ; put the actual death status into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0Z; if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, Y

Y values are:

a, when Z is 27:

10 - a non-living Moveable object (column, teeth spikes etc.) has been exploded (as 'creature') by A14 trigger.

b, when Z is 28:

2
- any enemy (including wraith) is killed by A14 trigger in 'exploding creature' way,
- simulating “helicopter explosion” by A82 to kill enemies or remove other Moveable objects.
4
- smash object (triggered or not) or hydra has been shattered by explosive ammunition,
- smash object (triggered) has been shattered by Lara jumping to that.
(It is a useful condition for smash objects, because when they smash, then HEAVY triggers are useless, as opposed to Shatter objects.)
16 – non-active “statue” enemies (dog with OCB 1, mummy with OCB 2, skeleton with OCB3) has been removed by explosive ammunition.
18 - any enemy has been killed by explosive ammunition.
34
- wraith1, wraith2 has died in the water (the death condition of wraith3 is a bit complicated, see about it in Hidden Triggers tutorial),
- falling block has fallen,
- laserhead/smashable bike wall/floor has been shattered,
- any enemy (including wraith) has been removed by A14 trigger,
- simulating “baboon has gone by a flash” by A82 to kill enemies or remove other Moveable objects.
36
- jeep/motorbike has been exploded (fallen into water),
- any enemy (including wraith) or a non-living Moveable object has been exploded (in 'ground/sky' or 'underwater' way) by A14 trigger.
38 - the guide has been disappeared (by OCB codebit buttons of AI_FOLLOW)
42 - the skeleton has gone after Lara having shot that into the pit
51 - the fishes are all emitted (i.e. the emitter itself is 'dead')
258 - any enemy was poisoned when being killed by A14 trigger in 'exploding creature' way
260 - any enemy died when being poisoned (but perhaps not the poison itself but bullets killed him)
274 - any enemy was poisoned when explosive ammunition killed him
292 - any enemy was poisoned when being killed by A14 trigger in 'exploding ground/sky' or 'exploding underwater' way
8230 - baboon has gone by a flash

The condition doesn’t work for these special deaths:

- If Lara shot the ahmet dead so he's lying dead on the floor. (Because, don't forget, according to the original setup, an ahmet will never be dead, but will be transported to his cage when having been shot dead.)
- Lara has shot the head of the skeleton, making that shatter.
- The little beetles/locusts are all emitted. (I.e. the emitter itself is 'dead'.)
- A Flipeffect has made the little beetles or fishes disappear.
- Locusts after dissipating.
- Kill any enemy by A14 trigger in 'antitrigger' (freezing) way.
- Create a pause in emitting creatures by A14 trigger in 'disable' way.
- Hide the enemy by A14 trigger.
- Ghost trap (see A13 trigger) for wraith3.

The condition will probably not be savegame-stable. So, if you save the game after the death, and you want to study the death after loading that savegame, then the condition will fail. – The solution:
You change the executable trigger that should be executed when the condition is true.
The new executable trigger is an F271 flipeffect which will copy the value of the variable we use (it is GSA1 now) into Current Value variable. - So if GSA1=Y is true then F271 will copy Y into Current Value. (So Y will be the new value of Current Value.)
And we also need a new, GT_ALWAYS GlobalTrigger:

- condition of GlobalTrigger: $8000, 255, $W0Z
- executable trigger of GlobalTrigger: the trigger you want to execute originally.

Disable this GlobalTrigger if the death condition isn't important for you any more.

Notes:
- Use C14 if you want to study the death of the enemy by A14 trigger, in 'kill creature' mode.
- The 'usual' death can also be examined in this condition, when Y=4, Z=28.
- In the case of some 'serious' non-living Moveable object (i.e. if the Moveables that are more than simple Animatings) the condition will also work for the ‘remove’ mode of A14 trigger. But the values are a bit chaotic, so I didn't put them into the list. If you want the required Y value, then see the chosen (which is GSA1 now) variable value on the screen with Diagnostics, when this TriggerGroup is in the script, and when that object has just been removed. (Or try that 'general death condition’ above.)
- After some kills performed by A14, Lara is able to aim/shoot at - even the last, empty position of - the 'dead' enemy. (So do not shoot at dead enemies.)
- Don’t remove a non-creature Moveable object by A14/A82 if you don’t activate it before that. (Even if that object doesn’t have animations.) Or else there may be bugs: eg. the object collision will remain there after the disappearance.

Command:
Adjust the actual vitality points of X enemy to Y

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 261, $W0C ; put the number at W0 position of PARAM_BIG_NUMBERS into the vitality (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, Y

Activate an F118 in „single” mode for TriggerGroup#1 to force the required vitality.

Note:
You can adjust the value even before triggering the creature, if you want. In that case the actual vitality point is naturally the same as the maximal vitallity points. (So it is a good method if you want to force a new maximal life points only for a given creature, meanwhile the other creatures of the slot will have the original maximal life points - or they will have the maximal life points forced by an Enemy Script command.)

Command:
Make X enemy invulnerable

Use the previous formula, but this time you need continuous activation. – See above more about continuous activation.
If you stop continuous activation, then the enemy will become vulnerable, with Y vitality points.

Note:
These 'immortal' enemies remain 'aimable'.

Condition:
If the actual vitality points of X enemy is Z equal/less/more than Y

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $C10, > ; put the actual vitality points into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0Z, > ;if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
V
Parameters= PARAM_BIG_NUMBERS, Y, U

See Y values above.

Z values are:
26 – for a “bigger” condition (this time X must be the original X plus 1, so eg. if you want a “bigger than 50” condition, then X is 51)
27 – for a “smaller” condition
28 – for an “equal” condition

V values are:
- if Z=26:
$8000, 16, $W127 ;if GSA1< than the number at W1 position of PARAM_BIG_NUMBERS, W1 (must be typed in hexadecimal format now in the trigger code)is 1 in this example. (Or else the „bigger” condition will be true even if the enemy is still inactive.)
- if Z=27:
$8000, 16, $129 ; if GSA1 >=1. (Or else the „smaller” condition will be true even if the object is already dead.)
- if Z=28: no Y.

U is the maximal vitality points of the enemy.

Note:
Use C29 for Lara for the same reason.

Condition:
If X enemy is just falling into death

This condition is useful eg. when the skeleton is just falling into the pit after Lara having shot that, or the harpy is just falling into the ground after Lara having shot that.

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $2700, > ; * put the actual status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $W028; if GBA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, 43

Condition:
If X enemy has just been hit

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $2700, > ; * put the actual status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $W028; if GBA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, 51

Notes:

- It also works with immortal enemies.
- It works only with bullets, i.e. useless with arrows or grenades. (But you can do something similar with arrows or grenades - see Customize=CUST_AMMO Script command.)
- It works even if the aggressor is not Lara. (See if Troops shoots at a scorpion.) But it doesn't work with direct attacks. (See if the scorpion grabs a Troops.)
- If Lara hits 'accidentally' (i.e. if the player uses 'automatic targeting', but Lara shoots without aiming) that also matters now.

Command:
Poison X enemy

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 261, $W027;** put the number at W0 position of PARAM_BIG_NUMBERS into the poisoned status (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, 291

Activate an F118 in „single” mode for TriggerGroup#1 to poison the enemy.

Notes:
- Force the value only if the creature is active (alive).
- After all, this field means 'decrease the health of the enemy by degrees, but continuously, in a rhythm as if a poisoned arrow had hit him'.

Condition:
If X enemy is poisoned (but still living)

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $2710, > ; * put the actual poisoned status into Global Byte Alfa1 (GSA1) variable
$8000, 16, $W028; if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, 291

---------------------------------------------

*: Be careful! If you use commands with some $...27 triggers (see eg. “poison X enemy”), that may affect the usability of the condition. If you want the condition then you may avoid that command.
**: Be careful! If you use other commands with other $...27 triggers at the same time when you use this command, then one or more of the commands will fail. If you want the command to work, then you may avoid the other commands.

---------------------------------------------


Made using TRNG 1.2.2.7.

Last edited by Titak; 02-06-15 at 20:04.
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:11.


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