Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 8012efd

Browse files
authored
Update changelog - formatting changes
Making big ini and lua blocks more readable
1 parent ddfa460 commit 8012efd

File tree

1 file changed

+62
-18
lines changed

1 file changed

+62
-18
lines changed

CHANGELOG.md

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,94 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3535
```
3636
AddSoundContainer = SoundContainer // Note that SoundContainers replace Sounds, so this can be used for things like FireSound = SoundContainer
3737
PresetName = Preset Name Here
38+
3839
CycleMode = MODE_RANDOM (default) | MODE_FORWARDS // How the SoundContainer will cycle through its `SoundSets` whenever it's told to select a new one. The former is prior behaviour, the latter cycles through SoundSets in the order they were added.
40+
3941
LoopSetting = -1 | 0 (default) | 1+ // How the SoundContainer loops its sounds. -1 means it loops forever, 0 means it plays once, any number > 0 means it plays once and loops that many times.
42+
4043
Immobile = 0 (default) | 1 // Whether or not the SoundContainer's sounds should be treated as immobile. Immobile sounds are generally used for UI and system sounds; they will always play at full volume and will not be panned or affected by global pitch during game slowdown.
44+
4145
AttenuationStartDistance = Number (default -1) // The distance at which the SoundContainer's sounds will start to attenuate out, any number < 0 set it to the game's default. Attenuation calculations follows FMOD's Inverse Rolloff model, which you can find linked below.
46+
4247
Priority = 0 - 256 (default 128) // The priority at which the SoundContainer's sounds will be played, between 0 (highest priority) and 256 (lowest priority). Lower priority sounds are less likely to be played are a lot of sounds playing.
48+
4349
AffectedByGlobalPitch = 0 | 1 (default) // Whether or not the SoundContainer's sounds will be affected by global pitch, or only change pitch when manually made to do so via Lua (note that pitch setting is done via AudioMan).
50+
4451
AddSoundSet = SoundSet // This adds a SoundSet containing one or more sounds to the SoundContainer.
52+
4553
AddSound = ContentFile // This adds a sound to the SoundSet, allowing it to be customized as shown.
4654
Filepath = "SomeRte.rte/Path/To/Sound.wav"
55+
4756
Offset = Vector // This specifies where the sound plays with respect to its SoundContainer. This allows, for example, different sounds in a gun's reload to come from slightly different locations.
4857
X = Number
4958
Y = Number
59+
5060
AttenuationStartDistance = Number // This functions identically to SoundContainer AttenuationStartDistance, allowing you to override it for specific sounds in the SoundContainer.
61+
5162
MinimumAudibleDistance = Number (default 0) // This allows you to make a sound not play while the listener is within a certain distance, e.g. for gunshot echoes. It is automatically accounted for in sound attenuation.
63+
5264
AddSound = "SomeRte.rte/Path/To/AnotherSound.wav" // This adds a sound to the SoundSet in oneline, allowing it to be compactly added (without customisation).
65+
5366
AddSound = "SomeRte.rte/Path/To/YetAnotherSound.wav" // This adds a sound to the SoundContainer, creating a new SoundSet for it with just this sound.
5467
```
5568
NOTE: Here is a link to [FMOD's Inverse Rolloff Model.](https://fmod.com/resources/documentation-api?version=2.0&page=white-papers-3d-sounds.html#inverse)
5669

57-
- `SoundContainer` Lua controls have been overhauled, allowing for more control in playing and replaying them. The following Lua bindings are available:
58-
`soundContainer:HasAnySounds()` - Returns whether or not the `SoundContainer` has any sounds in it. True or false.
59-
`soundContainer:IsBeingPlayed()` - Returns whether or not any sounds in the `SoundContainer` are currently being played. True or False.
60-
`soundContainer:Play(optionalPosition, optionalPlayer)` - Plays the sounds belonging to the `SoundContainer's` currently selected `SoundSet`. The sound will play at the position and for the player specified, or at (0, 0) for all players if parameters aren't specified.
61-
`soundContainer:Stop(optionalPlayer)` - Stops any playing sounds belonging to the `SoundContainer`, optionally only stopping them for a specified player.
62-
`soundContainer:AddSound(filePath, optional soundSetToAddSoundTo, optionalSoundOffset, optionalAttenuationStartDistance, optionalAbortGameIfSoundIsInvalid)` - Adds the sound at the given filepath to the `SoundContainer`. If a `SoundSet` index is specified it'll add it to that `SoundSet`. If an offset or attenuation start distance are specified they'll be set, as mentioned in the INI section above. If set to abort for invalid sounds, the game will error out if it can't load the sound, otherwise it'll show a console error.
63-
`soundContainer:SetPosition(position)` - Sets the position at which the `SoundContainer's` sounds will play.
64-
`soundContainer:SelectNextSoundSet()` - Selects the next `SoundSet` to play when `soundContainer:Play(...)` is called, according to the INI defined `CycleMode`.
65-
`soundContainer.Loops` - Set or get the number of loops for the `SoundContainer`, as mentioned in the INI section above.
66-
`soundContainer.Priority` - Set or get the priority of the `SoundContainer`, as mentioned in the INI section above.
67-
`soundContainer.AffectedByGlobalPitch` - Set or get whether the `SoundContainer` is affected by global pitch, as mentioned in the INI section above.
68-
70+
- `SoundContainer` Lua controls have been overhauled, allowing for more control in playing and replaying them. The following Lua bindings are available:
71+
```
72+
soundContainer:HasAnySounds() - Returns whether or not the SoundContainer has any sounds in it. Returns True or false.
73+
```
74+
```
75+
soundContainer:IsBeingPlayed() - Returns whether or not any sounds in the SoundContainer are currently being played. Returns True or False.
76+
```
77+
```
78+
soundContainer:Play(optionalPosition, optionalPlayer) - Plays the sounds belonging to the SoundContainer's currently selected SoundSet. The sound will play at the position and for the player specified, or at (0, 0) for all players if parameters aren't specified.
79+
```
80+
```
81+
soundContainer:Stop(optionalPlayer) - Stops any playing sounds belonging to the SoundContainer, optionally only stopping them for a specified player.
82+
```
83+
```
84+
soundContainer:AddSound(filePath, optional soundSetToAddSoundTo, optionalSoundOffset, optionalAttenuationStartDistance, optionalAbortGameIfSoundIsInvalid) - Adds the sound at the given filepath to the SoundContainer. If a SoundSet index is specified it'll add it to that SoundSet. If an offset or attenuation start distance are specified they'll be set, as mentioned in the INI section above. If set to abort for invalid sounds, the game will error out if it can't load the sound, otherwise it'll show a console error.
85+
```
86+
```
87+
soundContainer:SetPosition(position) - Sets the position at which the SoundContainer's sounds will play.
88+
```
89+
```
90+
soundContainer:SelectNextSoundSet() - Selects the next SoundSet to play when soundContainer:Play(...) is called, according to the INI defined CycleMode.
91+
```
92+
```
93+
soundContainer.Loops - Set or get the number of loops for the SoundContainer, as mentioned in the INI section above.
94+
```
95+
```
96+
soundContainer.Priority - Set or get the priority of the SoundContainer, as mentioned in the INI section above.
97+
```
98+
```
99+
soundContainer.AffectedByGlobalPitch - Set or get whether the SoundContainer is affected by global pitch, as mentioned in the INI section above.
100+
```
69101
- `MovableObjects` can now run multiple scripts by putting multiple `AddScript = FilePath.lua` lines in the INI definition. ([Issue #109](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/pull/109))
70102
Scripts will have their appropriate functions run in the order they were added. Note that all scripts share the same `self`, so care must be taken when naming self variables.
71103
Scripts can be checked for with `movableObject:HasScript(filePath);` and added and removed with `movableObject:AddScript(filePath);` and `movableObject:RemoveScript(filePath);`. They can also be enabled and disabled in Lua (preserving their ordering) with `movableObject:EnableScript(filePath);` and `movableObject:DisableScript(filePath);`.
72104

73105
- Scripts on `MovableObjects` and anything that extends them (i.e. most things) now support the following new functions (in addition to `Create`, `Update`, `Destroy` and `OnPieMenu`). They are added in the same way as the aforementioned scripts:
74-
`OnScriptRemoveOrDisable(self, scriptWasRemoved)` - This is run when the script is removed or disabled. `scriptWasRemoved` will be True if the script was removed and False if it was disabled.
75-
`OnScriptEnable(self)` - This is run when the script was disabled and has been enabled.
76-
`OnCollideWithTerrain(self, terrainMaterial)` - This is run when the `MovableObject` this script on is in contact with terrain. `terrainMaterial` gives you the material ID for the terrain collided with. It is suggested to disable this script when not needed to save on overhead, as it will be run a lot!
77-
`OnCollideWithMO(self, collidedMO, collidedRootMO)` - This is run when the `MovableObject` this script is on is in contact with another `MovableObject`. `collidedMO` gives you the `MovableObject` that was collided with, and `collidedRootMO` gives you the root `MovableObject` of that `MovableObject` (note that they may be the same). Collisions with `MovableObjects` that share the same root `MovableObject` will not call this function.
106+
```
107+
OnScriptRemoveOrDisable(self, scriptWasRemoved) - This is run when the script is removed or disabled. The scriptWasRemoved parameter will be True if the script was removed and False if it was disabled.
108+
```
109+
```
110+
OnScriptEnable(self) - This is run when the script was disabled and has been enabled.
111+
```
112+
```
113+
OnCollideWithTerrain(self, terrainMaterial) - This is run when the MovableObject this script on is in contact with terrain. The terrainMaterial parameter gives you the material ID for the terrain collided with. It is suggested to disable this script when not needed to save on overhead, as it will be run a lot!
114+
```
115+
```
116+
OnCollideWithMO(self, collidedMO, collidedRootMO) - This is run when the MovableObject this script is on is in contact with another MovableObject. The collidedMO parameter gives you the MovableObject that was collided with, and the collidedRootMO parameter gives you the root MovableObject of that MovableObject (note that they may be the same). Collisions with MovableObjects that share the same root MovableObject will not call this function.
117+
```
78118

79119
- Scripts on `Attachables` now support the following new functions:
80-
`OnAttach(self, newParent)` - This is run when the `Attachable` this script is on is attached to a new parent object. `newParent` gives you the object the `Attachable` is now attached to.
81-
`OnDetach(self, exParent)` - This is run when the `Attachable` this script is on is detached from an object. `exParent` gives you the object the `Attachable` was attached to.
120+
```
121+
OnAttach(self, newParent) - This is run when the Attachable this script is on is attached to a new parent object. The newParent parameter gives you the object the Attachable is now attached to.
122+
```
123+
```
124+
OnDetach(self, exParent) - This is run when the Attachable this script is on is detached from an object. The exParent gives you the object the Attachable was attached to.
125+
```
82126

83127
### Changed
84128

0 commit comments

Comments
 (0)