Skip to content

Commit fdef918

Browse files
committed
Merge branch 'development' into zip-save-files
2 parents 920f01a + b6e5c5d commit fdef918

File tree

1,336 files changed

+469109
-91262
lines changed

Some content is hidden

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

1,336 files changed

+469109
-91262
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ concurrency:
1919
jobs:
2020
meson:
2121
uses: ./.github/workflows/meson.yml
22-
23-
msbuild:
24-
uses: ./.github/workflows/msbuild.yml
2522

26-
format:
27-
uses: ./.github/workflows/clang-format.yml
23+
msbuild:
24+
uses: ./.github/workflows/msbuild.yml

.github/workflows/meson.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
echo "::group::Installing pkg-config"
179179
sudo apt install pkg-config
180180
echo "::group::Installing mac deps"
181-
omp install libsdl2 onetbb lz4 libpng minizip luajit flac
181+
omp install libsdl2 libsdl2_image onetbb lz4 libpng minizip luajit flac
182182
echo "OSXCROSS_PKG_CONFIG_PATH=${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/pkgconfig" >> $GITHUB_ENV
183183
echo "::endgroup::"
184184
echo "::group::Installing meson"

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"request": "launch",
1414
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand",
1515
"cwd": "${workspaceFolder}",
16-
"preLaunchTask": "meson Build Release",
16+
"preLaunchTask": "Meson: Build all targets",
1717
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
1818
"presentation": {
1919
"group": "unix"

CHANGELOG.md

Lines changed: 103 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
New `Actor` Lua property `JumpHeight` (R) to estimate the jump height of the actor (in metres), based on the actor's jetpack and weight. Actors without a jetpack return 0.
1717
The new function `GetPathFindingFlyingJumpHeight()` can be used to get a jumpHeight that allows flying (i.e infinite jump height). This is also the value that `ACRocket`s and `ACDropships` return for `JumpHeight`.
1818

19+
- Improved locomotion.
20+
Added the ability to run. When running, you cannot sharpaim whatsoever.
21+
Added the ability to manually crouch. When crouching, your sharpaim distance is slightly increased.
22+
Players on PC can enable running by holding the shift key, or crouch by holding control. Players using the arrow keys can use right ctrl/shift. Controllers can run by clicking in the left stick, or crouch by holding the left stick down. Prone on controllers is now performed by clicking in the right stick. SNES/d-pad controllers run using the right bumper.
23+
Prone input now immediately throws you to the ground instead of crouching first.
24+
Added new `MovementState` type `RUN` for scripts.
25+
Added new `Controller` state `WALKCROUCH` for crouching, and `PRONE` for prone. The existing `CROUCH` state has been deprecated, as it referred to PRONE.
26+
Added new `Actor` INI and Lua (R/W) property `CanRun` which denotes whether the Actor can run or not.
27+
Added new `Actor` INI and Lua (R/W) property `CrouchWalkSpeedMultiplier` which is a walking speed multiplier when at max crouch amount.
28+
1929
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
2030
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.
2131
`SetNextDynamicSongSection(string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to queue a new DynamicSongSection for the currently playing song.
@@ -32,28 +42,91 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3242
Lua property `Paused` (R/W) to pause or unpause all sounds of a SoundContainer. Newly played sounds will not begin playback until unpaused.
3343
Lua function `GetAudibleVolume` to get the real audible volume of a SoundContainer's sounds as a float from 0 to 1. This accounts for literally everything, including game volume.
3444

45+
- New `LimbPath` features.
46+
New `LimbPath` INI and Lua (R/W) property `BaseTravelSpeedMultiplier` which is a multiplier on the TravelSpeed of that LimbPath, on top of any other gameplay multipliers like from crouching.
47+
New `LimbPath` INI and Lua (R/W) property `BaseScaleMultiplier`, which is a vector. This will scale the X/Y axes of the limbpath accordingly, allowing for easily adjusting limbpaths to differently sized actors, on top of any other gameplay multipliers like from running.
48+
New `LimbPath` INI property `SegmentEndedThreshold`, which defines the distance the limb must be from the end of the segment before it's considered complete. This defaults to 2.5.
49+
Exposed `LimbPath` properties `TravelSpeed` and `PushForce` to Lua (R/W).
50+
51+
- New `AEmitter` and `PEmitter` INI and Lua (R/W) property `PlayBurstSound` which denotes whether the BurstSound should play when appropriate. This should not be confused for a trigger - it's just a enable/disable toggle to avoid having to remove and add BurstSound altogether.
52+
53+
- New `MOSprite` INI and Lua (R/W) integer property `ForcedHFlip` which forces a certain flippedness and disallows anything else from ever changing it without clearing the forced value first. 0 is forced not flipped, 1 forced flipped, and -1 is no force.
54+
55+
- New hotkey bindings.
56+
On Mouse+KB PC the defaults are: Weapon Primary Hotkey on V, Weapon Auxiliary Hotkey on H, Actor Primary Hotkey on X, Actor Auxiliary Hotkey on O.
57+
Added new `Controller` states `WEAPON_PRIMARY_HOTKEYSTART`, `WEAPON_AUXILIARY_HOTKEYSTART`, `ACTOR_PRIMARY_HOTKEYSTART`, `ACTOR_AUXILIARY_HOTKEYSTART`, `WEAPON_PRIMARY_HOTKEY`, `WEAPON_AUXILIARY_HOTKEY`, `ACTOR_PRIMARY_HOTKEY`, `ACTOR_AUXILIARY_HOTKEY`
58+
59+
- New hotkey system for `Actor` and `HeldDevice`.
60+
Pressing a certain new hotkey will mark it as activated on `Actor` and `HeldDevice`, letting scripts make use of the new bindings easily.
61+
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
62+
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, ACTORHOTKEYTYPECOUNT = 2`.
63+
Both `Actor` and `HeldDevice` have the following functions:
64+
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
65+
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
66+
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
67+
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+
3574
- Allow lua scripts to use LuaJIT's BitOp module (see https://bitop.luajit.org/api.html)
36-
75+
76+
- New `Emission` INI and Lua (R/W) property `ParticleCount` which sets how many particles the Emission spawns per emission. Defaults to 1.
77+
78+
- New `Gib` and `Emission` INI and Lua (R/W) property `InheritsAngularVel`, which determines how much of the parent MO's angular velocity they inherit. Defaults to 1 for gibs, 0 for emissions.
79+
80+
- New `Attachable` INI and Lua (R/W) properties `InheritsVelWhenDetached` and `InheritsAngularVelWhenDetached`, which determine how much of these velocities an attachable inherits from its parent when detached. Defaults to 1.
81+
82+
- New `ACraft` INI and Lua (R/W) property `CanEnterOrbit`, which determines whether a craft can enter orbit (and refund gold appropriately) or not. If false, default out-of-bounds deletion logic applies.
83+
3784
</details>
3885

3986
<details><summary><b>Changed</b></summary>
4087

41-
- Conquest activities will once again fall-back to using base dropships and rockets if a random selection of the selected tech's craft can't find one capable of carrying passengers and/or cargo.
42-
43-
- All music-related functionality from AudioMan has been removed due to the addition of the MusicMan. Generic DynamicSongs have been put in to use instead.
44-
Mod activities that used to queue up all the vanilla music should now instead call, for example, `MusicMan:PlayDynamicSong("Generic Battle Music")`
88+
- Improved navigation, making running and fast walkpaths much more consistent.
4589

4690
- Increased fog-of-war resolution in all vanilla activities, and conquest, from 20x20 to 4x4.
47-
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as course as 20x20.
91+
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as coarse as 20x20.
4892
The fog-of-war revealing code is now multithreaded to increase performance.
4993

5094
- All vanilla scenario activities have had their settings polished, respecting settings which make sense and disabling settings which don't.
5195
You can now have fog of war in the test scene, and can no longer require path to orbit in Zero-G Diggers-Only One Man Army.
5296

53-
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
97+
- Conquest activities will once again fall-back to using base dropships and rockets if a random selection of the selected tech's craft can't find one capable of carrying passengers and/or cargo.
5498

5599
- `MovableMan:OpenAllDoors()`, when passed `NOTEAM`, will now open/close doors specifically for `NOTEAM` (instead of all doors).
56100

101+
- MOs now only play the BurstSound of the first Wound they receive in a frame, which not only solves audio spam during e.g. explosions but also preserves intended audio when firing guns with a high ParticleCount at them.
102+
103+
- Changed how Get and SetLimbPathSpeed/PushForce work for `AHuman` and `ACrab`. The functions are as following:
104+
`GetLimbPathSpeed` has been renamed to `GetLimbPathTravelSpeed`.
105+
`SetLimbPathSpeed` has been renamed to `SetLimbPathTravelSpeed`.
106+
`GetLimbPathTravelSpeed(Actor.MovementState)` returns the FG/left side (for crabs) limb path travel speed for that specific movement state, instead of being hardcoded to walking only.
107+
`SetLimbPathTravelSpeed(Actor.MovementState, float newValue)` sets the travel speed for all layers and sides of any particular movement state's limb paths, instead of being hardcoded to walking only.
108+
`GetLimbPathPushForce(Actor.MovementState)` returns the FG/left side (for crabs) limb path push force for that specific movement state, instead of being hardcoded to walking only.
109+
`SetLimbPathPushForce(Actor.MovementState, float newValue)` sets the push force for all layers and sides of any particular movement state's limb paths, instead of being hardcoded to walking only.
110+
111+
- The `LimbPath` property `NormalTravelSpeed` has been renamed to just `TravelSpeed`.
112+
113+
- `GameActivity` INI properties `TeamNTech` values switched to lazy eval, allowing them to be validated once all modules are loaded.
114+
As well, the scenario menu activity configuration screen now respects defaults set in INI, where possible.
115+
116+
- Internal GUI element `ComboBox` no longer displays dropdown combobutton when disabled, to communicate visually that it's setting is not modifiable.
117+
118+
- 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.
119+
120+
- `Gib`s and detached `Attachable`s now inherit the parent's angular velocity by default.
121+
122+
- `InheritsVel` now accounts for the angular velocity of the parent MO, resulting in offset gibs and emissions being flung further away.
123+
124+
- `InheritsVel` and its ilk have been uncapped, allowing users to set them outside of 0-1.
125+
126+
- `Scene` Lua functions `AddNavigatableArea(areaName)` and `ClearNavigatableAreas()` have been renamed/corrected to `AddNavigableArea(areaName)` and `ClearNavigableAreas()`, respectively.
127+
128+
- `MOSRotating` Lua function `AddWound` now additionally accepts the format `MOSRotating:AddWound(AEmitter* woundToAdd, const Vector& parentOffsetToSet, bool checkGibWoundLimit, bool isEntryWound, bool isExitWound)`, allowing modders to specify added wounds as entry- or exit wounds, for the purpose of not playing multiple burst sounds on the same frame. These new arguments are optional.
129+
57130
</details>
58131

59132
<details><summary><b>Fixed</b></summary>
@@ -68,6 +141,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
68141

69142
- Fixed a bug in Harvester and Massacre where setting deploy units would auto-assign units of the wrong tech.
70143

144+
- Fixed an issue where an `Actor`'s MovementState wasn't correctly accessible from script.
145+
146+
- Fixed mounted HeldDevices not respecting InheritedRotAngleOffset.
147+
148+
- Fixed an issue where internal Lua functions OriginalDoFile, OriginalLoadFile, and OriginalRequire were polluting the global namespace. They have now been made inaccessible.
149+
150+
</details>
151+
152+
<details><summary><b>Removed</b></summary>
153+
154+
- All music-related functionality from AudioMan has been removed due to the addition of the MusicMan. Generic DynamicSongs have been put in to use instead.
155+
Mod activities that used to queue up all the vanilla music should now instead call, for example, `MusicMan:PlayDynamicSong("Generic Battle Music")`
156+
157+
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
158+
159+
- Removed `GAScripted` Lua script method `SceneTest()` as the new Lua function `IsCompatibleScene(scene)` is more capable.
160+
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.
161+
Removed `Scene` Lua function `GetOptionalArea` as it functioned identically to `GetArea` aside from triggering the aforementioned (and now removed) Lua script file scanning.
162+
163+
- Removed `AHuman` property `MaxCrouchRotation`. `CrouchRotAngleTarget` is now used instead.
164+
165+
- 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`.
166+
71167
</details>
72168

73169
## [Release v6.2.2] - 2024/02/24

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function HumanBehaviors.ShootTarget(AI, Owner, Abort)
12231223
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.Pos, AI.Target.Pos, false).Normalized;
12241224
if AI.lateralMoveState == Actor.LAT_STILL then
12251225
AI.proneState = AHuman.PRONE;
1226-
--AI.Ctrl:SetState(Controller.BODY_CROUCH, true);
1226+
--AI.Ctrl:SetState(Controller.BODY_PRONE, true);
12271227
end
12281228
elseif Owner:EquipFirearm(true) then
12291229
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame, just in case the magazine is replenished by another script

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function NativeHumanAI:Create(Owner)
1717
Members.fire = false;
1818
Members.groundContact = 5;
1919
Members.flying = false;
20+
Members.running = false;
2021

2122
Members.squadShoot = false;
2223
Members.useMedikit = false;
@@ -29,6 +30,9 @@ function NativeHumanAI:Create(Owner)
2930
Members.SquadShootTimer = Timer();
3031
Members.SquadShootDelay = math.random(50,100);
3132

33+
Members.RunStateTimer = Timer();
34+
Members.RunStateTimer:SetSimTimeLimitMS(math.random(2000,5000));
35+
3236
Members.AlarmTimer = Timer();
3337
Members.AlarmTimer:SetSimTimeLimitMS(400);
3438

@@ -336,6 +340,18 @@ function NativeHumanAI:Update(Owner)
336340
end
337341
end
338342

343+
local AlarmPoint = Owner:GetAlarmPoint();
344+
345+
-- If we currently have a target or are alerted, we walk. Otherwise we run
346+
-- We also have a small random chance to walk for a lil bit
347+
local wasAlarmed = AlarmPoint.Largest > 0;
348+
if wasAlarmed or self.RunStateTimer:IsPastSimTimeLimit() then
349+
self.running = self.Target == nil and not wasAlarmed and math.random() < 0.6;
350+
self.RunStateTimer:Reset();
351+
end
352+
353+
self.Ctrl:SetState(Controller.MOVE_FAST, self.running);
354+
339355
self.squadShoot = false;
340356
if Owner.MOMoveTarget then
341357
-- make the last waypoint marker stick to the MO we are following
@@ -361,7 +377,7 @@ function NativeHumanAI:Update(Owner)
361377
local dist = SceneMan:ShortestDistance(Owner.Pos, Leader.Pos, false).Largest;
362378
local radius = (Leader.Height + Owner.Height) * 0.5;
363379
if dist < radius then
364-
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_CROUCH};
380+
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_PRONE};
365381
for _, control in pairs(copyControls) do
366382
local state = Leader:GetController():IsState(control);
367383
self.Ctrl:SetState(control, state);
@@ -547,7 +563,6 @@ function NativeHumanAI:Update(Owner)
547563
end
548564

549565
-- listen and react to AlarmEvents and AlarmPoints
550-
local AlarmPoint = Owner:GetAlarmPoint();
551566
if AlarmPoint.Largest > 0 then
552567
if not self.Target and not self.UnseenTarget then
553568
self.AlarmPos = Vector(AlarmPoint.X, AlarmPoint.Y);
@@ -634,7 +649,7 @@ function NativeHumanAI:Update(Owner)
634649
if self.proneState == AHuman.GOPRONE then
635650
self.proneState = AHuman.PRONE;
636651
elseif self.proneState == AHuman.PRONE then
637-
self.Ctrl:SetState(Controller.BODY_CROUCH, true);
652+
self.Ctrl:SetState(Controller.BODY_PRONE, true);
638653
end
639654

640655
if self.lateralMoveState == Actor.LAT_LEFT then

0 commit comments

Comments
 (0)