View Single Post
Old 04-06-15, 11:14   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,413
Default TRNG – Some customizations for humans

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, Global Byte Beta1) 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:
Adjust the actual ammunition of X Baddy to Y bullets

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

Y: from 0 to 65535 bullets.

Activate an F118 in „single” mode for TriggerGroup#1 to adjust the ammo.

Notes:

- “Baddy” means only Baddy1 and Baddy2 slots in the whole tutorial.
- Each round is 7 bullets. So, 7 bullets will be shot everyway with the last round, even if you can’t divide Y by 7. So, eg. if the baddy starts shooting a round, having 4 bullets, then the round will end at -3 bullets – which works as 0 bullet, naturally.

Command:
Adjust infinite ammunition for X Baddy

Use the previous formula, but this time you need continuous activation. If you stop continuous activation, then the baddy will have Y bullets, which is not infinite any more.
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.

Condition:
If X Baddy has Y exactly/less/more than Z bullets

TriggerGroup= 1, $5000, X, $36, > ; defining the baddy with its X ID code you see in Room Editor
$2000, 256, $1710, > ; put the actual ammo amount into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0Y ;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, Z

Z: from 0 to 65535 bullets.

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

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.

Note:
In the case of “if he has no ammunition” condition, “equal with 0” formula could be a bad idea, because, as I said above, the ammo amount could be even less than 0 if Y can’t be divided by 7. That is why I recommend a “less than 1” formula for that condition.
For the same reason, in the case of “if he has any ammunition” condition, “more/equal than 1” formula could be also a bad idea. However, the best idea now is if you use that formula, but only if Y can be divided by 7.

Don’t use any condition of the tutorial if the creature is not active (because he has not been spawned yet or he is already dead), because the solution will be false perhaps.

Command:
Put out the flaming torch temporarily in X Guide's hand

'Temporarily' means the guide will light it again at once, by himself.

TriggerGroup= 1, $5000, X, $36, > ; defining the guide with its X ID code you see in Room Editor
$2000, 255, $116; force Value 1 for this torch parameter

Activate an F118 in „single” mode for TriggerGroup#1 to put out the torch.

Note:
This command is a good idea eg. if you want to represent this event: „the guide steps into a draughty area, the draught will blow out the torch”.

Condition:
If the torch in X Guide’s hand has Y status

TriggerGroup= 1, $5000, X, $36, > ; defining the guide with its X ID code you see in Room Editor
$2000, 256, $1600, > ; put the actual status amount into Global Byte Alfa1 (GBA1) variable
$8000, 0, $Z2B, > ; if GBA1 is Z
V

Y values are:
- the torch is still not in the hand: Z=0, V is not needed
- he reaches for the torch on the wall to get it: Z=1, V= $9000, X, $1C17 – if the guide performs Animation60
- he has the torch unlit in the hand: Z=1, V= $8000+TGROUP_NOT, 2, $F – if TriggerGroup#2 is not true
TriggerGroup= 2, $9000, X, $1C17, $9000+TGROUP_OR, X, $1E15 – if the guide performs Animation30 or 60
- he gets the lighter and tries to light the torch twice: Z=1, V= $9000, X, $1E15 – if the guide performs Animation30
- the torch catches fire at the second attempt, he puts the lighter away: Z=2, V= $9000, X, $1E15 – if the guide performs Animation30
- he has the torch lit in the hand: Z=2, V= $9000+TGROUP_NOT, X, $1E15 – if the guide doesn’t perform Animation30

Command:
Make X Horseman do patrolling

