Skip to content

Commit 1de0ea3

Browse files
Merge branch 'browncoat-mission' of https://github.com/cortex-command-community/Cortex-Command-Community-Project into browncoat-mission
2 parents 17ead25 + 168307f commit 1de0ea3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+337
-179
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6565
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
6666
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
6767

68+
- New `GAScripted` Lua script method `IsCompatibleScene(scene)` to allow Activities to generically decide which Scenes are eligible by returning a boolean value.
69+
New `GAScripted` INI enumerating property `AddRequiredArea`, replacing Lua file scanning, to allow Activities to explicitly state which areas are strictly required.
70+
As before, these work in tandem. Both the required areas, if defined, and script conditional method, if defined, must pass for the scene to qualify.
71+
72+
- New `GameActivity` INI properties `TeamNTechSwitchEnabled` which determine whether activity team factions are configurable by the user. This is most useful for communicating what the player is not intended to change, or what inputs would be ignored otherwise.
73+
6874
- Allow lua scripts to use LuaJIT's BitOp module (see https://bitop.luajit.org/api.html)
6975

7076
</details>
@@ -96,8 +102,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
96102

97103
- The `LimbPath` property `NormalTravelSpeed` has been renamed to just `TravelSpeed`.
98104

105+
- `GameActivity` INI properties `TeamNTech` values switched to lazy eval, allowing them to be validated once all modules are loaded.
106+
As well, the scenario menu activity configuration screen now respects defaults set in INI, where possible.
107+
108+
- Internal GUI element `ComboBox` no longer displays dropdown combobutton when disabled, to communicate visually that it's setting is not modifiable.
109+
99110
- Almost all ctrl+* special inputs functionality (i.e restarting activity, world dumps, showing performance stats) are now mapped to right alt, to not interfere with default crouching inputs. The only exception is ctrl+arrow keys for changing console size.
100111

112+
- Gibs and detached Attachables now inherit the parent's angular velocity, as well as velocity derived from the angular velocity of the parent MO and their offset from the parent's centre. On gibs, this is scaled by `InheritsVel`.
113+
101114
</details>
102115

103116
<details><summary><b>Fixed</b></summary>
@@ -114,7 +127,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
114127

115128
- Fixed an issue where an `Actor`'s MovementState wasn't correctly accessible from script.
116129

117-
- Fixed mounted HeldDevices not respecting InheritedRotAngleOffset by shuffling around some internal properties.
130+
- Fixed mounted HeldDevices not respecting InheritedRotAngleOffset.
131+
132+
- Fixed an issue where internal Lua functions OriginalDoFile, OriginalLoadFile, and OriginalRequire were polluting the global namespace. They have now been made inaccessible.
118133

119134
</details>
120135

@@ -125,6 +140,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
125140

126141
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
127142

143+
- Removed `GAScripted` Lua script method `SceneTest()` as the new Lua function `IsCompatibleScene(scene)` is more capable.
144+
Removed `GAScripted` C++ functionality that would scan the Lua script file to determine which areas are required. `AddRequiredArea` in the INI should be used instead.
145+
Removed `Scene` Lua function `GetOptionalArea` as it functioned identically to `GetArea` aside from triggering the aforementioned (and now removed) Lua script file scanning.
146+
128147
- Removed `AHuman` property `MaxCrouchRotation`. `CrouchRotAngleTarget` is now used instead.
129148

130149
- Deprecated `LimbPath` properties `SlowTravelSpeed`, `NormalTravelSpeed` and `FastTravelSpeed`. For the sake of backwards compatibility they will not crash the game and `NormalTravelSpeed` is a valid synonym for the new `TravelSpeed`.

Data/Base.rte/AI/SharedBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
848848
end
849849
else
850850
-- do we have a target we want to shoot at?
851-
if (AI.Target and AI.canHitTarget and AI.BehaviorName ~= "AttackTarget") then
851+
if Owner.Head and AI.Target and AI.canHitTarget and AI.BehaviorName ~= "AttackTarget" then
852852
-- are we also flying
853853
if AI.flying and Owner.Jetpack.JetpackType == AEJetpack.Standard then
854854
-- predict jetpack movement when jumping and there is a target (check one direction)

