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 19-08-16, 23:24   #1
matrix54
Tomb Raider
 
matrix54's Avatar
 
Join Date: May 2007
Location: N/A
Posts: 19,449
Default TRNG - Shared Ammunition

I'm sure that at some point you may have wondered if it's possible to have different weapons share the same ammunition. Well, even if you haven't, it's completely possible!

At a base level, you'll want to the tell the game to have your root ammo (in this case, pistol ammo) tell another kind of ammo (uzi ammo) that the two are equal. We do this by storing the pistol ammo (from the save game memory) and to the current value variable, then taking that variable and sending it to the uzi ammo (again, in the same game memory).

Code:
TriggerGroup= 1, $2000, 244, $3DFF, $2000, 245, $3EFF
Secondly, when the other weapon is drawn (Uzis), you'll want to have the game update the original pistol ammo as well. The same is done by inverting the value: sending uzi ammo to the current value variable, and and then to the pistol ammo, which looks like this:

Code:
TriggerGroup= 2, $2000, 244, $3EFF, $2000, 245, $3DFF
Code:
TriggerGroup= 3, $8000, 3, $23
So, when everything is put together in a Global Trigger...

Code:
GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 2, 1
What this tells the game is:
  • If Lara is holding Uzis, tell the game to make Uzi ammo equal to Pistols Ammo.
  • If she's not holding Uzi, tell the game to make Pistol ammo equal to Uzis.

Note:
If you don't want to having Pistols and Uzi, you can actually swap out weapons ammo types and join anything other types together. Here's a list of values which replace the underlined values:

Trigger groups 1 and 2:
Code:
3D: Pistol Ammo
3E: Uzi Ammo
3F: Revolver Ammo
40: Normal Shotgun Ammo
41: Wideshot Shotgun Ammo
42: Normal Grenade Ammo
43: Super Grenade Ammo
44: Flash Grenade Ammo
45: Normal Crossbow Ammo
46: Poison Crossbow Ammo
47: Explosive Crossbow Ammo
TriggerGroup 3:
Code:
1: Pistols
2: Revolver
3: Uzis
4: Shotgun
5: Grenade Gun
6: Crossbow
From now on, every time Lara picks up one ammunition type, it'll automatically update for the other weapon. If you want to actually display matching ammo types, I recommend viewing Julien's Diary + Load + Save in one item tutorial. For now, I can tell you that in order to display matching ammo types, you'll need to have the Uzi item pushed into code memory, and give the inventory flag a PARAM_BIG_NUMBER value of 522.

Hope this helps!

*Also, keep in mind it's possible to make ammo types of different guns equal one another. For example, if you want to have normal crossbow ammo and parts to make a crossbow explosive or poisonous and with every shot of special ammo, Lara loses a normal crossbow bolt, that's possible, with a bit more complex. That will required additional testing on my behalf!
__________________
Check out "Checkout: Journey to Employee of the Month!"

Last edited by matrix54; 20-08-16 at 00:47.
matrix54 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 15:34.


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