Skip to content

Commit 551c5e9

Browse files
committed
Merge branch 'development' into gpu-primitives
2 parents 6271504 + 510c61a commit 551c5e9

File tree

108 files changed

+1552
-1024
lines changed

Some content is hidden

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

108 files changed

+1552
-1024
lines changed

CHANGELOG.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5858

5959
- New hotkey system for `Actor` and `HeldDevice`.
6060
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`.
61+
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
62+
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, ACTORHOTKEYTYPECOUNT = 2`.
6363
Both `Actor` and `HeldDevice` have the following functions:
6464
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
6565
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
6666
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
67+
68+
- New `Controller` state `WEAPON_RELOADHELD`, which is true every frame reload input is held (as opposed to `WEAPON_RELOAD` which is only true once when pressed).
6769

6870
- New `GAScripted` Lua script method `IsCompatibleScene(scene)` to allow Activities to generically decide which Scenes are eligible by returning a boolean value.
6971
New `GAScripted` INI enumerating property `AddRequiredArea`, replacing Lua file scanning, to allow Activities to explicitly state which areas are strictly required.
@@ -83,6 +85,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8385

8486
- New Z Order for scene layers and primitives: Background layer sits at z=100, Terrain Background at z=50, Terrain color and MO color at z=0, GUIs sit at z=-100, allowed z range is [-200, +200], in the future this'll be expanded to MO draw as well.
8587

88+
- 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.
89+
90+
- New `MovableMan` function `GetMOsAtPosition(posX, posY, ignoreTeam, getsHitByMOsOnly)` that will return an iterator with all the `MovableObject`s that intersect that exact position with their sprite.
91+
92+
- New `SceneMan` function `CastAllMOsRay(startVector, rayVector, table ignoreMOIDs, ignoreTeam, ignoreMaterial, bool ignoreAllTerrain, int skip)` which returns an iterator with pointers to all the non-ignored MOs met along the ray.
93+
8694
</details>
8795

8896
<details><summary><b>Changed</b></summary>
@@ -117,7 +125,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
117125

118126
- Internal GUI element `ComboBox` no longer displays dropdown combobutton when disabled, to communicate visually that it's setting is not modifiable.
119127

120-
- 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.
128+
- 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.
121129

122130
- `Gib`s and detached `Attachable`s now inherit the parent's angular velocity by default.
123131

@@ -127,6 +135,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
127135

128136
- Lua renamed `SceneLayer`->`StaticSceneLayer` due to changed SLBackground base class.
129137