Data/Base.rte/Activities.ini

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ AddActivity = GAScripted
5757
RequireClearPathToOrbitSwitchEnabled = 1
5858
FogOfWarSwitchEnabled = 1
5959
DeployUnitsSwitchEnabled = 1
60+
AddRequiredArea = Red Brain
61+
AddRequiredArea = Green Brain
6062
6163
6264
AddActivity = GAScripted
@@ -109,6 +111,8 @@ AddActivity = GAScripted
109111
RequireClearPathToOrbitSwitchEnabled = 1
110112
FogOfWarSwitchEnabled = 1
111113
DeployUnitsSwitchEnabled = 1
114+
AddRequiredArea = LZ Attacker
115+
AddRequiredArea = Main Bunker
112116
113117
114118
AddActivity = GAScripted
@@ -126,6 +130,8 @@ AddActivity = GAScripted
126130
RequireClearPathToOrbitSwitchEnabled = 1
127131
FogOfWarSwitchEnabled = 1
128132
DeployUnitsSwitchEnabled = 1
133+
AddRequiredArea = LZ Team 1
134+
AddRequiredArea = LZ All
129135
130136
131137
AddActivity = GAScripted
@@ -149,6 +155,8 @@ AddActivity = GAScripted
149155
RequireClearPathToOrbitSwitchEnabled = 0
150156
FogOfWarSwitchEnabled = 1
151157
DeployUnitsSwitchEnabled = 1
158+
AddRequiredArea = LZ Team 1
159+
AddRequiredArea = LZ All
152160
153161
154162
AddActivity = GAScripted
@@ -172,7 +180,8 @@ AddActivity = GAScripted
172180
RequireClearPathToOrbitSwitchEnabled = 0
173181
FogOfWarSwitchEnabled = 1
174182
DeployUnitsSwitchEnabled = 1
175-
183+
AddRequiredArea = LZ Team 1
184+
AddRequiredArea = LZ All
176185
177186
178187
AddActivity = GAScripted
@@ -197,8 +206,9 @@ AddActivity = GAScripted
197206
RequireClearPathToOrbitSwitchEnabled = 0
198207
FogOfWarSwitchEnabled = 0
199208
DeployUnitsSwitchEnabled = 0
209+
AddRequiredArea = OneManArmyZeroGCompatibilityArea
210+
200211
201-
// Path to orbit guaranteed by currently being in orbit.
202212
AddActivity = GAScripted
203213
PresetName = One-Man Army (Diggers, 0-G)
204214
Description = Survive with only one unit and no backups in a Zero-G void! The enemy will only use diggers, but the harder the difficulty the less potent weaponry you start out with, and the longer you have to survive.
@@ -237,6 +247,8 @@ AddActivity = GAScripted
237247
RequireClearPathToOrbitSwitchEnabled = 1
238248
FogOfWarSwitchEnabled = 1
239249
DeployUnitsSwitchEnabled = 1
250+
AddRequiredArea = LZ Team 1
251+
AddRequiredArea = LZ All
240252
241253
242254
AddActivity = GAScripted
@@ -253,6 +265,8 @@ AddActivity = GAScripted
253265
RequireClearPathToOrbitSwitchEnabled = 1
254266
FogOfWarSwitchEnabled = 1
255267
DeployUnitsSwitchEnabled = 1
268+
AddRequiredArea = LZ Team 1
269+
AddRequiredArea = LZ All
256270
257271
258272
AddActivity = GAScripted
@@ -270,6 +284,8 @@ AddActivity = GAScripted
270284
RequireClearPathToOrbitSwitchEnabled = 0
271285
FogOfWarSwitchEnabled = 1
272286
DeployUnitsSwitchEnabled = 1
287+
AddRequiredArea = LZ Team 1
288+
AddRequiredArea = LZ All
273289
274290
275291
///////////////////////////////////////////////////////////////////////

