You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
- New `SoundContainer` function `Restart`, which allows you to restart a playing `SoundContainer`. Also another `Play` function, that lets you just specify the player to play the sound for.
151
+
152
+
- New `HDFirearm` INI property `PreFireSound`, which allows you to specify a sound that will play exactly once before the weapon fires.
153
+
Note that this was designed primarily for things like flamethrowers, semi-auto weapons may wonky with it, and full-auto weapons may fire multiple shots in the first burst, if you don't also set an `ActivationDelay`.
154
+
155
+
-`SoundSets` have been made a bit more fully featured, they can now have sub `SoundSets` and their own `SoundSelectionCycleMode` and they now have a Lua binding so you can create them in Lua with `local mySoundSet = SoundSet()`.
156
+
They have the following INI and Lua properties:
157
+
158
+
`SoundSelectionCycleMode` (INI and Lua R/W) - Determines how sounds in this `SoundSet` will be selected each time it is played (or when `SelectNextSounds` is called).
159
+
Note that sub `SoundSets` can have different `SoundSelectionCycleModes`. `SoundSets` with sub `SoundSets` and sounds whose `SoundSelectionCycleMode` is `FORWARDS` will first go through their sounds, then each sub `SoundSet`.
160
+
161
+
`soundSet.SubSoundSets` (Lua R) - An iterator over the sub `SoundSets` of this `SoundSet`, allowing you to manipulate them as you would any `SoundSet`.
162
+
`soundSet:HasAnySounds(includeSubSoundSets)` (Lua) - Whether or not this `SoundSet` has any sounds, optionally including its sub `SoundSets`.
163
+
`soundSet:SelectNextSounds()` (Lua) - Selects the next sounds for this `SoundSet`. Note that playing a `SoundContainer` will always also do this, so this is only really useful to allow you to skip sounds when `SoundSelectionCycleMode` is set to `FORWARDS`.
164
+
`soundSet:AddSound("Path/to/sound")` (Lua) - Adds the sound at the given path with no offset, 0 minimum audible distance, and default attenuation start distance.
165
+
`soundSet:AddSound("Path/to/sound", offset, minimumAudibleDistance, attenuationStartDistance)` (Lua) - Adds the sound at the given path with the given parameters.
166
+
`soundSet:AddSoundSet(soundSetToAdd)` (Lua) - Adds the given `SoundSet` as a sub `SoundSet` of this `SoundSet`.
167
+
168
+
Additionally, `AddSound` and `AddSoundSet` INI properties work for `SoundSets`. They are exactly the same as they are for `SoundContainers`.
169
+
170
+
- You can get the top level `SoundSet` of a `SoundContainer` with `soundContainer:GetTopLevelSoundSet` and manipulate it as described above. This allows you full interaction with all levels of `SoundSets` in a `SoundContainer`.
171
+
146
172
### Changed
147
173
148
174
- Codebase now uses the C++17 standard.
@@ -236,6 +262,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
236
262
237
263
-`Scenes` with a `PresetName` containing the strings "Test", "Editor" and "Tutorial" are no longer excluded from the scenarios screen and from the MetaGame.
238
264
265
+
-`SoundContainer` is now a concrete Lua entity. This means it can now be created with `CreateSoundContainer("PresetName", "DataModule.rte")` and has all the standard functionality like cloning, etc.
266
+
To support these changes, a bunch of Lua functionality has been added and modified:
267
+
268
+
`soundContainer.Immobile` - Whether or not the `SoundContainer` is immobile. Immobile sounds are generally used for GUI elements and will never be automatically panned, pitched or attenuated.
269
+
`soundContainer.AttenuationStartDistance` - Formerly INI only, this property is now gettable and settable through Lua. See previous changelog entries for details on it.
270
+
`soundContainer.Pos` - Rather than updating the `SoundContainer's` position through `AudioMan`, you should now use the `Pos` property.
271
+
`soundContainer.Volume` - In addition to attenuation based volume changes, it is now possible to set a `SoundContainer's` overall volume. This works together with volume changes caused by attenuation.
272
+
`soundContainer.Pitch` - Rather than updating the `SoundContainer's` pitch through `AudioMan`, you should now use the `Pitch` property. Also note that this now works properly with the game's global pitch so no complicated handling is necessary.
273
+
274
+
-`AddSound` and `SelectNextSoundSet` Lua bindings have been moved from `SoundContainer` to `SoundSet`. The latter has been renamed and the former have been trimmed down slightly since some complexity is no longer needed. Their speciifcs are mentioned in the `Added` section.
275
+
239
276
### Fixed
240
277
241
278
- Fix crash when returning to `MetaGame` scenario screen after activity end.
@@ -260,6 +297,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
260
297
261
298
- Pressing escape at the options, mod manager, game editors and credits screens no longer quits the game.
262
299
300
+
-`HDFirearm` INI property `DeactivationSound` now works properly instead of constantly playing.
301
+
302
+
- Gold mining sound has been set to restart its playback everytime it's played, making it way less annoying. It's still pretty wonky, but it's better.
303
+
304
+
- Sound panning should now work properly around scene seams. Additionally, sounds should be less stuttery (e.g. distant jetpacks) and generally sound better.
305
+
263
306
### Removed
264
307
265
308
- Removed the ability to remove scripts from objects with Lua. This is no longer needed cause of code efficiency increases.
@@ -276,6 +319,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
276
319
277
320
- Removed `Activity` property `FundsOfTeam#`, use `Team#Funds` instead.
278
321
322
+
- Some functionality has been moved from `AudioMan` to `SoundContainer`. As such, the following `AudioMan` Lua bindings are no longer available:
The lengthy `PlaySound` function should be replaced by making a `SoundContainer` in your `Create` function and setting properties appropriately.
326
+
This can be done by creating one defined INI with `soundContainer = CreateSoundContainer(...)`, or by making an empty one with `soundContainer = SoundContainer()`.
m_ActiveSound.SetAffectedByGlobalPitch(false); //Active sound (i.e. weapon spinup) modifies its pitch, so it has to account for global pitch on its own.
Copy file name to clipboardExpand all lines: Entities/HDFirearm.h
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -741,8 +741,10 @@ ClassInfoGetters
741
741
// Muzzle Flash Attachable. Owned
742
742
Attachable *m_pFlash;
743
743
744
+
SoundContainer m_PreFireSound; //!< The sound this HDFirearm should play before it starts firing. Distinct from activation sound in that it will play exactly once per trigger pull and not pitch up.
744
745
// The audio of this FireArm being fired.
745
746
SoundContainer m_FireSound;
747
+
SoundContainer m_FireEchoSound; //!< The audio that is played as the echo for the gun. Each shot will restart this sound, so it doesn't ever overlap.
746
748
// The audio that is played immediately upon activation, but perhaps before actual first firing, if there's a pre-delay
747
749
SoundContainer m_ActiveSound;
748
750
// The audio that is played immediately upon cease of activation
0 commit comments