Skip to content

Commit 8a33096

Browse files
authored
Merge branch 'development' into radius-affecting-attachables
2 parents 7ec2b58 + 9dd15cc commit 8a33096

File tree

534 files changed

+22671
-10180
lines changed

Some content is hidden

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

534 files changed

+22671
-10180
lines changed

CHANGELOG.md

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

6161
- New hotkey system for `Actor` and `HeldDevice`.
6262
Pressing a certain new hotkey will mark it as activated on `Actor` and `HeldDevice`, letting scripts make use of the new bindings easily.
63-
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
64-
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARY = 0, AUXILIARY = 1, ACTORHOTKEYTYPECOUNT = 2`.
63+
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
64+
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, ACTORHOTKEYTYPECOUNT = 2`.
6565
Both `Actor` and `HeldDevice` have the following functions:
6666
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
6767
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
6868
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
69+
70+
- 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).
6971

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

8284
- 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.
8385

86+
- Added Lua-accessible bitmap manipulation functions to `MOSprite`s:
87+
```
88+
GetSpritePixelIndex(int x, int y, int whichFrame) - Returns the color index of the pixel at the given coordinate on the given frame of the sprite ((0, 0) is the upper left corner!)
89+
90+
SetSpritePixelIndex(int x, int y, int whichFrame, int colorIndex, int ignoreIndex, bool invert) - Sets the color of the pixel at the given coordinate on the given frame of the sprite, skipping if the pixel has same color index as given in "ignoreIndex". If "invert" is set to true, only pixels of that color index are set.
91+
92+
GetAllSpritePixelPositions(const Vector& origin, float angle, bool hflipped, int whichFrame, int ignoreIndex, bool invert, bool includeChildren) - Returns a list of vectors pointing to the absolute positions of all pixels in the given frame of the sprite, rotated to match "angle", flipped to match "hflipped" and positioned around "origin", providing a full silhouette of the MOSprite. "IgnoreIndex" and "invert" are like above, "includeChildren" denotes whether or not to include all children of the MOSprite (no effect if not at least an MOSRotating).
93+
94+
GetAllVisibleSpritePixelPositions(bool includeChildren) - Simplified version of the above, returning a list of absolute positions of the visible pixels of the current frame of the sprite as it is currently drawn.
95+
96+
SetAllSpritePixelIndexes(int whichFrame, int colorIndex, int ignoreIndex, bool invert) - Sets all pixels in the given frame of the sprite to the given color index, ignoring and inverting as above.
97+
98+
SetAllVisibleSpritePixelIndexes(int colorIndex) - Simplified version of the above, sets all visible pixels of the currently visible sprite to the given color index.
99+
```
100+
- Added `Material` Lua function `GetColorIndex()`, which returns the color index of the calling material.
101+
84102
- 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.
85103

104+
- 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.
105+
106+
- 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.
107+
86108
</details>
87109

88110
<details><summary><b>Changed</b></summary>
@@ -127,6 +149,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
127149

128150
- `Scene` Lua functions `AddNavigatableArea(areaName)` and `ClearNavigatableAreas()` have been renamed/corrected to `AddNavigableArea(areaName)` and `ClearNavigableAreas()`, respectively.
129151

152+
- `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.
153+
154+
- `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.
155+
156+
- `SceneMan` function `CastMORay` now can also accept a table of MOIDs instead of a single MOID, letting you ignore any arbitrary set of MOIDs.
157+
158+
- Techion Laser Rifle now has a constant range rather than being dependent on game resolution.
159+
160+
- Various performance improvements.
161+
130162
</details>
131163

132164
<details><summary><b>Fixed</b></summary>
@@ -147,6 +179,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
147179

148180
- Fixed an issue where internal Lua functions OriginalDoFile, OriginalLoadFile, and OriginalRequire were polluting the global namespace. They have now been made inaccessible.
149181

