Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 26-09-14, 20:38   #1
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default TRNG – Adjusting/studying a bigger amount of ammo/medipack/flare during the game

Instructions:

1. Copy the setup in your Script.
2. Type the required code instead of Y:

3A – small medipack
3B – big medipack
3C - flare
3D – pistol ammo
3E – Uzi ammo
3F – revolver ammo
40 – normal shotgun ammo
41 – wideshot shotgun ammo
42 – normal grenade
43 – super grenade
44 – flash grenade
45 – normal arrow
46 – poisoned arrow
47 – explosive arrow

3. Type the required amount (X) in the Parameters command. It is 32767 maximally. Type -1 if you want to adjust unlimited amount.
With shotgun ammo, the ammo will be X divided per six. So eg. type 180 if you want 30 shotgun ammo.
4. Build the Script.

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

1. Check TriggerGroup ID’s and change them if you are already using the ID in another TriggerGroup.
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 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 Short Alfa1, Global Long Beta) 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.
4. Build the Script.


Notes:

- It is not the box, clips etc. amount. So eg. 1 in the X for Uzi ammo is not an Uzi clip pair, but it is 1 bullet.
- I intentionally skipped using these commands/condition for puzzle items, because I don’t think you’d like to adjust very much or unlimited amount for a puzzle item in the inventory.

Command:
Adjust X amount of Y ammo/medipack/flare in the inventory


The command is useful, due to more aspects:

- Equipment Script command will adjust ammo/medipack/flare amount only for the start of the first level of the game. So, this command is able to adjust the amount any time later, during the game.
- Equipment Script command is able to adjust only unlimited or maximum a low amount of anything. This command is useful even for a higher amount.
- F50 trigger is not able to adjust bigger amount than 127, any time during the game. And, if you want to adjust eg. 5000 amount, then it is really boring if you can adjust it only using several F50 triggers at the same time, adding 127+127+127+… to the inventory. (However, I recommend more F50 triggers instead of spending your time with this command, if the adjusted amount is not too big.)
- F50 is not able to adjust unlimited amount, any time during the game.

Code:
TriggerGroup= 1, $2000, 262, $Y ;set Value X in the actual amount of Y inventory item
Parameters= PARAM_BIG_NUMBERS, X
Activate an F118 in “single” mode for the TriggerGroup so the required amount will be adjusted.

Command:
Add X amount of Y ammo/medipack/flare to the inventory


The command is useful, because F48 trigger is able to add only 1 amount, any time during the game. And, if you want to add eg. 5000 amount, then it is really boring if you can add it only using several F48 triggers at the same time, adding 1+1+1+… to the inventory. (However, I recommend more F48 triggers instead of spending your time with this command, if the added amount is not too big. Plus, one more thing: F48 are able to work even with showing animation. The command is able to work only in the hidden way.)

Code:
TriggerGroup= 1, $2000, 263, $FF, > ;set Value X in Current Value variable
$2000, 263, $131, > ;set 32768 in Global Long Beta (GLB) variable
$2000, 244, $Y10, > ;copy the actual amount of Y inventory item into Global Short Alfa1 (GSA1) variable
$2000, 285, $10, > ;add GSA1 to Current Value
$8000, 49, $38, > ;if Current Value is >= GLB
$2000, 233, $131, > ;subtract 1 from GLB
$2000, 245, $Y31, > ;copy GLB into the actual amount of Y inventory item
$2000+TGROUP_ELSE, 263, $FF, > ;set Value X in Current Value
$2000, 273, $Y ;add Current Value to the actual amount of Y inventory item
Parameters= PARAM_BIG_NUMBERS, X, 32768
Activate an F118 in “single” mode for the TriggerGroup so the required amount will be added.

Notes:

- The new (aggregated) amount will be 32767 everyway, if the real aggregate of the original inventory amount and the added amount is bigger than 32767. (This maximum is 5461 for shotgun ammo types.)
- You can’t use Current Value variable in the moment in any other setup at the same time, when you execute the command.

Command:
Remove X amount of Y ammo/medipack/flare from the inventory


The command is useful, because F49 trigger is able to remove only 1 amount, any time during the game. And, if you want to remove eg. 5000 amount, then it is really boring if you can remove it only using several F49 triggers at the same time, removing 1+1+1+… from the inventory. (However, I recommend more F49 triggers instead of spending your time with this command, if the removed amount is not too big.)

Code:
TriggerGroup= 1, $2000, 263, $10, > ; set Value X in Global Short Alfa1 (GSA1) variable
$2000, 244, $YFF, > ; copy the actual amount of Y inventory item into Current Value variable
$2000, 286, $10, > ; subtract GSA1 from Current Value
$8000, 255, $2A, > ;if Current Value < 0
$2000, 246, $Y, > ;set Value 0 in the actual amount of Y inventory item
$2000+TGROUP_ELSE, 263, $FF, > ; set Value X in Current Value
$2000, 274, $Y ;subtract Current Value from the actual amount of Y inventory item
Parameters= PARAM_BIG_NUMBERS, X
Activate an F118 in “single” mode for the TriggerGroup so the required amount will be removed.

Notes:

- The item will be totally removed from the inventory, if the result is negative when you subtract the amount from the original inventory amount.
- You can’t use Current Value variable in the moment in any other setup at the same time, when you execute the command.

Condition:
If the amount of Y ammo/medipack/flare in the inventory is Z exactly/less than/more than X


The condition is useful, because C3 is good only for a minimum condition, at most with 31 amount. Plus, C4 is good only for a maximum condition, at most with 31 amount. If you combine them (exported in a TriggerGroup: “at least X plus less than X+1” together means “exactly X”), then they are useful for an “exactly” case, but X can’t be bigger than 30 now.

Code:
Code:
TriggerGroup= 1, $2000, 244, $YFF, > ;copy the actual amount of Y inventory item into Current Value variable
$2000, 263, $10, > ; set Value X in Global Short Alfa1 (GSA1) variable
$8000, 16, $Z ;if Current Value is =/</> GSA1
Parameters= PARAM_BIG_NUMBERS, X
Z is 39 for an “equal with” condition. But type 3A for a “less than” condition and 38 for a “more than” condition.
If you choose 38 then add 1 to the value you originally wanted for X. So eg. if you want a “bigger than 50” condition, then X must be 51.

The easiest solutions to use the condition:
- 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; 11-12-16 at 23:43.
AkyV is online now  
Closed Thread

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 09:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.