138+
- `Scene` Lua functions `AddNavigatableArea(areaName)` and `ClearNavigatableAreas()` have been renamed/corrected to `AddNavigableArea(areaName)` and `ClearNavigableAreas()`, respectively.
139+
140+
- `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.
141+
142+
- `SceneMan` function `CastFindMORay` now has an extra bool parameter `findChildMOIDs` that denotes whether it also triggers on child MOIDs or not, which defaults to true for the same default behavior as before.
143+
144+
- `SceneMan` function `CastMORay` now can also accept a table of MOIDs instead of a single MOID, letting you ignore any arbitrary set of MOIDs.
145+
146+
- Techion Laser Rifle now has a constant range rather than being dependent on game resolution.
147+
148+
- Various performance improvements.
149+
130150
</details>
131151

132152
<details><summary><b>Fixed</b></summary>
@@ -151,6 +171,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
151171

152172
- Fixed allegro not loading alpha of image with alpha by using SDL_image instead.
153173

174+
- Various fixes and improvements to inventory management when dual-wielding or carrying a shield, to stop situations where the actor unexpectedly puts their items away.
175+
176+
- Fixed issue where MOSR `Gib`s, `AEmitter` or `PEmitter` `Emission`s, and MetaMan `Player`s were not correctly accessible from script.
177+
178+
- Fixed a crash on launch when the `SupportedGameVersion` INI property was not set.
179+
180+
- Fixed several issues with the way pie menus and aiming interacts between players, such as opening the pie menu always resetting the M&KB player's aim and pie selection, as well as another issue where the pie menu would fail to appear entirely for some players.
181+
154182
</details>
155183

156184
<details><summary><b>Removed</b></summary>
@@ -2681,7 +2709,7 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
26812709

26822710
- `TDExplosive.ActivatesWhenReleased` now works properly.
26832711

2684-
- Various bug fixed related to all the Attachable and Emitter changes, so they can now me affected reliably and safely with lua.
2712+
- Various bugs fixed related to all the Attachable and Emitter changes, so they can again be affected reliably and safely with lua.
26852713

26862714
- Various minor other things that have gotten lost in the shuffle.
26872715

Data/Base.rte/AI/SharedBehaviors.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,28 +864,28 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
864864

865865
-- test jumping
866866
local JetAccel = Accel + Vector(-jetStrength, 0):RadRotate(Owner.RotAngle+1.375*math.pi+Owner:GetAimAngle(false)*0.25);
867-
local JumpPos = Owner.Head.Pos + PixelVel + JetAccel * (t*t*0.5);
867+
local JumpPos = (Owner.Head and Owner.Head.Pos or Owner.Pos) + PixelVel + JetAccel * (t*t*0.5);
868868

869869
-- a burst add a one time boost to acceleration
870870
if Owner.Jetpack:CanTriggerBurst() then
871871
JumpPos = JumpPos + Vector(-AI.jetBurstFactor, 0):AbsRotateTo(JetAccel);
872872
end
873873

874874
-- check for obstacles from the head
875-
Trace = SceneMan:ShortestDistance(Owner.Head.Pos, JumpPos, false);
876-
local jumpScore = SceneMan:CastObstacleRay(Owner.Head.Pos, Trace, JumpPos, Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 3);
875+
Trace = SceneMan:ShortestDistance((Owner.Head and Owner.Head.Pos or Owner.Pos), JumpPos, false);
876+
local jumpScore = SceneMan:CastObstacleRay((Owner.Head and Owner.Head.Pos or Owner.Pos), Trace, JumpPos, Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 3);
877877
if jumpScore < 0 then -- no obstacles: calculate the distance from the future pos to the wpt
878878
jumpScore = SceneMan:ShortestDistance(Waypoint.Pos, JumpPos, false).Magnitude;
879879
else -- the ray hit terrain or start inside terrain: avoid
880880
jumpScore = SceneMan:ShortestDistance(Waypoint.Pos, JumpPos, false).Largest * 2;
881881
end
882882

883883
-- test falling
884-
local FallPos = Owner.Head.Pos + PixelVel + Accel * (t*t*0.5);
884+
local FallPos = (Owner.Head and Owner.Head.Pos or Owner.Pos) + PixelVel + Accel * (t*t*0.5);
885885

886886
-- check for obstacles when falling/walking
887-
local Trace = SceneMan:ShortestDistance(Owner.Head.Pos, FallPos, false);
888-
SceneMan:CastObstacleRay(Owner.Head.Pos, Trace, FallPos, Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 3);
887+
local Trace = SceneMan:ShortestDistance((Owner.Head and Owner.Head.Pos or Owner.Pos), FallPos, false);
888+
SceneMan:CastObstacleRay((Owner.Head and Owner.Head.Pos or Owner.Pos), Trace, FallPos, Vector(), Owner.ID, Owner.IgnoresWhichTeam, rte.grassID, 3);
889889

890890
if SceneMan:ShortestDistance(Waypoint.Pos, FallPos, false):MagnitudeIsLessThan(jumpScore) then
891891
AI.jump = false;

Data/Base.rte/Devices/Shared/Scripts/MuzzleSmoke.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
function Create(self)
2-
32
if self.Magazine then
43
local particleCount = self.Magazine.NextRound.ParticleCount;
54
local particleMass = self.Magazine.NextRound.NextParticle.Mass;
@@ -30,16 +29,13 @@ function Create(self)
3029
self.fireSmokeEffect.GravMult = 1;
3130

3231
self.particleUtility = require("Scripts/Utility/ParticleUtility");
33-
3432
end
3533

3634
function OnFire(self)
37-
3835
local flip = self.HFlipped and math.pi or 0;
3936
local angle = self.RotAngle + flip;
4037
self.fireSmokeEffect.Position = self.MuzzlePos;
4138
self.fireSmokeEffect.RadAngle = angle;
4239

4340
self.particleUtility:CreateDirectionalSmokeEffect(self.fireSmokeEffect);
44-
4541
end

Data/Base.rte/Devices/Shared/Scripts/RevolverCylinderReload.lua

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,29 @@ function Create(self)
44
self.shellMOSRotating = self:StringValueExists("CylinderShellMOSRotating") and self:GetStringValue("CylinderShellMOSRotating") or nil;
55
end
66

7-
function Update(self)
7+
function ThreadedUpdate(self)
88
if self.Magazine then
99
self.shellsToEject = self.Magazine.Capacity - self.Magazine.RoundCount;
1010
elseif self.shellsToEject > 0 then
11+
self.ejectingShells = {};
1112
for i = 1, self.shellsToEject do
1213
local shell = self.shellMOSRotating and CreateMOSRotating(self.shellMOSRotating) or CreateMOSParticle(self.shellMOSParticle);
1314
shell.Pos = self.Pos;
1415
shell.Vel = self.Vel + Vector(RangeRand(-3, 0) * self.FlipFactor, 0):RadRotate(self.RotAngle + RangeRand(-0.3, 0.3));
1516
shell.AngularVel = RangeRand(-1, 1);
16-
MovableMan:AddParticle(shell);
17+
table.insert(self.ejectingShells, shell);
1718
end
1819

1920
self.shellsToEject = 0;
21+
self:RequestSyncedUpdate();
22+
end
23+
end
24+
25+
function SyncedUpdate(self)
26+
if self.ejectingShells then
27+
for i = 1, #self.ejectingShells do
28+
MovableMan:AddParticle(self.ejectingShells[i]);
29+
end
30+
self.ejectingShells = nil;
2031
end
2132
end
232 Bytes
Loading
195 Bytes
Loading
195 Bytes
Loading
202 Bytes
Loading
212 Bytes
Loading
205 Bytes
Loading

0 commit comments

Comments
 (0)