End Credits
by AkyV
Download a project file illustrating this tutorial

You can end your game by two methods:

- The game jumps to the title at the end of the game.
- The game jumps to the title at the end of the game, showing the credits list.

To acquire those methods, read this description:

The amount of the [Level] blocks in your Script is X. Type X+1 or X+2 into the window of FINISH trigger at the end of the last level of your game:

- Typing X+2, the game jumps to title if the trigger has been activated.
- Typing X+1, the game jumps to title if the trigger has been activated, but:

a, 098.wav (this is hardcoded) will start instead of the background audio you use for the title and
b, the original credits list of TRLR starts.

The 'X+1' case won't work if you don't type this entry in [Title] block or the [Level] block of the last level:

Customize= CUST_SET_CREDITS_LEVEL, A

Where A=X+1.

Notes:

1. It seems the flyby under the credit list doesn't always start with the first camera of the first sequence (as opposed to the title flyby you can see usually). I think it starts from the camera that was just used when you left the title level last before.

2. When the list has ended the main menu will appear again. (But 098.wav won't change.)

3. If you see a black screen instead of the title flyby and the list then maybe it's some configuration (resolution?) problem.

Customizing the look

You can give a new form to the list by these tools:

- New basic fonts for the whole game (including the texts of the credits list), editing font.pc in graphics\wads folder.

- New fonts for the whole title (including the texts of the credits list): put a FONT_GRAPHICS object into the WAD of the actual level - i.e. the title this time - (get the object from the new font demo project of Paolone), then use NG Font Editor in NG Center\Tools.

- Use this entry in Script (in [Title] block) to give a new color to the people's names:

Customize= CUST_SET_TEXT_COLOR, TT_CREDITS, B

Where B=one of the CL constants

- Use this entry in Script (in [Title] block) to give a new size to all the old entries*:

TextFormat= IGNORE, IGNORE, IGNORE, C

Where C= one of the SC constants

*: 'Old entries' mean now all the texts (except: the text of Legend Script command) you can see anywhere in TRLR and TRLE as well. Including the texts of the credits list.

Note:
If you don't want to hear 098.wav, then write this in [Title] block:

GlobalTrigger= 1, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $2000, 68, $168

; Set Trigger Type - FLIPEFFECT 68
; Exporting: TRIGGER(360:0) for FLIPEFFECT(68)
; <#> : Sound. (CD) Play <&>CD track in (E) way on channel1
; <&> : AUDIO\104
; (E) : Looped playback
; Values to add in script command: $2000, 68, $168

The GlobalTrigger activates TriggerGroup#1, activating the required audio, instead of 098.wav. (In this example the required audio is 104.wav.)

This GlobalTrigger also works when the game starts, after you've clicked on tomb4.exe. That's why the audio in Level command is absolutely useless now, practically: the game will always play the audio in title that is defined by the GlobalTrigger.

Customizing the contents

You can find the task names and person names of the credits in these NG Center\Strings entries:

- Task: [PSXStrings] #246-#259 and [PCStrings] #300-#302
- Person: [PSXStrings] #260-#299.

Unfortunately, you can't change people's names. (I mean, you can in Strings, but it doesn't affect the game.)
But you can change the task names. After updating them, build the script.

New type credits

You can make a brand new credits list, if you want. But you can't make it in the title level. You'll make it in a 'real' level. (So if we say 'credits level' in this chapter, that is NOT the title level this time.)
Why should you do a new credits list? - Well, maybe

- you want own person names in the list and don't want to use the original ones you can't change,

- the structure and/or the length of the original credits list is not acceptable for you,

- you want to see other flyby sequences and/or another level for the credits when the game ends and not the ones in the title level,

- you want to trigger/show/customize something you can't do in the original credits list/in the title level.

This is how it works:

1. Lara reaches the end of the last level of the game. A usual FINISH trigger is being activated there, loading Lara into another level - i.e. into the level, where the new type credits will show up.

2. When the credits level starts, a Flyby sequence also starts at once. Lara can't move and maybe she's absolutely out of the POVs of all the cameras. (It depends on how you placed and adjusted the flyby cameras.) The sequence is endless, and you can't interrupt that by hitting the Look key.
When the level starts, the credits list also starts, scrolling vertically from below upwards. When the last entry of the list is just out of the top of the screen then the game loads the title level.

And now, let's see the setup that has two parts (one in Room Editor and one in Script):

SETUP IN ROOM EDITOR

- LARA object is placed on a trigger. So, if the level starts, then the trigger will be activated at once, activating TriggerGroup#2:

; Set Trigger Type - FLIPEFFECT 118
; Exporting: TRIGGER(258:0) for FLIPEFFECT(118)
; <#> : TriggerGroup. Perform <&>TriggerGroup from script.dat in (E)way
; <&> : TriggerGroup= 2
; (E) : Single performing (to use when in TriggerGroup there are only commands)
; Values to add in script command: $2000, 118, $102

- The flyby cameras of the sequence are scattered (by you) in the map. These OCB buttons of the first camera of the sequence are pressed:

0 - so the sequence starts with its first camera, and not Lara's chase-camera
2 - so the sequence is endless, i.e. works in loop mode
9 - so the sequence cannot be aborted
10 - so Lara can't be moved during the sequence

(See more about flyby cameras in Skribblerz tutorials.)

SETUP IN SCRIPT

Customize= CUST_TEXT_ON_FLY_SCREEN, ENABLED
TriggerGroup= 2, $5000, 14, $2D, $2000, 66, $307, $2000, 201, $0
GlobalTrigger= 2, FGT_SINGLE_SHOT, GT_VSCROLL_LAST_VISIBLE, 0, IGNORE, 3, IGNORE
TriggerGroup= 3, $2000, 66, $303, $2000, 201, $1
GlobalTrigger=3, FGT_SINGLE_SHOT, GT_VSCROLL_LAST_VISIBLE, 1, IGNORE, 4, IGNORE
TriggerGroup= 4, $2000, 66, $307, $2000, 201, $2
GlobalTrigger= 4, FGT_SINGLE_SHOT, GT_VSCROLL_LAST_VISIBLE, 2, IGNORE, 5, IGNORE
TriggerGroup= 5, $2000, 66, $303, $2000, 201, $3
GlobalTrigger= 5, FGT_SINGLE_SHOT, GT_VSCROLL_LAST_VISIBLE, 3, IGNORE, 6, IGNORE
TriggerGroup= 6, $2000, 66, $307, $2000, 201, $4
GlobalTrigger= 6, FGT_SINGLE_SHOT, GT_VSCROLL_LAST_VISIBLE, 4, IGNORE, 7, IGNORE
TriggerGroup= 7, $2000, 66, $303, $2000, 201, $5
GlobalTrigger= 7, IGNORE, GT_VSCROLL_COMPLETE, 5, IGNORE, 8, IGNORE
TriggerGroup= 8, $2000, 82, $A

The entry of CUST_TEXT_ON_FLY_SCREEN is needed or else the list won't be printed on the screen of a flyby sequence!

So when the level starts, Lara activates TriggerGroup#2 at once. It means:

a, the flyby camera sequence starts, with its first camera:

; Set Trigger Type - ACTION 45
; Exporting: TRIGGER(45:0) for ACTION(14)
; <#> : CAMERA_FLYBY ID 14
; <&> : Trigger. (FlyBy) (E)Activate or Untrigger the <#>FlyBy camera sequence
; (E) : Activate Flyby camera sequence
; Values to add in script command: $5000, 14, $2D

b, a trigger defines the color and position for the next text (the first entry of the list - that is written in ExtraNG#0):

; Set Trigger Type - FLIPEFFECT 66
; Exporting: TRIGGER(775:0) for FLIPEFFECT(66)
; <#> : Text. Set <&>color and (E)position for next Print String flipeffect
; <&> : Dark Metal (Dark Gray + Light Gray)
; (E) : Central line, central aligment
; Values to add in script command: $2000, 66, $307

c, a trigger prints the first entry of the list on the bottom of the screen, scrolling that vertically upwards:

; Set Trigger Type - FLIPEFFECT 201
; Exporting: TRIGGER(0:0) for FLIPEFFECT(201)
; <#> : Text. Vertical Scrolling of ExtraNG <&>string with (E) speed
; <&> : 0: Story of The Game
; (E) : Abs. Normal Speed (30 fps)
; Values to add in script command: $2000, 201, $0

GlobalTrigger#2 says if the ExtraNG#0 entry (i.e. the first entry of the list: 'Story of The Game') is printed on the screen, then TriggerGroup#3 will be activated.
TriggerGroup#3 defines the color and position for the next text (the second entry of the list - that is written in ExtraNG#1):

; Set Trigger Type - FLIPEFFECT 66
; Exporting: TRIGGER(771:0) for FLIPEFFECT(66)
; <#> : Text. Set <&>color and (E)position for next Print String flipeffect
; <&> : Red
; (E) : Central line, central aligment
; Values to add in script command: $2000, 66, $303

and then prints the second entry of the list on the bottom of the screen, scrolling that vertically upwards:

; Set Trigger Type - FLIPEFFECT 201
; Exporting: TRIGGER(1:0) for FLIPEFFECT(201)
; <#> : Text. Vertical Scrolling of ExtraNG <&>string with (E) speed
; <&> : 1: AkyV
; (E) : Abs. Normal Speed (30 fps)
; Values to add in script command: $2000, 201, $1

(Because of technical reasons, the GlobalTrigger works only once - see: FGT_SINGLE_SHOT flag.
Anyway, the GlobalTrigger don't need to work more than once.)

After that, that block will be repeated for the actual entry of the list:
So, GlobalTrigger#3 says if the ExtraNG#1 entry (i.e. the second entry of the list: 'AkyV') is printed on the screen, then TriggerGroup#4 will be activated. TriggerGroup#4 defines the color and position for the next text (the third entry of the list - that is written in ExtraNG#2) and then prints that on the bottom of the screen, scrolling that vertically upwards.
Then, GlobalTrigger#4 says if the ExtraNG#2 entry is printed on the screen, then TriggerGroup#5 will be activated. TriggerGroup#5 defines the color and position for the next text and then prints that on the bottom of the screen, scrolling that vertically upwards.
Etc.

These are the other entries of the list now:

ExtraNG#2: \nLevel Designer
ExtraNG#3: AkyV
ExtraNG#4: \nSpecial Thanks to
ExtraNG#5: @Credits_special_thanks.txt

GlobalTrigger#7 is unlike the other GlobalTriggers of the setup:
I.e. GlobalTrigger#7 says if the ExtraNG#5 entry (i.e. the last entry of the list) is totally scrolled out of the screen, then TriggerGroup#8 will be activated:

; Set Trigger Type - FLIPEFFECT 82
; Exporting: TRIGGER(10:0) for FLIPEFFECT(82)
; <#> : Delay. Load <&>level in (E)seconds
; <&> : 10 
; (E) : Forever (use other action/effect to disable it)
; Values to add in script command: $2000, 82, $A

As X (see above) is 8 now (for example), then 10 means this trigger will load the title level (without the original credits list).

Notes:

1. About the contents of the texts:

- 'AkyV' text is presented in two ExtraNG entries. It's because I had to give different subject for GlobalTrigger#3 and #5. (I.e. the subject of GlobalTrigger#3 is ExtraNG#1: AkyV, and the subject of GlobalTrigger#5 is ExtraNG#3: AkyV.)

- '\n' means: 'I hit ENTER'. (Hence the vertical space between the entries of the list.)

- Credits_special_thanks.txt is saved in Script folder and contains these entries:

Core Design
Eidos Interactive
Paolone for TRNG

The '@Credits_special_thanks.txt' in ExtraNG#5 means: 'the contents of Credits_special_thanks.txt in Script folder'.
(Use this in ExtraNG#5, instead of the TXT, if you want:

Core Design\nEidos Interactive\nPaolone for TRNG

The result will be the same.)

2. TextFormat Script command in the [Level] block of the credits level can give default values (color, position) to the texts of the list.

3. Use 'Text. Vertical Scrolling of ExtraNG <&>string with (E)formatting data' FLIPEFFECT trigger instead of 'Text. Vertical Scrolling of ExtraNG <&>string with (E) speed' FLIPEFFECT trigger, if you want. But in this case it's not 'Text.Set' triggers or TextFormat commands that will add forming values for the scrolling, but PARAM_PRINT_TEXT Script constants will.

4. You can also form the texts of your own credits by font.pc or FONT_GRAPHICS (see above).

5. See more about fonts and texts in Paolone's new font demo project.

6. Except the setup you've just read, you don't need to do anything special in the credits level.
So build the level as you build levels usually (including creating its [Level] block), use that setup - and it will work successfully as your own credits level.
(I mean it's recommended to create a simple level - as for building combat elements, for example - because the still Lara isn't able to fight enemies now. But that's clear, I think.)

7. Two usable new alternatives for the setup:

- You don't need flyby cameras. I.e. you can use a still picture during the credits list instead of the 'movie':
Place a Camera or Fixed Camera and another object that the camera will shoot, then activate them in TriggerGroup#2 instead of a flyby camera trigger. Also use a Keyboard FLIPEFFECT, in that TriggerGroup, to disable all the movements of Lara (that's why she won't be running around in front of the camera or won't be able to abort the camera).

- Use a GlobalTrigger in [Title] block, with GT_KEYBOARD_CODE constant, where the condition is Key C (C as Credits.) It says: if the player hits C then a TriggerGroup will be activated, activating a Delay FLIPEFFECT trigger that loads the game into the credits level. - So you can examine the credits, loaded them directly from the title level, whenever you're in the title level, all you have to do is hit C. (In this case you can even skip the loading of the credits level at the end of the game: i.e. you can adjust the FINISH trigger of the last level to load directly to the title level.)
Use a Text FLIPEFFECT in the title level so that you can print on the title screen for the player that 'hit C to see credits'.

Made using TRNG 1.2.2.6