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 24-11-17, 18:46   #1
AODfan
Archaeologist
 
AODfan's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 1,479
Default TRNG - Dual Magnums

The goal of this tutorial is to show you how to set up believable dual Magnums in TRNG.
Since we are using the Revolver slot to achieve this, the game will still treat is as one weapon, so Lara will always aim at every enemy with both of her guns, instead of just one, even if the enemy is to the left or right of her.
Check out the video if you want to see how it looks in-game:



Before we start, go ahead and download the Magnums WAD.
First we're gonna set up the Magnums with the CUST_WEAPON and CUST_AMMO commands.

Code:
Customize=	CUST_WEAPON, SIXSHOOTER_ITEM, IGNORE, IGNORE, 9, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, 1456, IGNORE, IGNORE, 4, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE
Customize=	CUST_AMMO, SIXSHOOTER_AMMO_ITEM, IGNORE, 4, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE
I set everything to the Pistols values since the Magnums are essentially just stronger Pistols.
FramesForRecharge determines the fire rate. The Revolver is a bit slower so we made it as fast as the Pistols.
I'm not sure what Random and FrameCounter actually do but I set them to the same values as the Pistols.
In the CUST_AMMO command we set Damage to 4. The magnums actually only do half that damage but since we technically only have 1 weapon instead of 2, we double the damage.

Now we get to the interesting part. We set up the animations but if you check the magnums in-game now, you'll see that she actually only has one of them in her hands. So how do we force her to take the other one out as well?

We set up a simple condition. First we copy the currently selected weapon to Global Short Alfa1 and check if it's 2 because that's the Revolver/our Magnums.

Code:
; Set Trigger Type - FLIPEFFECT 244
; Exporting: TRIGGER(1808:0) for FLIPEFFECT(244) {Tomb_NextGeneration}
; <#> : Variables. Memory. Copy to <&>Numeric Variable the (E)Savegame Memory value
; <&> : Global Short Alfa1
; (E) : Lara. Current Weapon (not necessarly in the hand) (Short)
; Values to add in script command: $2000, 244, $710

; Set Trigger Type - CONDITION 43
; Exporting: CONDITION(43:58) for PARAMETER(16) {Tomb_NextGeneration}
; <#> : Global Short Alfa1
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : Value=     2
; Values to add in script command: $8000, 16, $22B
Then we set up another TriggerGroup. First we check if the sound effect for drawing your guns is playing. If that's true, we swap Lara's left hand with the Magnum. If the sound effect for holstering the guns is playing instead, we swap the Magnum for Lara's left hand.

Code:
; Set Trigger Type - CONDITION 85
; Exporting: CONDITION(85:0) for PARAMETER(6) {Tomb_NextGeneration}
; <#> : LARA_DRAW                    6  Ok       hols_out
; <&> : Sound. The <#>Sfx Sound effect is playing
; (E) : 
; Values to add in script command: $8000, 6, $55

; Set Trigger Type - FLIPEFFECT 100
; Exporting: TRIGGER(1549:0) for FLIPEFFECT(100) {Tomb_NextGeneration}
; <#> : Lara. (Mesh) Set single <&>Lara mesh with mesh got from (E)slot
; <&> :  Lara Left Hand
; (E) : SLOT   6  SIXSHOOTER_ANIM
; Values to add in script command: $2000, 100, $60D

; Set Trigger Type - CONDITION 85
; Exporting: CONDITION(85:0) for PARAMETER(7) {Tomb_NextGeneration}
; <#> : LARA_HOLSTER                 7  Ok       hols_in
; <&> : Sound. The <#>Sfx Sound effect is playing
; (E) : 
; Values to add in script command: $8000, 7, $55

; Set Trigger Type - FLIPEFFECT 100
; Exporting: TRIGGER(13:0) for FLIPEFFECT(100) {Tomb_NextGeneration}
; <#> : Lara. (Mesh) Set single <&>Lara mesh with mesh got from (E)slot
; <&> :  Lara Left Hand
; (E) : SLOT   0  LARA
; Values to add in script command: $2000, 100, $D
Code:
GlobalTrigger=	1, IGNORE, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE
TriggerGroup=	1, $2000, 244, $710, $8000, 16, $22B
TriggerGroup=	2, $8000, 6, $55, $2000, 100, $60D, $8000 + TGROUP_ELSE, 7, $55, $2000, 100, $D
Now that Lara has both of the Magnums in her hands, we still need to figure out how to make the left gun "shoot".
We set up another GlobalTrigger. This time we check if Lara is currently holding the Magnums.