Data/Base.rte/Activities/BunkerBreach.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function BunkerBreach:SetupDefenderBrains()
8484
end
8585

8686
defenderBrain = self:CreateBrainBot(self.defenderTeam);
87-
defenderBrain.Pos = SceneMan.Scene:GetOptionalArea("Brain"):GetCenterPoint();
87+
defenderBrain.Pos = SceneMan.Scene:GetArea("Brain"):GetCenterPoint();
8888
MovableMan:AddActor(defenderBrain);
8989
else
9090
-- Pick the defender brain randomly from among those created by deployments, then delete the others and clean up most of their guards.
@@ -99,7 +99,7 @@ function BunkerBreach:SetupDefenderBrains()
9999
table.remove(deploymentBrains, brainIndexToChoose);
100100

101101
if SceneMan.Scene:HasArea("Brain Chamber") then
102-
self.brainChamber = SceneMan.Scene:GetOptionalArea("Brain Chamber");
102+
self.brainChamber = SceneMan.Scene:GetArea("Brain Chamber");
103103
end
104104
for _, unchosenDeploymentBrain in pairs(deploymentBrains) do
105105
unchosenDeploymentBrain.ToDelete = true;
@@ -167,7 +167,7 @@ function BunkerBreach:SetupDefenderActors()
167167
for _, loadoutName in pairs({"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"}) do
168168
if SceneMan.Scene:HasArea(loadoutName .. " Defenders") then
169169
hasSpawnAreas = true;
170-
local defenderArea = SceneMan.Scene:GetOptionalArea(loadoutName .. " Defenders");
170+
local defenderArea = SceneMan.Scene:GetArea(loadoutName .. " Defenders");
171171
if defenderArea ~= nil then
172172
for defenderBox in defenderArea.Boxes do
173173
local guard;
@@ -226,7 +226,7 @@ end
226226

227227
function BunkerBreach:SetupDefenderInternalReinforcementAreas()
228228
if self.AI.isDefenderTeam then
229-
local internalReinforcementsArea = SceneMan.Scene:GetOptionalArea("Internal Reinforcements");
229+
local internalReinforcementsArea = SceneMan.Scene:GetArea("Internal Reinforcements");
230230
if internalReinforcementsArea ~= nil then
231231
self.AI.internalReinforcementsDoorParticle = CreateMOSRotating("Background Door", "Base.rte");
232232
self.AI.internalReinforcementPositions = {};
@@ -248,7 +248,7 @@ function BunkerBreach:StartActivity(isNewGame)
248248
local attackerLZ = SceneMan.Scene:GetArea("LZ Attacker");
249249
self:SetLZArea(self.attackerTeam, attackerLZ);
250250
if SceneMan.Scene:HasArea("LZ Defender") then
251-
self:SetLZArea(self.defenderTeam, SceneMan.Scene:GetOptionalArea("LZ Defender"));
251+
self:SetLZArea(self.defenderTeam, SceneMan.Scene:GetArea("LZ Defender"));
252252
end
253253
self.mainBunkerArea = SceneMan.Scene:GetArea("Main Bunker");
254254

Data/Base.rte/Activities/Siege.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Siege:StartActivity()
6565
--end
6666

6767
if SceneMan.Scene:HasArea("Brain") then
68-
playerBrainsLocation = SceneMan.Scene:GetOptionalArea("Brain"):GetCenterPoint();
68+
playerBrainsLocation = SceneMan.Scene:GetArea("Brain"):GetCenterPoint();
6969
else
7070
-- Look for a brain among actors created by the deployments
7171
for actor in MovableMan.AddedActors do
@@ -98,7 +98,7 @@ function Siege:StartActivity()
9898
end
9999

100100
if SceneMan.Scene:HasArea("Brain Chamber") then
101-
self.BrainChamber = SceneMan.Scene:GetOptionalArea("Brain Chamber");
101+
self.BrainChamber = SceneMan.Scene:GetArea("Brain Chamber");
102102

