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

Commit 892fec7

Browse files
committed
Changelog update - added changes from multiscripts
1 parent 566779b commit 892fec7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ NOTE: Here is a link to [FMOD's Inverse Rolloff Model.](https://fmod.com/resourc
6565
`soundContainer.Loops` - Set or get the number of loops for the `SoundContainer`, as mentioned in the INI section above.
6666
`soundContainer.Priority` - Set or get the priority of the `SoundContainer`, as mentioned in the INI section above.
6767
`soundContainer.AffectedByGlobalPitch` - Set or get whether the `SoundContainer` is affected by global pitch, as mentioned in the INI section above.
68+
69+
- `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))
70+
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.
71+
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);`.
72+
73+
- 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.
78+
79+
- 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.
82+
6883
### Changed
6984

7085
- Codebase now uses the C++14 standard.
@@ -117,6 +132,8 @@ Due to limitations in Allegro 4, changing the actual resolution from within the
117132
- If the current game resolution is half the desktop resolution or less, you will be able to instantly switch between 1X and 2X resolution multiplier modes in the settings without screen flicker or delay.
118133
If the conditions are not met, the mode switch button will show `Unavailable`.
119134

135+
- `PieMenuActor` and `OrbittedCraft` have now been removed. They are instead replaced with parameters in their respective functions, i.e. `OnPieMenu(pieMenuActor);` and `CraftEnteredOrbit(orbittedCraft);`. Their use is otherwise unchanged.
136+
120137
### Fixed
121138

122139
- Fixed LuaBind being all sorts of messed up. All lua bindings now work properly like they were before updating to the v141 toolset.
@@ -135,6 +152,8 @@ If the conditions are not met, the mode switch button will show `Unavailable`.
135152

136153
- The audio system now better supports wrapping maps so sounds handle the seam better. Additionally, the game should be able to function if the audio system fails to start up.
137154

155+
- Scripts on attached attachables will only run if their parent exists in MovableMan. ([Issue #83](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/issues/83))
156+
138157
### Removed
139158

140159
- Removed all Gorilla Audio and SDL Mixer related code and files.

0 commit comments

Comments
 (0)