182+
- Fixed `MOSprite:UnRotateOffset()` giving the wrong results on HFLipped sprites.
183+
184+
- 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.
185+
186+
- Fixed issue where MOSR `Gib`s, `AEmitter` or `PEmitter` `Emission`s, and MetaMan `Player`s were not correctly accessible from script.
187+
188+
- Fixed a crash on launch when the `SupportedGameVersion` INI property was not set.
189+
190+
- 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.
191+
192+
- Fixed issue where scripts applied to `MovableObject`s could become disordered in certain circumstances.
193+
150194
</details>
151195

152196
<details><summary><b>Removed</b></summary>
@@ -2677,7 +2721,7 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
26772721

26782722
- `TDExplosive.ActivatesWhenReleased` now works properly.
26792723

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

26822726
- Various minor other things that have gotten lost in the shuffle.
26832727

Data/Base.rte/AI/SharedBehaviors.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function SharedBehaviors.Patrol(AI, Owner, Abort)
259259

260260
if Dist:MagnitudeIsGreaterThan(20) then
261261
Owner:ClearAIWaypoints();
262-
Owner:AddAISceneWaypoint(Free);
262+
Owner:AddAISceneWaypoint(Free);
263263
Owner:UpdateMovePath();
264264

265265
-- wait until movepath is updated
@@ -434,7 +434,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
434434
local obstacleState = Actor.PROCEEDING;
435435
local Obst = {R_LOW = 1, R_FRONT = 2, R_HIGH = 3, R_UP = 5, L_UP = 6, L_HIGH = 8, L_FRONT = 9, L_LOW = 10};
436436
local Facings = {{aim=0, facing=0}, {aim=1.4, facing=1.4}, {aim=1.4, facing=math.pi-1.4}, {aim=0, facing=math.pi}};
437-
437+
438438
local NeedsNewPath, Waypoint, HasMovePath, Dist, CurrDist;
439439
NeedsNewPath = true;
440440

@@ -518,7 +518,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
518518
end
519519

520520
AverageVel = SharedBehaviors.UpdateAverageVel(Owner, AverageVel);
521-
521+
522522
local stuckThreshold = 2.5; -- pixels per second of movement we need to be considered not stuck
523523

524524
-- Cap AverageVel, so if we have a spike in velocity it doesn't take too long to come back down
@@ -1089,7 +1089,7 @@ function SharedBehaviors.GetProjectileData(Owner)
10891089
PrjDat.vqu = PrjDat.vsq^2; -- muzzle velocity quad
10901090
PrjDat.drg = 1 - Projectile.AirResistance * TimerMan.DeltaTimeSecs; -- AirResistance is stored as the ini-value times 60
10911091
PrjDat.thr = math.min(Projectile.AirThreshold, PrjDat.vel);
1092-
PrjDat.pen = (Projectile.Mass * Projectile.Sharpness * PrjDat.vel) * PrjDat.drg;
1092+
PrjDat.pen = Weapon:GetAIPenetration() * PrjDat.drg;
10931093

10941094
PrjDat.blast = Weapon:GetAIBlastRadius();
10951095
if PrjDat.blast > 0 or Weapon:IsInGroup("Weapons - Explosive") then

Data/Base.rte/Actors/Mecha/AADrone/Drone.ini

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,21 @@ AddDevice = HDFirearm
8585
Flash = Attachable
8686
CopyOf = Muzzle Flash SMG
8787
FireSound = SoundContainer
88-
AddSound = ContentFile
89-
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Fire1.flac
88+
AttenuationStartDistance = 165
89+
SoundSelectionCycleMode = All
90+
AddSoundSet = SoundSet
91+
AddSound = ContentFile
92+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot1.flac
93+
AddSound = ContentFile
94+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot2.flac
95+
AddSound = ContentFile
96+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot3.flac
97+
AddSound = ContentFile
98+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot4.flac
99+
AddSound = ContentFile
100+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot5.flac
101+
AddSound = ContentFile
102+
FilePath = Ronin.rte/Devices/Weapons/AK47/Sounds/Shot6.flac
90103
EmptySound = SoundContainer
91104
AddSound = ContentFile
92105
FilePath = Base.rte/Sounds/Devices/EmptyClick1.flac

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

0 commit comments

Comments
 (0)