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 09-06-12, 14:34   #1
Laras Boyfr.
Professor
 
Laras Boyfr.'s Avatar
 
Join Date: Jul 2009
Location: Albania
Posts: 4,744
Lightbulb TRNG: Single Pistol & Single Uzi

Laras Boyfriendís
TRLE
Tutorials

TRNG: Single Pistol & Single Uzi


Introduction:

You guys always complained about how you couldnít turn the dual pistols and uzis into single guns in TRNG as you could in TREP.
Well I might have a good surprise for you there

Its indeed possible also in TRNG with some circumventing
You know the best inventions are discovered by accident so as this one I was testing my level one day and I was making the PISTOL_AMMO limited for gameplay reasons.
I was shooting randomly in my level when I asked myself, what would happen when Lara has only 1 bullet left, would she still shoot with both guns?

This wasnít the case luckily. She shot only with the right gun ( the same as for the revolver animations).
So suddenly I thought about this and this idea popped in my head.
Now 3 days later I finally finished the script. Many bugs,accidents and coffees were involved here xD
But with the help of some friends I did it ( the script is simple but I tried many other ones which seemed logical,didnít work ingame though)


What you will achieve at the end of this tutorial:

- Youíll be able to turn the Dual Pistols into a single pistol like the revolver is, just with unlimited ammunition.
- Youíll be able to turn the Uzis into a single uzi, just with unlimited ammunition.

What you need for this setup:



-TRNG (version 1.2.2.6 is strongly suggested)
- PISTOLS and UZIS with single meshes and animations.
You can find a good base here in this outfit from Horus Goddess:




- The script commands you will learn more about here


How to do it:

Firstly, you need to add the PISTOL stuff and/or the UZI stuff ( depends what you want to use) to your level wad with WADMerger.
If you wish you can change the strings and the names of the ammo and weapon then.

Go to your level script block then.
You will need to insert the script, which you can get from here:
_____________________________________________
Single Pistol
_____________________________________________

GlobalTrigger=1,IGNORE,GT_CONDITION_GROUP,IGNORE,1,2,IGNORE
TriggerGroup=1,$8000, 8, $30D,$8000, 1, $23 ;if player presses Action,if Lara is holding Pistols

; Set Trigger Type - CONDITION 13
; Exporting: CONDITION(13:56) for PARAMETER(8)
; <#> : Action (engage)
; <&> : Keyboard. <#>Command game is currently (E)
; (E) : ACTIVE (Multi shot for positive condition)
; Values to add in script command: $8000, 8, $30D

; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:58) for PARAMETER(1)
; <#> : Holding_Pistols
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) :
; Values to add in script command: $8000, 1, $23

TriggerGroup=2,$2000, 246, $13D ;set Pistol Ammo to 1

; Set Trigger Type - FLIPEFFECT 246
; Exporting: TRIGGER(317:58) for FLIPEFFECT(246)
; <#> : Variables. Memory. Set in <&>Savegame Memory the (E)Value
; <&> : Inventory. Ammo Pistol (Short)
; (E) : Value 1
; Values to add in script command: $2000, 246, $13D

GlobalTrigger=2,FGT_SINGLE_SHOT_RESUMED,GT_CONDITION_GROUP,IGNORE ,3,4,IGNORE
TriggerGroup=3,$8000, 8, $20D,$8000, 1, $23 ;if player doesnt press Action,if Lara is holding Pistols

; Set Trigger Type - CONDITION 13
; Exporting: CONDITION(13:58) for PARAMETER(8)
; <#> : Action (engage)
; <&> : Keyboard. <#>Command game is currently (E)
; (E) : INACTIVE (Multi shot for positive condition)
; Values to add in script command: $8000, 8, $20D

; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:58) for PARAMETER(1)
; <#> : Holding_Pistols
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) :
; Values to add in script command: $8000, 1, $23

TriggerGroup=4,$2000, 254, $7F3D ;set Pistol Ammo to -1 (unlimited)

; Set Trigger Type - FLIPEFFECT 254
; Exporting: TRIGGER(32573:58) for FLIPEFFECT(254)
; <#> : Variables. Memory. Set in <&>Savegame Memory the (E)Negative Value
; <&> : Inventory. Ammo Pistol (Short)
; (E) : Value -1
; Values to add in script command: $2000, 254, $7F3D
_____________________________________________
Single Uzi
_____________________________________________

GlobalTrigger=1,IGNORE,GT_CONDITION_GROUP,IGNORE,1,2,IGNORE

TriggerGroup=1,$8000, 8, $30D,$8000, 3, $23 ;if player presses Action,if Lara is holding Uzis

; Set Trigger Type - CONDITION 13
; Exporting: CONDITION(13:56) for PARAMETER(8)
; <#> : Action (engage)
; <&> : Keyboard. <#>Command game is currently (E)
; (E) : ACTIVE (Multi shot for positive condition)
; Values to add in script command: $8000, 8, $30D

; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:58) for PARAMETER(3)
; <#> : Holding_Uzi
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) :
; Values to add in script command: $8000, 3, $23

TriggerGroup=2,$2000, 246, $13E;set Uzi Ammo to 1

; Set Trigger Type - FLIPEFFECT 246
; Exporting: TRIGGER(318:58) for FLIPEFFECT(246)
; <#> : Variables. Memory. Set in <&>Savegame Memory the (E)Value
; <&> : Inventory. Ammo UZI (Short)
; (E) : Value 1
; Values to add in script command: $2000, 246, $13E

