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 20-04-14, 14:00   #1
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,593
Default TRNG - change the amount of time Lara can stay underwater

TRNG - Change the amount of time Lara can stay underwater.

Tutorial by AkyV



1.
Reducing the amount of time: Lara runs out of air faster


Lara's air is enough for 1 minute=60 seconds=1800 frames.
"Lara. Air for Lara (0 - 1800) (Short)" Savegame Memory Zone field contains that 1800.
So it changes 1 unit at each frame= 1800, 1799, 1798, 1797 etc.
For example, you want the air to be enough only for a half minute=30 seconds=900 frames.
That is why that will be your sequence=1800, 1798, 1796, 1794 etc.
So it should be:
1800 when usually 1800
1798 when usually 1799
1796 when usually 1798
1794 when usually 1797
etc.
So we need a GlobalTrigger when Lara is under water:
Code:
GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $2000, 244, $A50
GlobalTrigger= 2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $8000, 2, $105, $8000, 1, $10
TriggerGroup= 4, $2000, 127, $1
Organizer= 1, FO_TICK_TIME+FO_LOOP, IGNORE, 1, 5
TriggerGroup= 5, $2000, 233, $150, $2000, 245, $A50
MultEnvCondition= 1, ENV_ROOM_IS, ROOM_WATER, IGNORE
GlobalTrigger= 3, IGNORE, GT_CONDITION_GROUP, IGNORE, 6, 7, IGNORE
TriggerGroup= 6, $8000, 80, $12A, $8000+TGROUP_OR, 2, $5
TriggerGroup= 7, $2000, 128, $1
; Set Trigger Type - FLIPEFFECT 244
; Exporting: TRIGGER(2640:62) for FLIPEFFECT(244)
; <#> : Variables. Memory. Copy to <&>Numeric Variable the (E)Savegame Memory value
; <&> : Local Short Alfa1
; (E) : Lara. Air for Lara (0 - 1800) (Short)
; Values to add in script command: $2000, 244, $A50

TG1 will always put Lara's actual air into LSA1 variable.

; Set Trigger Type - CONDITION 5
; Exporting: CONDITION(5:60) for PARAMETER(2)
; <#> : Floating on water
; <&> : Lara. (Status) Lara is performing <#>action is (E)
; (E) : FALSE (Lara is NOT performing #action)
; Values to add in script command: $8000, 2, $105

; Set Trigger Type - CONDITION 16
; Exporting: CONDITION(16:62) for PARAMETER(1)
; <#> : MultEnvCondition= 1
; <&> : Multiple condition of <#>MultEnvCondition script command in (E)way
; (E) : In AND way. (All ENV conditions have to be true)
; Values to add in script command: $8000, 1, $10

GT2 will start TG4 each time if Lara is in water room (see MultEnvCondition1), but not floating. („Each time”: FGT_SINGLE_SHOT_RESUMED.) – „If Lara is under water” is a bad condition, because it contains only the swimming movements. But eg. if Lara falls into the water, then in the first moments she performs the falling animation.

; Set Trigger Type - FLIPEFFECT 127
; Exporting: TRIGGER(1:62) for FLIPEFFECT(127)
; <#> : Organizer. Enable <&>Organizer
; <&> : Organizer= 1
; (E) :
; Values to add in script command: $2000, 127, $1

TG4 will start Organizer1.

Organizer1 works in frames (FO_TICK_TIME), not seconds, in loop mode (FO_LOOP). So the Organizer will perform TG5 in each frame (1, 5).

; Set Trigger Type - FLIPEFFECT 233
; Exporting: TRIGGER(336:62) for FLIPEFFECT(233)
; <#> : Variables. Numeric. Substract from <&>Variable the (E)value
; <&> : Local Short Alfa1
; (E) : Value 1
; Values to add in script command: $2000, 233, $150

; Set Trigger Type - FLIPEFFECT 245
; Exporting: TRIGGER(2640:62) for FLIPEFFECT(245)
; <#> : Variables. Memory. Copy from <&>Numeric Variable to (E)Savegame Memory
; <&> : Local Short Alfa1
; (E) : Lara. Air for Lara (0 - 1800) (Short)
; Values to add in script command: $2000, 245, $A50

TG5 will subtract 1 from LSA1 then forces it into Lara’s air field.
For example:
TG1 puts air value (1000) into LSA1.
In the next moment (frame), air value (changing one frame by frame continuously by itself) is 999. In that moment TG5 subtract 1, so the air value will be 998.
In the next moment (frame), air value (changing one frame by frame continuously by itself) is 997. In that moment TG5 subtract 1, so the air value will be 996.
Etc.

; Set Trigger Type - CONDITION 42
; Exporting: CONDITION(42:60) for PARAMETER(80)
; <#> : Local Short Alfa1
; <&> : Variables. The <#>Numeric Variable is < than (E)Value
; (E) : Value= 1
; Values to add in script command: $8000, 80, $12A

; Set Trigger Type - CONDITION 5
; Exporting: CONDITION(5:62) for PARAMETER(2)
; <#> : Floating on water
; <&> : Lara. (Status) Lara is performing <#>action is (E)
; (E) : TRUE (Lara is performing #action)
; Values to add in script command: $8000, 2, $5

; Set Trigger Type - FLIPEFFECT 128
; Exporting: TRIGGER(1:60) for FLIPEFFECT(128)
; <#> : Organizer. Stop <&>Organizer
; <&> : Organizer= 1
; (E) :
; Values to add in script command: $2000, 128, $1

If the air value is less than one, or if Lara is floating, having come on the water surface, than GT3 will stop Organizer1.
(“Less than one” is better condition than “equals with 0", if the value in LSA1 is 1, and the value you subtract, if you change this setup, is bigger than one, eg. 3, because 1-3= -2.)
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 24-04-14 at 12:49.
Titak is offline  
Old 20-04-14, 22:28   #2
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,593
Default

2.
Increasing the time: Lara runs out of air slower


For example, you want the air to be enough for two minutes=120 seconds=3600 frames.
That is why that will be your sequence=1800, 1800, 1799, 1799, 1798, 1798 etc.

So it will change in each 2nd frame, because the time is twice longer now.

So it should be:
1800 when usually 1800
1800 when usually 1799
1799 when usually 1798
1799 when usually 1797
1798 when usually 1796
1798 when usually 1795
1797 when usually 1794
etc.

GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $2000, 244, $A50
GlobalTrigger= 2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $8000, 2, $105, $8000, 1, $10
TriggerGroup= 4, $2000, 127, $1
Organizer= 1, FO_TICK_TIME+FO_LOOP, IGNORE, 2, 5
TriggerGroup= 5, $2000, 231, $150, $2000, 245, $A50
MultEnvCondition= 1, ENV_ROOM_IS, ROOM_WATER, IGNORE
GlobalTrigger= 3, IGNORE, GT_CONDITION_GROUP, IGNORE, 6, 7, IGNORE
TriggerGroup= 6, $8000, 80, $12A, $8000+TGROUP_OR, 2, $5
TriggerGroup= 7, $2000, 128, $1

See the explanation above. Only the red part is new.
TG4 will start Organizer1.


Organizer1 works in frames (FO_TICK_TIME), not seconds, in loop mode (FO_LOOP). So the Organizer will perform TG5 in each second frame (2, 5).

; Set Trigger Type - FLIPEFFECT 231
; Exporting: TRIGGER(336:0) for FLIPEFFECT(231)
; <#> : Variables. Numeric. Add to <&>Variable the (E)value
; <&> : Local Short Alfa1
; (E) : Value 1
; Values to add in script command: $2000, 231, $150

; Set Trigger Type - FLIPEFFECT 245
; Exporting: TRIGGER(2640:62) for FLIPEFFECT(245)
; <#> : Variables. Memory. Copy from <&>Numeric Variable to (E)Savegame Memory
; <&> : Local Short Alfa1
; (E) : Lara. Air for Lara (0 - 1800) (Short)
; Values to add in script command: $2000, 245, $A50

TG5 will add 1 to LSA1 then forces it into Lara’s air field.
For example:
TG1 puts air value (1000) into LSA1.
In the next moment (frame), air value is 999. In that moment TG5 won’t add a value, so the air value will remain 999.
In the next moment (frame), air value is 998. In that moment TG5 will adds 1, so the air value will be 999.
In the next moment (frame), air value is 998. In that moment TG5 won’t add a value, so the air value will remain 998.
In the next moment (frame), air value is 997. In that moment TG5 will adds 1, so the air value will be 998.
Etc.

-------------------------

Another example:
You want the air to be enough for 1.5 minutes=90 seconds=2700 frames.
That is why that will be your sequence=1800, 1799, 1799, 1798, 1797, 1797, 1796 etc.

I.e. the 1.5 minute is halfway between the original sequence (1800, 1799, 1798 etc., changing every frame) and the two minutes’ sequence (1800, 1800, 1799, 1799 etc., changing every second frame). That is why it will change in each “1.5” frame.

So it should be:
1800 when usually 1800
1800 when usually 1799
1799 when usually 1798
1798 when usually 1797
1798 when usually 1796
1797 when usually 1795
1796 when usually 1794
1796 when usually 1793
1795 when usually 1792
1794 when usually 1791
1794 when usually 1790

GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $2000, 244, $A50
GlobalTrigger= 2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 3, 4, IGNORE
TriggerGroup= 3, $8000, 2, $105, $8000, 1, $10
TriggerGroup= 4, $2000, 127, $1
Organizer= 1, FO_TICK_TIME+FO_LOOP, IGNORE, 3, 5
TriggerGroup= 5, $2000, 231, $150, $2000, 245, $A50
MultEnvCondition= 1, ENV_ROOM_IS, ROOM_WATER, IGNORE
GlobalTrigger= 3, IGNORE, GT_CONDITION_GROUP, IGNORE, 6, 7, IGNORE
TriggerGroup= 6, $8000, 80, $12A, $8000+TGROUP_OR, 2, $5
TriggerGroup= 7, $2000, 128, $1

See the explanation above. Only the red part is new.

TG4 will start Organizer1.

Organizer1 works in frames (FO_TICK_TIME), not seconds, in loop mode (FO_LOOP). So the Organizer will perform TG5 in each third frame (3, 5).

; Set Trigger Type - FLIPEFFECT 231
; Exporting: TRIGGER(336:0) for FLIPEFFECT(231)
; <#> : Variables. Numeric. Add to <&>Variable the (E)value
; <&> : Local Short Alfa1
; (E) : Value 1
; Values to add in script command: $2000, 231, $150

; Set Trigger Type - FLIPEFFECT 245
; Exporting: TRIGGER(2640:62) for FLIPEFFECT(245)
; <#> : Variables. Memory. Copy from <&>Numeric Variable to (E)Savegame Memory
; <&> : Local Short Alfa1
; (E) : Lara. Air for Lara (0 - 1800) (Short)
; Values to add in script command: $2000, 245, $A50

TG5 will add 1 to LSA1 then forces it into Lara’s air field.
For example:
TG1 puts air value (1000) into LSA1.
In the next moment (frame), air value is 999. In that moment TG5 won’t add a value, so the air value will remain 999.
In the next moment (frame), air value is 998. In that moment TG5 won’t add a value, so the air value will remain 998.
In the next moment (frame), air value is 997. In that moment TG5 will adds 1, so the air value will be 998.
In the next moment (frame), air value is 997. In that moment TG5 won’t add a value, so the air value will remain 997.
In the next moment (frame), air value is 996. In that moment TG5 won’t add a value, so the air value will remain 996.
In the next moment (frame), air value is 995. In that moment TG5 will adds 1, so the air value will be 996.
Etc.

----------------
An example for three minutes:

Organizer= 1, FO_TICK_TIME+FO_LOOP, IGNORE, 2, 5, 1, 5

So it should be:
1800 when usually 1800
1800 when usually 1799
1800 when usually 1798
1799 when usually 1797
1799 when usually 1796
1799 when usually 1795
1798 when usually 1794
etc.

For example:
TG1 put air value (1000) into LSA1.
In the next moment (frame), air value is 999. In that moment TG5 won’t add a value, so the air value will remain 999.
In the next moment (frame), air value is 998. In that moment TG5 will adds 1, so the air value will be 999.
In the next moment (frame), air value is 998. In that moment TG5 will adds 1, so the air value will be 999.
In the next moment (frame), air value is 998. In that moment TG5 won’t add a value, so the air value will remain 998.
In the next moment (frame), air value is 997. In that moment TG5 will adds 1, so the air value will be 998.
In the next moment (frame), air value is 997. In that moment TG5 will adds 1, so the air value will be 998.
Etc.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 26-04-14 at 17:37.
Titak 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 04:22.


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