'Patrolling' means this now: sometimes during the battle with Lara, the horseman decides to ride back to the AI_FOLLOW objects. First to his and then to the one of the horse. So he starts not caring about Lara (now the required value turns into 8227) and rides back. If he reaches the AI_FOLLOW of the horse, then 8227 will change, the patrol ends.

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 patrolling status (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, 8227

Activate an F118 in „single” mode for TriggerGroup#1 to force patrolling.

Note:
Force the value only if the horseman is riding. (So don’t force it for solo horsemen, without horses.)

Condition:
If X Horseman has Y on-horse status

Y - the horseman has not got on the horse yet:

GlobalTrigger= 1, FGT_DISABLED, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE ; enable it when spawning the horseman
TriggerGroup= 1, $5000, X, $36, > ; defining the horseman with its X ID code you see in Room Editor
$2000, 256, $1600, > ; put the actual “on-horse” status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $2B ; if GBA1=0
TriggerGroup= 2, (the trigger that will be executed if Y is true)
GlobalTrigger= 2, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $8000, 0, $12B ; if GBA1=1
TriggerGroup= 4, $2000, 109, $100 ; disable GlobalTrigger1

Y- the horseman is just getting on the horse:

; Set Trigger Type - CONDITION 21
; Exporting: CONDITION(21:34) for OBJECT(X)
; <#> : HORSEMAN ID X
; <&> : Creature. Current animation of <#>creature is (E)animation (0-31)
; (E) : Animation= 14
; Values to add in script command: $9000, X, $E15

Y - the horseman is patrolling:

TriggerGroup= 1, $5000, X, $36, > ; defining the horseman with its X ID code you see in Room Editor
$2000, 256, $2710, > ; * put the actual patrolling status into Global Short Alfa1 (GSA1) variable
$8000, 16, $28, > ; 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
$2000, 256, $1604, > ; put the actual “on-horse” status into Global Byte Beta1 (GBB1) variable
$8000, 4, $12B ; if GBB1 is 1
Parameters= PARAM_BIG_NUMBERS, 8227

Y - the horseman is riding, but not patrolling:

TriggerGroup= 1, $5000, X, $36, > ; defining the horseman with its X ID code you see in Room Editor
$2000, 256, $2710, > ; * put the actual patrolling status into Global Short Alfa1 (GSA1) variable
$8000+TGROUP_NOT, 16, $28, > ; if GSA1 is NOT 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
$2000, 256, $1604, > ; put the actual “on-horse” status into Global Byte Beta1 (GBB1) variable
$8000, 4, $12B, > ; if GBB1 is 1
$9000+TGROUP_NOT, X, $E15 ; if the horseman is not getting on the horse
Parameters= PARAM_BIG_NUMBERS, 8227

Y - the horseman is riding (patrolling or not):

TriggerGroup= 1, $5000, X, $36, > ; defining the horseman with its X ID code you see in Room Editor
$2000, 256, $1600, > ; put the actual “on-horse” status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $12B, > ; if GBA1=1
$9000+TGROUP_NOT, X, $E15 ; if the horseman is not getting on the horse

Y - the horseman is just falling off the horse:

; Set Trigger Type - CONDITION 21
; Exporting: CONDITION(21:56) for OBJECT(X)
; <#> : HORSEMAN ID X
; <&> : Creature. Current animation of <#>creature is (E)animation (0-31)
; (E) : Animation= 3
; Values to add in script command: $9000, X, $315

Y - the horseman has fallen off the horse:

GlobalTrigger= 1, FGT_DISABLED, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE
TriggerGroup= 1, $8000, 0, $2B, > ; if GBA1=0
$9000+TGROUP_NOT, X, $315 ; the horseman is not performing Animation3
TriggerGroup= 2, (the trigger that will be executed if Y is true)
GlobalTrigger= 2, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $5000, X, $36, > ; defining the horseman with its X ID code you see in Room Editor
$2000, 256, $1600, > ; put the actual “on-horse” status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $12B ; if GBA1=1
TriggerGroup= 4, $2000, 109, $101 ; enable GlobalTrigger1

Note:
If Lara starts disturbing the horseman (i.e. shoots after him when he rides to get farther from her to AI_FOLLOW's) then two things are possible:

a, (Usually.) He drops Value 8227, aborting the patrol, and comes back to her.
b, (Rarely.) He comes back to her, not dropping 8227, saying 'It's so rude to disturb me. Now I punish you to learn good manners and then go back patrolling'.

Command:
Disable X Von Croy to turn to Lara when waving

When Von Croy arrives to an AI_FOLLOW, he turns to Lara and starts waving to her. If you disable that that means he starts waving when he arrives there, but won't turn to Lara, keeping the original position in which he reached that AI_FOLLOW.

TriggerGroup= 1, $5000, X, $36, > ; defining Von Croy with its X ID code you see in Room Editor
$2000, 255, $117; force Value 1 for this waving parameter

You need continuous activation (see more about it above). If you stop continuous activation, then he will be able to turn to her again.

Condition:
If X Von Croy is still performing his cutscene-movements after the cutscene

These are not 'usual' cutscenes. We are talking about the 'Angkor Wat type' cutscenes when we could hear Von Croy's advices to Lara. - An example to understand:
Von Croy takes his book from his jacket when he's talking about during the cutscene. Now the player hits the 'Look' key to interrupt the cutscene. Now the condition is true because he will take the book back into his jacket after the interruption.

TriggerGroup= 1, $5000, X, $36, > ; defining Von Croy with its X ID code you see in Room Editor
$2000, 256, $1700, > ; put the actual status amount into Global Byte Alfa1 (GBA1) variable
$8000, 0, $22B ; if GBA1 is 2

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

*: 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.
AkyV is offline