GlobalTrigger=2,FGT_SINGLE_SHOT_RESUMED,GT_CONDITION_GROUP,IGNORE ,3,4,IGNORE
TriggerGroup=3,$8000, 8, $20D,$8000, 3, $23 ;if player doesnt press Action,if Lara is holding Uzis

; Set Trigger Type - CONDITION 13
; Exporting: CONDITION(13:58) for PARAMETER(8)
; <#> : Action (engage)
; <&> : Keyboard. <#>Command game is currently (E)
; (E) : INACTIVE (Multi shot for positive condition)
; Values to add in script command: $8000, 8, $20D

; Set Trigger Type - CONDITION 35
; Exporting: CONDITION(35:58) for PARAMETER(3)
; <#> : Holding_Uzi
; <&> : Lara. (Holds) Lara is holding/driving the <#>item
; (E) :
; Values to add in script command: $8000, 3, $23

TriggerGroup=4,$2000, 254, $7F3E ;set Uzi Ammo to -1 (unlimited)

; Set Trigger Type - FLIPEFFECT 254
; Exporting: TRIGGER(32574:58) for FLIPEFFECT(254)
; <#> : Variables. Memory. Set in <&>Savegame Memory the (E)Negative Value
; <&> : Inventory. Ammo UZI (Short)
; (E) : Value -1
; Values to add in script command: $2000, 254, $7F3E

So basically the script for the Pistol is:

GlobalTrigger=1,IGNORE,GT_CONDITION_GROUP,IGNORE,1,2,IGNORE
TriggerGroup=1,$8000, 8, $30D,$8000, 1, $23 ;if player presses Action,if Lara is holding Pistols
TriggerGroup=2,$2000, 246, $13D ;set Pistol Ammo to 1

GlobalTrigger=2,FGT_SINGLE_SHOT_RESUMED,GT_CONDITION_GROUP,IGNORE ,3,4,IGNORE
TriggerGroup=3,$8000, 8, $20D,$8000, 1, $23 ;if player doesnt press Action,if Lara is holding Pistols
TriggerGroup=4,$2000, 254, $7F3D ;set Pistol Ammo to -1 (unlimited)

And the one for the Uzi is:

GlobalTrigger=1,IGNORE,GT_CONDITION_GROUP,IGNORE,1,2,IGNORE
TriggerGroup=1,$8000, 8, $30D,$8000, 3, $23 ;if player presses Action,if Lara is holding Uzis
TriggerGroup=2,$2000, 246, $13E;set Uzi Ammo to 1

GlobalTrigger=2,FGT_SINGLE_SHOT_RESUMED,GT_CONDITION_GROUP,IGNORE ,3,4,IGNORE
TriggerGroup=3,$8000, 8, $20D,$8000, 3, $23 ;if player doesnt press Action,if Lara is holding Uzis
TriggerGroup=4,$2000, 254, $7F3E ;set Uzi Ammo to -1 (unlimited)


Note: Red indicates the TriggerGroup IDs and Blue the GlobalTriggerIDs. You should change them accordingly to your existing IDs in your level

The reason for putting again -1 as ammo is that when you open the inventory it is a bit weird when you see that the weapon has only 1 bullet left when itís is practically unlimited.

Results:

Now Lara can shoot with only one gun when you use the Pistol and/or Uzi! Great isnít it?
Here are some screenshots:







Bugs & Limitations:

- As the engine shoots only from one pistol when there is exactly 1 bullet left, the weapon will practically have unlimited ammo, as otherwise it wonít be possible to shoot from just one gun.
- Due to the limitation of the TRNG conditions; if the player has drawn the single gun and he keeps pressing ďActionĒ while opening the inventory, the string of the ammo wonít be updated and will stay ď 1x Pistol AmmoĒ for example.
This is just a rare case though and occurs practically not in a normal game flow.

Suggestions:

- You can theoretically make the gun ammo limited. You can script a custom bar with some variable together with some timed conditions that when Lara is shooting with that gun.
It might need some work, but it is possible. ( For example, to make an energy bar for electrical weapons like K2 Impactor)
-You should make use of the CUST_WEAPON and CUST_AMMO script commands to get full use of these features.

Credits:

-Thanks to AkyV,HURLEYstickmen,AODfan and julien for the TRNG help with this feature!
-Thanks to Horus Goddess and !Lara Croft! for the single Pistol and Uzi and their animations!
- Screenshots and testing by AODfan, thank you again!


If you use this please credit me.
Also if you use the items Iíve linked too credit please Horus Goddess and !Lara Croft!


Please don't reply to this thread. If you have questions contact me or ask in a new thread in the appropriate section


© 2012 Laras Boyfriend

Last edited by Laras Boyfr.; 09-06-12 at 14:59.
Laras Boyfr. is offline  
Old 09-06-12, 14:35   #2
Laras Boyfr.
Professor
 
Laras Boyfr.'s Avatar
 
Join Date: Jul 2009
Location: Albania
Posts: 4,744
Default

Here you can download the offline document as a .pdf file for easy viewing

TRNG: Single Pistol & Single Uzi PDF Tutorial
Laras Boyfr. 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 22:36.


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