Feature #948

Allow activation sounds for all triggers

Added by keMoN over 3 years ago. Updated over 1 year ago.

Status:New% Done:


Priority:LowSpent time:-
Category:Mod generic
Target version:Behind 2.60b / protocol 84
OS: Arch:


It would be nice to be able to set a custom sound for health and ammo pick-ups. Right now all forms of power-ups have a hardcoded sound. Trigger_heal have that weird fart sound, Trigger_ammo have the same sound as weapon pick-ups and then there are cold_meal that have that swallow sound.
In Dingenskirchen for example, we used different forms of heal and ammo pick-ups in form of the machines and now we also wanted to add another form where the player would get health after 'drinking’ from a wine barrel. However we ditched the idea, because we can’t set a drinking sound instead of the weird fart noice.

It would be nice if these power-up entities could receive a key/value pair, where the key is sound and the value is the path to the sound file. If the key/value pair is not specified the game will pick the standard one.
Would open up possibilities for more creative ways of handling health and ammo in maps.

This functionality is already present with trigger_hurt. Although apparently trigger_heal and trigger_ammo are set up differently in the code it would be nice to have that functionality also with those and other triggers.

Related issues

Related to ET: Legacy Development - Feature #1105: Team-specific activate stages for all triggers Fixed 29.08.2018


#1 Updated by keMoN over 3 years ago

  • Description updated (diff)

#2 Updated by keMoN over 3 years ago

  • Description updated (diff)

#3 Updated by Spyhawk over 3 years ago

  • Category set to Mod generic
  • Target version set to 2.76

From what I see in the code, this can’t be done easily. The characteristics of pickup items (model, sound, increased value, icon, .. ) are hardcoded in the bg_itemlist[] array.
However, new items could be easily added to that list if needed.

#4 Updated by IR4T4 over 3 years ago

For weapons, ammo- and health packs you can already define a custom sound in the weap files - see "pickupSound".

Afaik the values of bg_itemlist are overwritten.

#5 Updated by keMoN over 3 years ago

Okay, so for existing power-up items (health/ammo pack, cold_meal, weapons, etc) the sound is hard-coded and can’t be changed easily?

That actually makes sense, because they always look and behave the same way, so they can also sound the same. But would it be possible to add that feature for trigger_heal and trigger_ammo ? These are necessary for health and ammo cabinets for example, basically always, when the player isn’t picking up a power-up. When the player enters that trigger he automatically picks up health or ammo. Normally this is linked to the health and ammo cabinets for visualization, however they can function on their own as well.
This gives the mapper the option to put different models or other alternative sources for health and ammo inside the trigger, for example these crates or a normal wine barrel, from which the player can 'drink’ for health.

I’m asuming that in this case the played sound is also hardcoded? Would it be possible to remove that restriction for the trigger_heal and trigger_ammo only? No need to change the power-ups.
I’m imagining a new key/value pair that the mapper can specify for those triggers. If it isn’t specified, then the game automatically uses the sound it currently is forced to use. But if the mapper sets the key/value pair to e.g. key: sound ; value: "sound/[mapname]/health_pickup.wav", then the game will use the sound in that location.

#6 Updated by Spyhawk over 3 years ago

No, the ammo and health cabinets are implemented the same way as other power up. However, IR4 is right and these default values can be overridden with a .weap file, which are shipped with the mod. I guess this could be done too for cabinets.

