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 24-07-14, 16:37   #1
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default TRNG - Sprinkler

Sprinkler is a thing I'd like to recommend.

I mean, Sprinkler is a nice effect , but underrated because usually you can't control it. Usually this is what a sprinkler object will do:

1. Activate it with a trigger.
2. Then water starts showering for 20 seconds (600 tick frames, from 0 to 600 frames).
3. Then water is dripping for further 20 seconds (600 tick frames, from 601 to 1200 frames).
4. Then you can't reactivate it.

But, for example, if you want a shower for your house level when Lara turns on/off the shower (the sprinkler) many times, then you need to activate the sprinkler, then to activate a TriggerGroup.
Or, what if you use sprinklers, to fill a big pool, producing a given time of showering, instead of using waterfall objects?

TriggerGroup= 1, A54, F263, F257

A54: define the object.
F263: adjust a PARAM_BIG_NUMBERS value in a “short” variable.
F257: force the value of that variable into “Custom_A (Different usage in according with type of item) (Short)” Item Memory Zone field.

Code:
For example:

TriggerGroup= 1, $5000, 101, $36, $2000, 263, $50, $2000, 257, $1550
Parameters= PARAM_BIG_NUMBERS, 540

; Set Trigger Type - ACTION 54
; Exporting: TRIGGER(54:0) for ACTION(101)
; <#> : SPRINKLER              ID 101     in sector (11,14) of Room5
; <&> : Variables. Set the index of <#>moveable as Selected Item
; (E) : 
; Values to add in script command: $5000, 101, $36

; Set Trigger Type - FLIPEFFECT 263
; Exporting: TRIGGER(80:0) for FLIPEFFECT(263)
; <#> : Variables. Numeric. Set in <&>Numeric Variable the (E)Big Number value
; <&> : Local Short Alfa1
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=     0
; Values to add in script command: $2000, 263, $50

; Set Trigger Type - FLIPEFFECT 257
; Exporting: TRIGGER(5456:0) for FLIPEFFECT(257)
; <#> : Variables. Memory. Copy from <&>Numeric Variable to (E)Selected Item Memory
; <&> : Local Short Alfa1
; (E) : Custom_A (Different usage in according with type of item) (Short)
; Values to add in script command: $2000, 257, $1550
Some examples, how to use it:

- Start an Organizer (F127). It will start the sprinkler right away (A43). After 6 seconds (180 frames) the Organizer will activate the TriggerGroup I said, to adjust the timer from 6 seconds to 18 seconds (540 frames). The sprinkler will stop showering at 20 seconds (600 frames), as usual, and it will start dripping.
So it was showering only for 8 seconds (from 0 to 180 frames, and then 540 to 600 frames), instead of 20 seconds.
PARAM_BIG_NUMBERS was 540 now.

- Lara will activate the sprinkler with a trigger. Some seconds later, she activates that TriggerGroup, with a "continuous" F118. It will adjust the timer to 18 seconds (540 frames). The sprinkler will start performing a continuous showering.
If you stop the "continuous" effect of that F118 with an F192, then the shower will stop after 2 seconds (600-540= 60 frames= 2 seconds), as usual, to start dripping.
PARAM_BIG_NUMBERS was 540 now.

- Activate the TriggerGroup with a "single" F118, when PARAM_BIG_NUMBERS is 480. Then, activate the sprinkler. The timer will start from 480 now, not 0, so it will shower only for 4 seconds (600-480= 120 frames= 4 seconds), before it will start dripping.

- Activate the sprinkler. When the timer reached 1200 then the sprinkler stopped. But if you now activate that TriggerGroup, with a "single" F118, when PARAM_BIG_NUMBERS is 1000, then sprinkler will start again – only to drip for 200 frames (1200-1000=200).

- If the timer is at 900 (30 seconds) then an Organizer will activate that TriggerGroup, when PARAM_BIG_NUMBERS is 420. So after 10 seconds dripping (900-600=300 frames= 10 seconds) the sprinkler starts showering again for 6 seconds (600-420=180 frames= 6 seconds) before it will start dripping again.

Notes:

- You can find the original Sprinkler object in the WAD of "Chambers of Tulun".
- You can move/rotate the sprinkler with ACTION triggers or Parameters Script commands, even when the sprinkler is just working.
But don't rotate it around a horizontal axis, because the water effect won't follow the new position of the sprinkler.


- If you want to study if the sprinkler is at a given point (tick frame) of the life cycle or not, then use this TriggerGroup:

TriggerGroup= 2, A54, F256, C40

A54: define the object.
F256: copy the value of “Custom_A (Different usage in according with type of item) (Short)” Item Memory Zone field into a „short” variable.
C40: study if the value (tick frame) in PARAM_BIG_NUMBERS is equals with the variable value.

The easiest solutions to use the conditions:
- 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.

(You can use even „bigger” or „smaller” conditions, if you want, but don’t forget: we need to be careful with the “less” condition, because 0 is less than any value, so the condition will also be true if the sprinkler has not started yet. That is why you also need a “>=1” condition in the TriggerGroup now.)

Last edited by Titak; 14-01-15 at 16:06. Reason: Additional info added.
AkyV 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 14:12.


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.