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 28-10-17, 14:26   #1
Titak
Moderator
 
Titak's Avatar
 
Joined: Jul 2003
Posts: 33,359
Default TRNG - Re-enable & Disable Pickups

Tutorial made by matrix54



Native to the TRLE is the ability to pickup ammunition after Lara has used all of a particular type up, with the exception of uzi ammo. For years, players have wanted this very ability for all pickups and it's finally arrived! It even works on Uzi ammo!

It's also super simple, red being the the item index you wish to change (which can be grabbed by clicking on the objects in the TRLE). This object will require the OCB code of 128 for this to work in addition to any OCBs for picking it up from a pedestal, a higher pedestal, or activating a trigger.

Code:
; Set Trigger Type - ACTION 54
; Exporting: TRIGGER(54:0) for ACTION(85) {Tomb_NextGeneration}
; <#> : UZI_AMMO_ITEM              ID 85     in sector (9,9) of Room0
; <&> : Variables. Set the index of <#>moveable as Selected Item
; (E) : 
; Values to add in script command: $5000, 85, $36
Code:
; Set Trigger Type - FLIPEFFECT 255
; Exporting: TRIGGER(8231:0) for FLIPEFFECT(255) {Tomb_NextGeneration}
; <#> : Variables. Memory. Set in <&>Selected Item memory the (E)Value
; <&> : Flags of Item (Long)
; (E) : Value     32
; Values to add in script command: $2000, 255, $2027
When put into a trigger group together when scripting:

Code:
TriggerGroup= 1, $5000, 85, $36, $2000, 255, $2027
That's all there is to it! You can trigger the trigger group within the level, or assign it to a global trigger. Since the example uses uzi ammo, you can run a global trigger that checks if Lara is out of uzi ammo, and the game will restore it no problem. Alternatively, you can create some interesting puzzles which requires Lara to use and reacquire spent items.

What value is being changed exactly? These are a selected items’s object flags. Though it is recommended that you don’t experiment with them (since the game will easily crash if you used the wrong values), the codes provided in this tutorial do no harm. I also suggest calculating and assigning prior to using flags to avoid crashes.

Here are the flags:
Code:
1 - NONE // Used to clear flags
2 - ACTIVE // Item is active
4 - CREATURE // Creatures are Invisible until triggers
8 - NOT_VISIBLE // Item was not visible before being active
16 - GRAVITY_AFFECTED // Item is falling or jumping and is subject to the gravity simulation
32 - NOT_YET_ENABLED // Object hasn’t been enabled
64 - KILLED_WITH_EXPLOSION // Added to remember that the enemy was killed with an explosion
128 - POISONED // This object has been poisoned
256 - AI_GUARD // This enemy was over AI_GUARD
512 - AI_AMBUSH // This enemy was over...
1024 - AI_PATROL1 // ...
2048 - AI_MODIFY // ...
4096 - AI_FOLLOW // ...
8192 - THROWN_AMMO // Unsure if used for visible ammo like grenades or arrows
If by chance you wish to disable the objects, here's the alternative to the original input. Just remember to change the item index (again, in red):

Code:
; Set Trigger Type - FLIPEFFECT 255
; Exporting: TRIGGER(9767:0) for FLIPEFFECT(255) {Tomb_NextGeneration}
; <#> : Variables. Memory. Set in <&>Selected Item memory the (E)Value
; <&> : Flags of Item (Long)
; (E) : Value     38
; Values to add in script command: $2000, 255, $2627
Code:
TriggerGroup= 2, $5000, 85, $36, $2000, 255, $2627
Titak is offline  
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 15:43.


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.