Code:
; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:58) for PARAMETER(2) {Tomb_NextGeneration}
; <#> : Holding_Revolver
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) : 
; Values to add in script command: $8000, 2, $23
Next we set up another TriggerGroup. The first thing we do is copy the current frame of the weapon animation to Global Short Alfa2. This will help us find the right moment to trigger the gun flash. The gun flash should appear on frame 29, so we check if GSA2 is 29. If that's true, we trigger the gun flash and remove 1 Magnum bullet from the inventory, so 2 bullets are removed each time you shoot instead of just one.

Code:
; Set Trigger Type - FLIPEFFECT 244
; Exporting: TRIGGER(22545:4) for FLIPEFFECT(244) {Tomb_NextGeneration}
; <#> : Variables. Memory. Copy to <&>Numeric Variable the (E)Savegame Memory value
; <&> : Global Short Alfa2
; (E) : WeaponAnim. Current frame of weapon animation (Short)
; Values to add in script command: $2000, 244, $5811

; Set Trigger Type - CONDITION 43
; Exporting: CONDITION(43:4) for PARAMETER(17) {Tomb_NextGeneration}
; <#> : Global Short Alfa2
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : Value=    29
; Values to add in script command: $8000, 17, $1D2B

; Set Trigger Type - FLIPEFFECT 17
; Exporting: TRIGGER(0:4) for FLIPEFFECT(17) {Tomb_NextGeneration}
; <#> : OldFlip. Creates left gun constant flare
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : 
; Values to add in script command: $2000, 17, $0

; Set Trigger Type - FLIPEFFECT 250
; Exporting: TRIGGER(319:4) for FLIPEFFECT(250) {Tomb_NextGeneration}
; <#> : Variables. Memory. Subtract to <&>Savegame Memory the (E)Value
; <&> : Inventory. Ammo revolver (Short)
; (E) : Value      1
; Values to add in script command: $2000, 250, $13F
Code:
GlobalTrigger=	2, IGNORE, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup=	3, $8000, 2, $23
TriggerGroup=	4, $2000, 244, $5811, $8000, 17, $1D2B, $2000, 17, $0, $2000, 250, $13F
One last thing we need to do is add the gun smoke. This can be done with an AddEffect. We could attach it to Lara's left hand but unfortunately AddEffects ignore weapon animations. So if you're standing still while firing, the smoke would appear where Lara's hand would be if you didn't have your guns drawn. We could simply move it up a bit to where it should be but if you start running, the smoke will start moving, too, because it's attached to Lara's running hand, not the gun!
None of Lara's body parts are ever completely still but Lara's hips seem to move the least so I attached the smoke to her hips.

Code:
AddEffect=		1, ADD_SMOKE, FADD_CONTINUE_EMIT, 0, -75, -300, 300, IGNORE, IGNORE, IGNORE
Now we just have to set up one last GlobalTrigger and we're done. We simply check if Lara is holding the Magnums and the Magnum shooting sound effect is playing and then add / remove the smoke if the condition is / isn't met.

Code:
; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:0) for PARAMETER(2) {Tomb_NextGeneration}
; <#> : Holding_Revolver
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) : 
; Values to add in script command: $8000, 2, $23

; Set Trigger Type - CONDITION 85
; Exporting: CONDITION(85:0) for PARAMETER(121) {Tomb_NextGeneration}
; <#> : DESSERT_EAGLE_FIRE         121  Ok       d_eagle
; <&> : Sound. The <#>Sfx Sound effect is playing
; (E) : 
; Values to add in script command: $8000, 121, $55

; Set Trigger Type - ACTION 48
; Exporting: TRIGGER(304:0) for ACTION(4) {Tomb_NextGeneration}
; <#> : LARA                       ID 4      in sector (6,12) of Room4
; <&> : Effect. Add to <#>Enemy the (E)AddEffect from script.txt
; (E) : AddEffect=     1
; Values to add in script command: $5000, 4, $130

; Set Trigger Type - ACTION 49
; Exporting: TRIGGER(305:0) for ACTION(4) {Tomb_NextGeneration}
; <#> : LARA                       ID 4      in sector (6,12) of Room4
; <&> : Effect. Remove from <#>Enemy the (E)AddEffect from script.txt
; (E) : AddEffect=     1
; Values to add in script command: $5000, 4, $131
Keep in mind that you have to replace the 4 with your Lara item ID. You can find it by clicking on LARA in your map. The number will be displayed in a yellow box.

Code:
AddEffect=	1, ADD_SMOKE, FADD_CONTINUE_EMIT, 0, -75, -300, 300, IGNORE, IGNORE, IGNORE
GlobalTrigger=	3, IGNORE, GT_CONDITION_GROUP, IGNORE, 5, 6, 7
TriggerGroup=	5, $8000, 2, $23, $8000, 121, $55
TriggerGroup=	6, $5000, 4, $130
TriggerGroup=	7, $5000, 4, $131
And that's it! You should now have working dual Magnums in your game.
AODfan 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 21:21.


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