103103
-- Set all useless actors, i.e. those who should guard brain in the brain chamber but their brain is in another castle
104104
-- to delete themselves, because otherwise they are most likely to stand there for the whole battle and waste MOs
@@ -112,7 +112,7 @@ function Siege:StartActivity()
112112
end
113113

114114
if SceneMan.Scene:HasArea("Perimeter") then
115-
self.Perimeter = SceneMan.Scene:GetOptionalArea("Perimeter");
115+
self.Perimeter = SceneMan.Scene:GetArea("Perimeter");
116116
--print ("Perimeter defined");
117117
end
118118

Data/Base.rte/Activities/Utility/DockingHandler.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ function DockingHandler:Initialize(activity, newGame, autoAssignUnknownDropships
9393

9494
local i = 1;
9595

96-
while SceneMan.Scene:GetOptionalArea("Dropship Dock " .. i) do
96+
while SceneMan.Scene:GetArea("Dropship Dock " .. i) do
9797
self.mainTable.activeDSDockTable[i] = {["dockPosition"] = SceneMan.Scene:GetArea("Dropship Dock " .. i).Center,
9898
["activeCraft"] = nil,
9999
["dockingStage"] = nil};
100100
i = i + 1;
101101
-- Jump two if needed, the player may want to avoid overlap as per above instructions
102-
if SceneMan.Scene:GetOptionalArea("Dropship Dock " .. i) then
103-
elseif SceneMan.Scene:GetOptionalArea("Dropship Dock " .. i + 1) then
102+
if SceneMan.Scene:GetArea("Dropship Dock " .. i) then
103+
elseif SceneMan.Scene:GetArea("Dropship Dock " .. i + 1) then
104104
i = i + 1;
105105
end
106106

@@ -111,13 +111,13 @@ function DockingHandler:Initialize(activity, newGame, autoAssignUnknownDropships
111111

112112
i = 1;
113113

114-
while SceneMan.Scene:GetOptionalArea("Rocket Dock " .. i) do
114+
while SceneMan.Scene:GetArea("Rocket Dock " .. i) do
115115
self.mainTable.activeRocketDockTable[i] = {["dockPosition"] = SceneMan.Scene:GetArea("Rocket Dock " .. i).Center,
116116
["activeCraft"] = nil,
117117
["dockingStage"] = nil};
118118
i = i + 1;
119-
if SceneMan.Scene:GetOptionalArea("Rocket Dock " .. i) then
120-
elseif SceneMan.Scene:GetOptionalArea("Rocket Dock " .. i + 1) then
119+
if SceneMan.Scene:GetArea("Rocket Dock " .. i) then
120+
elseif SceneMan.Scene:GetArea("Rocket Dock " .. i + 1) then
121121
i = i + 1;
122122
end
123123
end

Data/Base.rte/Activities/Utility/SaveLoadHandler.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function SaveLoadHandler:ParseTableForAreas(tab)
261261
for k, v in pairs(tab) do
262262
if type(v) == "string" and string.find(v, "SAVELOADHANDLERAREA_") then
263263
local areaName = string.sub(v, 21, -1);
264-
local area = SceneMan.Scene:GetOptionalArea(areaName);
264+
local area = SceneMan.Scene:GetArea(areaName);
265265
tab[k] = area;
266266
elseif type(v) == "table" then
267267
self:ParseTableForAreas(v);

Data/Base.rte/Activities/WaveDefense.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ function WaveDefense:UpdateActivity()
274274
end
275275

276276
-- Reveal the main bunker area for the defender.
277-
local mainBunkerArea = SceneMan.Scene:GetOptionalArea("Main Bunker");
277+
local mainBunkerArea = SceneMan.Scene:GetArea("Main Bunker");
278278
if mainBunkerArea ~= nil then
279279
for mainBunkerBox in mainBunkerArea.Boxes do
280280
SceneMan:RevealUnseenBox(mainBunkerBox.Corner.X, mainBunkerBox.Corner.Y, mainBunkerBox.Width, mainBunkerBox.Height, self.playerTeam);
9.1 KB
Loading
9.13 KB
Loading

0 commit comments

Comments
 (0)