I have however no idea if that would be of any help for mappers. Can you embed .weap file in map pack to override default mod settings? This sounds very ugly to me, but it might work.
Or again, a new entry can be added to the list (for 'drink’).

#7 Updated by keMoN over 3 years ago

But health and ammo cabinets function differently than power-ups. At first they are the same, since you just place the power-up (for example item_health) the same you place a misc_cabinet_health. The game automatically sets up everything, like model, animations and checks whether the player is already max’ed or if he can pick up more health etc. However cabinets need a trigger_heal or trigger_ammo to funciton. They do not funciton on their own. Cabinets don’t give you ammo or health. The only thing the cabinet does, is display packs, remove them when it gets told that a pack has been picked up and add them after a certain amount.

What actually gives the player health and ammo are trigger_heal and trigger_ammo. The communication between cabinet and trigger is done because the trigger has a key/value pair with key: target ; value: 'targetname_of_cabinet’ and the cabinet has a key/value pair with key: targetname ; value: 'targetname_of_cabinet’.

Those triggers can be used in combination with a cabinet when they have a target specified, however they can also stand alone. They function the same way as trigger_hurt or any other triggers do. When a player enters a trigger, the trigger starts doing something and when the player leaves the trigger, the triggers stops doing that. When they are linked to other stuff like for example a health_cabinet they communicate to that stuff: "Hey, I have been activated and I did something, now you do something as well."

Actually come to think of it, trigger_hurt has a spawnflag called SILENT. This removes the damage sound completely and the mapper can set a speaker to start when a player enters the trigger and and stop when he leaves it. This can be used when the damage source is for example electrical and you want to have a electric sizzling sound, because that barbwire-cut-sound doesn’t make sense when you get hurt by electricity.

So giving trigger_heal and trigger_ammo a spawnflag SILENT would also be an alternative.
However, I think that being able to specify the sound a trigger plays, when you activate it would definitely be more efficient. This would be neat for all triggers actually.
Sorry for the confusion, I started the ticket badly. I should have called it "set activation sound for triggers" or something like that.

#8 Updated by Spyhawk over 3 years ago

What I meant is that the default are hardcoded in the same way as power-ups. Code side, they are all seen as 'items’. F.e. see here for the health cabinet default.

The sound for trigger_hurt seems to be hardcoded in SP_trigger_hurt() instead, since it doesn’t have an item related to it.

#9 Updated by keMoN over 3 years ago

Actually, Ir4t4 found out that the sound for trigger_hurt isn’t hardcoded. There is a key you can set to change the sound it plays when the trigger is activated.
This key/value pair just wasn’t mentioned in Chruker’s wiki.
Key: sound
Value: sound/subfolder/soundfile.wav

Ir4t4 said, that trigger_heal and trigger_ammo are set up differently, but it would be really nice if the functionality that already exists with trigger_hurt could be copied to all other triggers.

I also updated the title so it is more clear what this ticket is about.

#10 Updated by keMoN over 3 years ago

  • Subject changed from customizable health/ammo pick-up sound to Allow activation sounds for all triggers

#11 Updated by keMoN over 3 years ago

  • Description updated (diff)

#12 Updated by IR4T4 over 3 years ago

From my point of view this small feature isn’t worth to change the whole health and ammo trigger code (see EV_PICKUP). Items in bg_itemlist are part of the game and sounds shouldn’t be changed here - players expect those sounds!

#13 Updated by keMoN over 3 years ago

People expect those sounds, because there rarely are if any other sources of health/ ammo/ damage.
If I run into barbed wire then of course I expect the sound of clothes/skin cutting on barbed wire, but if I run into flames, then I expect burning sound, because that’s what happens in RL and so that’s what I’m expecting. If I run into a high power electrical field then I expect an electrolute sound because having my clothes and skin cut from fire and electricity doesn’t make sense here.
If I pick up a health pack I expect the sound of picking up a health pack, true. But if I drink, I expect some form of swallowing/liquid flowing sound, because that’s what happens in RL and so I expect that to happen in a functioning and immersive environment. If I eat something, then I expect munching/swallowing and not a sound that apparently makes the player put the liquid or meal into his pockets.

Players expect those standard sounds to play for standard events. There rarely are other events because you can not properly implement them. I’m not saying with having those options, there will be a sudden wave of innovative and completely immersive maps and admittedly it is highly unlikely. I only want the game to provide the possibility to create those.
Yes, most likely that will not be used at all or maybe in one or two maps max, but that doesn’t mean we can’t provide the option to make the game experience more beautiful and immersive. I just don’t want ET: Legacy to be the same old shit all over again.

#14 Updated by keMoN over 3 years ago

  • Priority changed from Normal to Low

#15 Updated by IR4T4 almost 3 years ago

  • Target version changed from 2.76 to 2.78

#16 Updated by keMoN over 1 year ago

  • Related to Feature #1105: Team-specific activate stages for all triggers added

#17 Updated by keMoN over 1 year ago

  • Target version changed from 2.78 to Behind 2.60b / protocol 84

Also available in: Atom PDF