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 13-01-16, 19:55   #1
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,798
Default TRNG - Additional sounds for Lara, during a certain status

Additional sounds for Lara
Ever wanted to add sounds to Lara which can NOT be assigned to animations?
Why not assign them to animations?
Well, when they are assigned to animations, the sounds will play each time Lara performs the animations.
So what about a sound she makes when running out of air while she is not yet drowning, let’s say when her airbar is down to 10%.
Or make her scream when she is on fire and her health is down to 40%?
Or what about adding a heartbeat when her health is down to 20%?
Or what about making her gasp with pain when her health is down to 20% AND she is performing certain moves, like landing after a jump, or slamming into the wall when grabbing a ledge?

All possible with some scripting!

In this tutorial I will not explain how to add sounds to your wad.
So this tutorial is assuming that you know how to do this.

Variables are used in some cases, so it is recommended you already know a bit about variables before trying this. You can ofcourse use the variables and their corresponding triggers used in this tutorial but then you have to make sure that the variables are not used for different things at the same time.



Making Lara scream when she is on fire
A_De already made a tutorial about this, so I figured I could just link to that one instead of adding it to this thread.

Choking sound when Lara's airbar is low and Coughing sound when Lara's airbar is low while surfacing

Several examples of having additonal sounds when Lara’s health gets low.


To be continued...
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 16-01-16 at 19:53.
Titak is offline  
Old 13-01-16, 20:04   #2
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,798
Default

Choking sound when Lara’s airbar is low
If you’ve played TRL/TRA, you’ll know that Lara starts choking when she is about to run out of air. In those games she does this choking a couple of times before she actually drowns and she also performs a jerking animation.
This tutorial only shows you how to make the sound play one single time when the airbar reaches a certain value.
You can ofcourse expand on this, add the sound multiple times and/or force a special animation.

All blue and green values are values that might need to be different in your own levelscript, since your script might already be using the values used in this tutorial.

First we need to use a variable. Since we have to use a “short” variable for this, I picked Local Short Delta1.
You can ofcourse pick another “short” variable if Local Short Delta1 is already used in your script.

Code:
; Set Trigger Type - FLIPEFFECT 244
; Exporting: TRIGGER(2644:0) for FLIPEFFECT(244)
; <#> : Variables. Memory. Copy to <&>Numeric Variable the (E)Savegame Memory value
; <&> : Local Short Delta1
; (E) : Lara. Air for Lara (0 - 1800) (Short)
; Values to add in script command: $2000, 244, $A54
These values go into TG10
This value needs to be copied to the variable all the time, so use GT8 below to make sure it does:
Code:
TriggerGroup=    10, $2000, 244, $A54
GlobalTrigger=   8, IGNORE, GT_ALWAYS, IGNORE, IGNORE, 10, IGNORE
Since the condition triggers about values in variables don’t allow us to pick large values, we use PARAM_BIG_NUMBERS.
I picked value 400, which is the value at which the airbar starts blinking.

Code:
 ; Set Trigger Type - CONDITION 40
; Exporting: CONDITION(40:60) for PARAMETER(84)
; <#> : Local Short Delta1
; <&> : Variables. The <#>Numeric Variable is = than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=     1
; Values to add in script command: $8000, 84, $128
That’s it for condition TG11.
Now create the second TG, TG12, which activates the sound:

Code:
 
; Set Trigger Type - FLIPEFFECT 70
; Exporting: TRIGGER(7950:60) for FLIPEFFECT(70)
; <#> : Sound. Play <&>Sound sample of first group (0-255) for (E) time
; <&> : BIG_SCARAB_ATTACK           14  MISSING  bsca_atk
; (E) : Perform one single time
; Values to add in script command: $2000, 70, $1F0E
As you can see, my “drowning” sound is assigned to soundbank 14 in the sounds.txt.
You can ofcourse change this sound slot. Make sure you then adjust the trigger accordingly.
I did not want to use the same sound as the actual drowning, hence the different sound slot.

The TG’s are done, so now we finish the setup with a GlobalTrigger:
Code:
Parameters=   PARAM_BIG_NUMBERS, 1, 400,
TriggerGroup=   11, $8000, 84, $128
TriggerGroup=   12, $2000, 70, $1F0E ; play sfx moa_lardrown2
GlobalTrigger=  6, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 11, 12, -1



Coughing sound when Lara's airbar is low while surfacing
Another feature in TRL/TRA is that Lara coughs when surfacing after nearly drowning.

This setup uses the same TG10 and GT8 as above.
So if you are using both the choking sound AND the coughing sound, you only have to use those triggers once in your script.
If you are only using the coughing sound, then don’t forget to put TG10 and GT8 in your script.

First we export the condition-triggers for condition TG13.
In this case we use the condition that the value is lower than 400.
This is done because when we use the condition that the value is 400, there’s only one instance in which the sound would play and Lara will have to surface right that moment in order to make it play. By using less than it will play every time Lara will surface while her airbar is anywhere below 400.
Code:
; Set Trigger Type - CONDITION 39
; Exporting: CONDITION(39:60) for PARAMETER(84)
; <#> : Local Short Delta1
; <&> : Variables. The <#>Numeric Variable is < than (E)Big Number value
; (E) : Value of Parameters=PARAM_BIG_NUMBERS at index=     1
; Values to add in script command: $8000, 84, $127
We also want Lara to perform the coughing sound ONLY when she is surfacing. This is animation 114:
Code:
; Set Trigger Type - CONDITION 30
; Exporting: CONDITION(30:60) for PARAMETER(114)
; <#> : Animation=   114
; <&> : Lara. (Animation) Lara is performing <#>animation
; (E) : 
; Values to add in script command: $8000, 114, $1E
TG14 will play the coughing sounds AND stops the choking sound if Lara happens to be surfacing while the choking sound is still being played.
Code:
; Set Trigger Type - FLIPEFFECT 70
; Exporting: TRIGGER(7951:0) for FLIPEFFECT(70)
; <#> : Sound. Play <&>Sound sample of first group (0-255) for (E) time
; <&> : BIG_SCARAB_DEATH            15  MISSING  bsca_die
; (E) : Perform one single time
; Values to add in script command: $2000, 70, $1F0F
Code:
 ; Set Trigger Type - FLIPEFFECT 72
; Exporting: TRIGGER(14:0) for FLIPEFFECT(72)
; <#> : Sound. Stop <&>Sound sample of first group (0-255)
; <&> : BIG_SCARAB_ATTACK           14  MISSING  bsca_atk
; (E) : 
; Values to add in script command: $2000, 72, $E
No need to add this second trigger if you are not using the choking setup.

And last but not least, GT 5 will make i t all happen.
Complete script:
Code:
TriggerGroup=   13, $8000, 84, $127, $8000, 114, $1E 
TriggerGroup=   14, $2000, 70, $1F0F, $2000, 72, $E ; play sfx moa_larcough, stop drowning sound
GlobalTrigger=  5, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 13, 14, -1
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 13-01-16 at 20:07.
Titak is offline  
Old 16-01-16, 19:52   #3
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,798
Default

Additonal sounds when Lara’s health gets low.

You know how Lara’s healthbar starts blinking when her health gets low.
Lara’s Total health has value 1000, no health (dead) has value 0.
At about value 200 the healthbar starts blinking.

This is a nice visible indication that we, players, have to be carefull or Lara will die.
But what about adding another feature that indicates that her health is low?

Below are a couple of examples that are the result of a brainstorming session with Dwight (aka Vivi Carol).
When he showed me a gameplay video of one of his current WIP projects, I noticed the trembling brewathign sound. Since I had already been using a heartbeat sound for quite some time in my own WIP project, we started exchanging ideas.
Below are the results.
So credit also goes to him, for coming up with ideas. Especially the one in which sounds are added only to certain moves when Lara’s healthbar gets low.




Heartbeatsound when health is below 150
This is the most simple setup I could come up with. It continuosly plays a heartbeat sound at an interval of 3 seconds. I choose 3 seconds because I do not want the sound to be too intrusive.
The sound is stopped once Lara’s health goes up, or when she dies.

In the example, I used soundslot 245, to which I assigned a heartbeat sample.
TG127 is about playing that sound. The timing at which the sound plays is specified in Organizer7. Make sure you use FO_LOOP in the Organizer so it will loop on it self, repeating the playing of the heartbeat sound.
GT42 tells the game to start Organizer7 when Lara’s health is below 150, using GT_LARA_HP_LESS_THAN. By using this command, you won’t need a condition TriggerGroup.
GT45 tells the game to stop Organizer7 when Lara’s health is more then 150.
You can ofcourse pick another value for Lara’s health.

And last but not least, GT39 tells the game to stop Organizer7 AND stop playing the sound.
I would still hear the heartbeat sound after Lara died so I added this extra GT which uses TG91 to stop both Organizer and sound. Seems to be working!

Here’s the script:
Code:
Organizer=      7, FO_LOOP, IGNORE, 3, 127
TriggerGroup=   127, $2000, 70, $1FF5 ; play sound 245 heartbeat (DEMIGODS_S_WAVE_RUMB)
TriggerGroup=   128, $2000, 290, $7 ; resume Organizer7
TriggerGroup=   145, $2000, 128, $7 ; stop Organizer7
TriggerGroup=   91, $2000, 128, $7, $2000, 72, $F5 ; stop Organizer7, stop sound 245
GlobalTrigger=  42, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_LESS_THAN, 150, IGNORE, 128, IGNORE 
GlobalTrigger=  45, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_HIGHER_THAN, 150, IGNORE, 145, IGNORE
GlobalTrigger=  39, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_LESS_THAN, 1, IGNORE, 91, IGNORE




Trembling breathing when healthbar is below 150
Right… so far so good.
But what if you are using another sound to indicate that Lara is injured?
You should give it some more thought. A heartbeat sound still makes sense when underwater, but what if you use TR2013 style trembling inhale/exhale sounds? Would be weird if you could still hear those underwater, right?

But there is a pretty simple solution for that.
Let’s say we use the same sound slot as for the heartbeat. That makes the above script still usefull.
In fact, you can use it in full.
All that needs to be added is a condition about “being underwater”. But how to determine when Lara is underwater?
Well, two ways:
1. through a variable (Lara’s environment is copied to a variable, and then using the value of the variable as a condition), or
2. using “sound 60 is playing” as a condition.
I’d say the second option is much easier.


So, TG87 is the condition that sound 60 is playing.Soundslot 60 is the underwaterloop and only plays when the camera goes below the watersurface.
And GT24 stops Organizer7 and sound 245.
As you can see, TG91 is used again to stop Organizer7 and sound 245.
Code:
TriggerGroup=   87, $8000, 60, $55 ; condition that sfx 60 (underwaterloop) is playing
GlobalTrigger=  24, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 87, 91, -1

NOTE:

If you don’t want to sound to play each time, you can ofcourse add a CH value to the soundslot (in the sounds.txt).
A CH value of 60 works nicely.





Trembling inhale/exhale sounds ONLY when Lara is performing certain moves while her health is low.

You think it does not sound quite right when Lara is making trembling breathing sounds all the time? You think hearing it all the time gets annoying after a while, especially if you don’t have any medipacks left to heal Lara?
Wouldn’t it make more sense if she would make such sounds during certain moves?
Like landing after a jump or falling down, rolling, grabbing and slamming into the wall for example.

Yep, it is possible:
Code:
Organizer=      10, FO_TICK_TIME, IGNORE, 10, 80
TriggerGroup=   80, $2000, 70, $1FF5 ; play sound 245 injured (DEMIGODS_S_WAVE_RUMB)
TriggerGroup=   81, $2000, 290, $A ; resume Organizer10
TriggerGroup=   82, $2000, 128, $A ; stop Organizer10
TriggerGroup=   86, $8000, 82, $1E, $8000 + TGROUP_OR, 92, $1E, $8000 + TGROUP_OR, 24, $1E, $8000 + TGROUP_OR, 147, $1E, >
                    $8000 + TGROUP_OR, 151, $1E, $8000 + TGROUP_OR, 96, $1E, $8000 + TGROUP_OR, 96, $1E 
				; condition that Lara is performing animation 82 OR 92 OR 24 OR 147 OR 151 OR 96
GlobalTrigger=  34, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_LESS_THAN, 150, 86, 81, IGNORE 
GlobalTrigger=  35, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_HIGHER_THAN, 151, -1, 82, IGNORE
GlobalTrigger=  36, FGT_SINGLE_SHOT_RESUMED, GT_LARA_HP_LESS_THAN, 1, -1, 82, IGNORE
As you can see the setup is very similar to making a sound play all the time.
The only thing that has been added is a condition trigger, TG86, which stores the conditions that Lara is performing certain moves. I’ve used a couple, but you can ofcourse add more or remove some. TGROUP_OR is ofcourse used because Lara can’t perform all of these moves at the same time.
GT34, the one about Lara’s health being lower than 150, now also has TG86 in its [I]IdConditionTriggerGroup[/] field.

I used Organizer10 so the sound would not play right at the beginning of an animation.
In a lot of cases it sounds better if the sound plays later on during an animation. Using 10 frames for the timing, looked and sounds about right for most animations in TG86.
You can ofcourse omit this Organizer or change the timing.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.
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 11:14.


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