Skip to content

Commit 3b5def1

Browse files
committed
Merge branch 'development' into browncoat-mission
2 parents 48d8071 + f9483a2 commit 3b5def1

File tree

101 files changed

+1794
-800
lines changed

Some content is hidden

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

101 files changed

+1794
-800
lines changed

CHANGELOG.md

Lines changed: 45 additions & 3 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.
@@ -79,8 +81,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7981

8082
- 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.
8183

84+
- Added Lua-accessible bitmap manipulation functions to `MOSprite`s:
85+
```
86+
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!)
87+
88+
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.
89+
90+
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).
91+
92+
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.
93+
94+
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.
95+
96+
SetAllVisibleSpritePixelIndexes(int colorIndex) - Simplified version of the above, sets all visible pixels of the currently visible sprite to the given color index.
97+
```
98+
- Added `Material` Lua function `GetColorIndex()`, which returns the color index of the calling material.
99+
82100
- 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.
83101

102+
- 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.
103+
104+
- 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.
105+
84106
</details>
85107

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

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

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

130162
<details><summary><b>Fixed</b></summary>
@@ -145,6 +177,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
145177

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

180+
- Fixed `MOSprite:UnRotateOffset()` giving the wrong results on HFLipped sprites.
181+
182+
- 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.
183+
184+
- Fixed issue where MOSR `Gib`s, `AEmitter` or `PEmitter` `Emission`s, and MetaMan `Player`s were not correctly accessible from script.
185+
186+
- Fixed a crash on launch when the `SupportedGameVersion` INI property was not set.
187+
188+
- 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.
189+
148190
</details>
149191

150192
<details><summary><b>Removed</b></summary>
@@ -2675,7 +2717,7 @@ This can be accessed via the new Lua (R/W) `SettingsMan` property `AIUpdateInter
26752717

26762718
- `TDExplosive.ActivatesWhenReleased` now works properly.
26772719

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

26802722
- Various minor other things that have gotten lost in the shuffle.
26812723

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
197 Bytes
Loading

0 commit comments

Comments
 (0)