Skip to content

Enhancements to the FSO electrical arc system#6347

Merged
Goober5000 merged 7 commits into
scp-fs2open:masterfrom
Goober5000:electrical_arc_enhancements
Jun 30, 2025
Merged

Enhancements to the FSO electrical arc system#6347
Goober5000 merged 7 commits into
scp-fs2open:masterfrom
Goober5000:electrical_arc_enhancements

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

Several enhancements to make the electrical arcs more useful and flexible.

  1. Data structures have been refactored to group all of the arc-related fields together
  2. next_fireball and fire_timeout in the debris structure misleadingly implied fireballs rather than arcs; these have been renamed to match the usage in ships
  3. Arc sounds were fixed to properly fire when arcs are created, rather than for every damage/EMP arc currently active on the ship
  4. Electrical arcs were made dynamic to allow any number of arcs on debris and ships. Currently the retail limits are still in place, but this could be customized in a future PR
  5. Electrical arcs can now be customized by specifying the number of segment divisions and whether the points are persistent (rather than regenerated every frame)
  6. A new scripting API method has been added to explicitly specify the points used for an arc

As part of 6), a new valueToVec3d utility method has been added that could be useful for future API functions.

@Goober5000 Goober5000 added enhancement A new feature or upgrade of an existing feature to add additional functionality. scripting A feature or issue related to LUA scripting Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle Requested by Active Mod A feature request that has been requested by a mod that is actively in development. labels Sep 10, 2024
@Goober5000 Goober5000 force-pushed the electrical_arc_enhancements branch 3 times, most recently from 947eb17 to 7c45fb3 Compare September 10, 2024 21:50
@Goober5000 Goober5000 force-pushed the electrical_arc_enhancements branch from 7c45fb3 to 2606d31 Compare September 21, 2024 05:00
@Goober5000 Goober5000 force-pushed the electrical_arc_enhancements branch from 2606d31 to fdc9c7c Compare October 7, 2024 07:35
@Goober5000 Goober5000 removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Oct 28, 2024
@Goober5000 Goober5000 added this to the Release 25.0 milestone Feb 12, 2025
@Goober5000 Goober5000 force-pushed the electrical_arc_enhancements branch from fdc9c7c to 9563ba3 Compare May 16, 2025 05:05

@Baezon Baezon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good to me, lots of good cleanup.

Comment thread code/scripting/lua/LuaUtil.h

@wookieejedi wookieejedi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests have showed things work as expected, and overall will be quite useful to have this extra augmentation to arcs.

The code for generating spark sounds was incorrectly copied from debris to ships, dating all the way back to retail.  The sound should be played once per generation event, not once for every electrical arc active on the ship.  This fixes a bug that caused overlapping electrical arc sounds.
…nction with a handy valueToVec3d utility function
@Goober5000 Goober5000 force-pushed the electrical_arc_enhancements branch from 9563ba3 to c5d5a93 Compare June 22, 2025 05:38
@Goober5000 Goober5000 merged commit 11a33fe into scp-fs2open:master Jun 30, 2025
20 checks passed
@Goober5000 Goober5000 deleted the electrical_arc_enhancements branch June 30, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A new feature or upgrade of an existing feature to add additional functionality. Requested by Active Mod A feature request that has been requested by a mod that is actively in development. scripting A feature or issue related to LUA scripting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants