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 31-01-15, 12:56   #1
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,592
Default TRNG - Timers - some examples

Before we start on any examples, you might want to have a look at
TRNG - Screen timer types
and
TRNG – A couple of interesting situations with timers
for some facts about timers in general and for the difference between the classic timer and the TRNG timer.


EXAMPLES
  • Assaultcourse - Make Lara say different things depending on how much time it took her to complete the timed run on the assault course
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.
Titak is offline  
Old 31-01-15, 12:56   #2
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,592
Default

Assault course
Make Lara say different things depending on how much time it took her to complete the timed run on the assault course.


Here is a simple version and a more complicated version.
Both versions use intervals of 10 seconds, just for quick ingame testing purposes.

SIMPLE VERSION
With this version you use the classic timer and it simply stops and disappears from the screen the moment Lara activates the trigger for TG41 at the end of the timed run.
The timer is activated with F86.

Code:
; -- subtitles
Parameters=     PARAM_PRINT_TEXT, 2, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 2, 300,660 ;ExtraNG string 109 Excellent
Parameters=     PARAM_PRINT_TEXT, 3, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 3, 300,660 ;ExtraNG string 108 That's great
Parameters=     PARAM_PRINT_TEXT, 4, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 3, 300,660 ;ExtraNG string 107 Gosh that was fast

; --- Lara saying different things, depending on the time in which she has completed the timed run.
TriggerGroup=    41, $8000, 1, $14, $8000, 10, $114, $2000, 129, $41, $2000, 203, $26D, $2000, 86, $0, > 
                                $8000 + TGROUP_ELSE, 10, $14, $8000, 20, $114, $2000, 129, $42, $2000, 203, $36C, $2000, 86, $0, > 
                                $8000 + TGROUP_ELSE, 20, $14, $2000, 129, $43, $2000, 203, $46B, $2000, 86, $0
		           ; timer higher than 1 but lower than 105 sec, then play audio 065 and stop/hide timer
		           ; timer higher then 105 but lower than 125 sec, then play audio 066 and stop/hide timer
		           ; timer higher than 125 sec, then play audio 067, print tring 107 and stop and hide timer, $2000, 265, $0, $2000, 270, $500.
The audio is Lara saying something, just like in TR3.
When she is really fast, she can for example say "Excellent!".
In this setup she will say three different things, depending on the time in which she completes the timed run.
The end time is unlimited, so even if it takes her an hour to complete the timed run, she will still say whatever is in audiotrack 067.


MORE COMPLICATED AND CUSTOMIZED SETUP
As said, the above setup makes the timer stop and hide immediately.
But what if you want the player to be able to read the final time properly. Hard to do when the timer suddenly vanishes, right?
So, we have to make it stay on screen for a while longer, 5 seconds in my example, while it should still do what ever it is supposed to do, like properly play the audio at given times.

So... the classic timer is not of much use anymore.
Time to use the TRNG timer and a variable, Local Long Timer to be exact.
Local Long Timer is required when using the local TRNG timer. (use Global Long Timer when using the Global timer).
Code:
; -- subtitles
Parameters=     PARAM_PRINT_TEXT, 2, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 2, 300,660 ;ExtraNG string 109 Excellent
Parameters=     PARAM_PRINT_TEXT, 3, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 3, 300,660 ;ExtraNG string 108 That's great
Parameters=     PARAM_PRINT_TEXT, 4, CL_WHITE, FT_SIZE_ATOMIC_CHAR, IGNORE, 3, 300,660 ;ExtraNG string 107 Gosh that was fast

Parameters=   PARAM_BIG_NUMBERS, 1, 400, 300, 301, 600, 601, 900, 901
		          ; NOTE: the number 400 is not used in this setup. I already had it present in my script for something else. 

; -- start and stop the timer with placed F118 triggers on/around the timed perimeters
; TG44 is placed at the start of the timed run.
; TG43 is placed around the path if you need to restrict Lara's movements, like, for example, with an assaultcourse. 
; TG43 makes the timer hide immediately because I do not think it is needed to be able to view it.  
TriggerGroup=    44, $2000, 244, $4F73, $2000, 264, $0, $2000, 269, $200 
		           ; copy Screen Timer to variable LLTimer, START increasing TRNG timer, show timer in top-center position
TriggerGroup=    43, $2000, 265, $0, $2000, 266, $0, $2000, 270, $0
		           ; STOP timer, set to 0 seconds

; -- Reset the timer when reaching the end of the timed run 
; -- and make Lara say three different things depending on the time in which Lara has finished the timed run.
TriggerGroup=    41, $8000 + TGROUP_SINGLE_SHOT_RESUMED, 115, $026, $8000, 115, $227, $2000, 129, $41, $2000, 203, $26D, $2000, 265, $0, $2000, 270, $500, $2000, 376, $2 >
                     $8000 + TGROUP_ELSE + TGROUP_SINGLE_SHOT_RESUMED, 115, $326, $8000, 115, $427, $2000, 129, $42, $2000, 203, $36C, $2000, 265, $0, $2000, 270, $500, $2000, 376, $2, >  
                     $8000 + TGROUP_ELSE + TGROUP_SINGLE_SHOT_RESUMED, 115, $526, $8000, 115, $627, $2000, 129, $43, $2000, 203, $46B, $2000, 265, $0, $2000, 270, $500, $2000, 376, $2, > 
                     $8000 + TGROUP_ELSE + TGROUP_SINGLE_SHOT_RESUMED, 115, $726, $2000, 265, $0, $2000, 270, $500, $2000, 376, $2
				; LLTimer =>1 and LLTimer <300, then then play audio 065, print string 109 and stop timer, hide timer after 5 seconds, resume (reset) Organizer2
				; LLTimer =>301 and LLTimer <600, then then play audio 066, print string 108 and stop timer, hide timer after 5 seconds, resume (reset) Organizer2 
				; LLTimer =>601 and LLTimer <900, then then play audio 067, print string 107 and stop timer, hide timer after 5 seconds, resume (reset) Organizer2
				; LLTimer =>901, then hide timer after 5 seconds, resume (reset) Organizer2
				; F118 trigger for GT41 is placed at the end of the assaultcourse (multiple performance of the TG because there are conditions in it)

Organizer=       2, FO_TICK_TIME, IGNORE, 140, 45
TriggerGroup=    45, $2000, 266, $0 ; set timer to 0 seconds
The TGROUP_SINGLE_SHOT_RESUMED is needed so the TG is executed once untill the conditions become newly true.
If it is not used, the audio will keep on playing the first "frame" untill Lara steps off the trigger for TG41.
Organizer2 is used to reset the timer after it has been removed from the screen.
Because if you simply stop it and remove it from the screen, if will not be reset to 0 so you can't make a fresh start with the timed run.

You will first see the timer reset to 0 before it vanishes.
I guess this has to do with the used timing. You can ofcourse try to finetune this.

You can ofcourse expand on this, make other things happen when Lara reaches the end of the timed run within a given amount of seconds.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 31-01-15 at 13:02.
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 03:22.


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