1262 Commits
Author SHA1 Message Date
Mike Nelson f2e8df4c69 Lua access to puncture flag status (#7323)
* lua access to puncture flag status

* disallow setting flag

* and don't grab the value even

* fix
2026-03-29 12:07:01 -04:00
wookieejedi 10ff64eb1d Tune ups for standalones (#7315)
* Tune ups for standalones

Fixes two warnings from building in standalone and also provide, also adds needed function to actually tell if game is in standalone mode.

* better fix for armor flags
2026-03-25 17:42:45 -04:00
Goober5000 6a20c0f549 Merge pull request #7117 from Goober5000/anchor_refactor
refactor ship anchors
2026-03-22 02:59:47 -04:00
Goober5000 05054f89f6 Merge pull request #7222 from Goober5000/text_replacement_updates
consistent handling of text token replacement
2026-03-20 15:00:16 -04:00
Goober5000 b76e652e0c Merge pull request #7282 from Goober5000/const_char_lookup
assorted `const` fixes
2026-03-20 14:59:04 -04:00
Goober5000 a47d34c739 assorted const fixes
1. Change `ai_profile_lookup` and `multi_xfer_lookup` to use `const char *`, since all the other lookup functions do
2. Remove several unneeded `const_cast`s, some of which are now made possible by the non-const `data()` overload in C++17
3. Change `campaign_link` to use `const char*`
4. Use better string management in `test::FSTestFixture::init_cmdline()`
2026-03-20 11:33:54 -04:00
wookieejedi 100b8971a1 Fix gr.drawOffscreenIndicator (#7295)
The scripted `gr.drawOffscreenIndicator` was missing a critical `resetClip();` which meant it was using whatever the previous stack's clipping distance was, and thus not draw in the actual correct location.

This 1 line PR fixes that and the fix works as intended.
2026-03-18 07:33:15 -04:00
Mike Nelson ca1634bb5d Lua isDockLeader function (#7286)
* lua isDockLeader function

* address nitpicks
2026-03-17 08:21:12 -04:00
Mike Nelson 8fb7a058e8 grant lua ability to force a ship to call for support (#7250) 2026-03-14 18:50:13 -04:00
Goober5000 ce31a33029 fix persistent variables and containers (#7192) 2026-03-13 08:16:28 -04:00
Mike Nelson b4c98defc6 Fix incorrect param order (#7284) 2026-03-12 20:51:46 -04:00
Goober5000 89e7fd91da particle fixes and subsystem speedup
1. Modify `ship_get_subsys_for_submodel` to use the subsystem indexer.  This changes the operation from O(n) to O(1) and also allows the function to work with turret gun barrels.
2. Add an `isValid` check to `ParticleSource::finishCreation` to prevent unknown state from being accessed if the source is not valid.
3. Tweak `EffectHostTurret` and make sure it works for fighter beams.
4. Prevent `createOnTurret` from running on submodels that are not turrets.
2026-03-08 20:15:02 -04:00
Goober5000 35ed88c57f make anchors type-safe, and adjust support_ship_info accordingly 2026-03-06 22:00:32 -05:00
Goober5000 33d5f7ed3c refactor ship anchors
Testing in FotG exposed a bug that dates back to retail.  During mission parsing, arrival and departure anchors were represented by indexes into `Parse_names`.  After parsing, they were converted to ship indexes -- but only in FRED.  Since some functions are shared between FRED and FS2, this can produce inconsistent results, which can be hard to detect since parse indexes and ship indexes are usually the same.

This refactors arrival and departure anchors to be represented by ship registry indexes in all cases.  It also adds conversion functions for the benefit of FRED and QtFRED since those dialogs were designed with ship indexes in mind.
2026-03-06 22:00:32 -05:00
Mike Nelson 21a3c80b45 Lua access to volumetric params (#7262)
* Lua access to volumetric params

* lua documentation error

* address feedback

* clang

* typo
2026-03-05 07:47:57 -05:00
Mike Nelson 5c2e5a261b Stop select model rendering destroyed subsystems (#7225) 2026-02-26 10:10:26 -05:00
Asteroth f23d35c7ec add scripted flight cursor sensitivity (#7149) 2026-02-25 08:30:42 -05:00
Mike NelsonandAsteroth 070a8e18fa Adds Props as a new object type (#6836)
* First draft of prop object type

* Add prop editor dialog in FRED

* prop sexps

* lua table prop support

* lab support

* lua mission access to props

* prop collision support

* use std::optional so the object->instance id is always valid

* allow props to block suns

* minor cleanup and remove arbitrary limit. Still limited to 500 objects.

* Sort props by category

* cleanup

* implement collision hooks

* parse prop flags and further ensure props are inited and closed correctly

* Add Cyborg's multi suggestions

* fix missing header

* add props to empty slots if available

* add multi signature

* fix rebase issues and match collisions to the new multithread style

* appease Clang the Conquerer

* save/parse mission prop classes by name

* Clean up comments and finish TODOs

* fix string errors

* clang wants this to be static now

* address feedback

* address feedback

* Use model num from prop info instead

* merge prop and ship collision group sexps together

* fix rebase bug

* address feedback

* fix name shadowing

* ship heavy submodel

* clang

---------

Co-authored-by: Asteroth <[email protected]>
2026-02-16 14:41:34 +01:00
Goober5000 7277fc11ff Merge pull request #7186 from Goober5000/ship_class_display_name
make ship and weapon class display names SCP_string
2026-02-14 21:23:50 -05:00
Goober5000 2e6b38ee06 Merge pull request #7204 from Goober5000/asteroid_debris_iterators
add getAsteroidList and getDebrisList script API iterators
2026-02-14 21:23:40 -05:00
Goober5000 68075dfbd5 consistent handling of text token replacement
Just as special tokens are replaced in debriefings, replace them in command briefings and briefings as well.

Change `string_replace_tokens_with_keys` to `message_translate_tokens` (since it's the same thing) and add a `replaceContainers` script API function to complement `replaceVariables` and `replaceTokens`.

Also replace every category of token in `sexp_modify_variable` and add comments to places where token replacement might be expected but happens elsewhere.
2026-02-13 00:56:41 -05:00
Goober5000 73dd6c04e6 remove unneeded detour into Objects array 2026-01-29 01:34:13 -05:00
Goober5000 72f57ffe93 add getAsteroidList and getDebrisList script API iterators
These are similar to the existing iterators for in-game objects.
2026-01-29 01:34:13 -05:00
Goober5000 b4d9c3e9c4 make ship and weapon class display names SCP_string
All other display names are `SCP_string`, so make these `SCP_string` as well to be consistent and to allow arbitrary-length display names.

Also fix a few infelicities with German translation and the script API.
2026-01-05 23:13:35 -05:00
Mike Nelson 1da50c738f medal display name should be distinct from name (#7148) 2025-12-26 19:14:36 +09:00
BMagnu 702e8f430d Fix rendertargets being incorrectly invalidated (#7126) 2025-11-26 22:38:17 +01:00
Goober5000 fff480e101 tweak ship_cleanup
The object and ship indexes held by the ship registry do not actually need to be cleared until `ship_cleanup` completes.  This will allow the ship to be referenced in any functions (via script hooks or otherwise) that are called during cleanup.

Tweak related script documentation while we're at it.

Follow-up to #7120.  Fixes #7122.
2025-11-21 02:32:20 -05:00
Goober5000 59e8742c84 remove ship_name_lookup in scripting code
Use the ship registry rather than `ship_name_lookup`.  Also, be sure to check that ships, targets, and subsystems exist.

Fixes #7109.
2025-11-16 02:41:24 -05:00
Goober5000 897429e239 Merge pull request #6630 from Goober5000/form_on_wing_and_stay_still_updates
form-on-wing and stay-still updates
2025-10-09 22:48:58 -04:00
BMagnu dc50aaa86b Particle Scripting API (#7061)
* Expose particle effects to scripting

* Allow creation of particle sources

* Add API for particle sources

* bugfixes
2025-09-28 10:40:46 +02:00
Goober5000 0c736b7bca address feedback 2025-09-18 21:30:45 -04:00
Goober5000 aad6c84684 add $purge player-issued form-on-wing after subsequent order: flag 2025-09-18 21:30:45 -04:00
Goober5000 7f8674c532 enhance goals with additional parameters 2025-09-18 21:30:43 -04:00
Goober5000 54ee4a30d6 Preliminary cleanup of goal code. 2025-09-18 21:27:41 -04:00
wookieejedi 9502af6f20 Fix gr.createParticle with parent velocity (#6970) 2025-08-23 17:40:21 -04:00
Mike Nelson 1ffcaafc89 Allow customizing the fs2 selection effect (#6868)
* allow customizing the fs2 selection effect

* undo color color shift
2025-08-13 07:26:55 -04:00
Mike Nelson 75b61efbd1 Custom Data for Campaigns (#6906)
* campaign custom data

* Assertion instead of assert
2025-08-07 09:56:52 -04:00
LuytenKyandwookieejedi b8c3c560d2 Implementation for an AI order to chase ship types -Second Attempt- (#6828)
* Back in business hopefully

* Refactor

* Resolve CI issue in aigoals.cpp

* Updating order.cpp

* Whoops

* Updated objecttypes.tbl to incorporate attack ship type

* Fix clang-tidy issue

* Forgot one other instance

---------

Co-authored-by: wookieejedi <[email protected]>
2025-08-07 09:56:18 -04:00
Taylor Richards b19c3e565b fix more particle issues with standalone (#6886) 2025-07-31 15:06:11 -04:00
Mike Nelson 44952eb2d6 Fix some minor hud config color errors (#6881) 2025-07-30 14:03:34 -04:00
BMagnu 95d21a4085 Minor Particle Fixes (#6884)
* Fix scripted particle velocity

* Add error if no bitmaps were defined
2025-07-30 20:53:26 +09:00
Mike Nelson 2ce4bdd55c get font scale options for lua (#6876) 2025-07-29 07:41:45 -04:00
Mike Nelson bbb838a332 custom data for personas (#6861) 2025-07-28 19:21:14 -04:00
John Fernandez b49dbfeaa4 Merge pull request #6832 from MjnMixael/team_colors_followup
Get, set, browse team colors with Lua
2025-07-26 07:54:21 -04:00
Taylor Richards 5fd06b40fe fix multi crash loading campaigns (#6871)
A minor bug in #6077 resulted in a crash loading campaigns on the multi ui.
The bug itself was not fatal, however it triggered a cascade of poor error
handling which led to a crash. A lot of these issues date back to retail.
This fixes the minor bug, and hopefully adds enough error handling to
preemptively squash a repeat of the crash problem.
2025-07-25 21:15:31 -04:00
BMagnu 72ed863700 Prevent lua from garbage collecting possibly-stale subframes (#6866) 2025-07-25 22:06:00 +02:00
Mike Nelson 487cac6456 Lua func to check if in game options are enabled (#6862) 2025-07-24 16:51:14 -04:00
Mike Nelson 8be619db7e prevent string ops on nullptr char* 2025-07-22 19:19:31 -05:00
Mike Nelson ef631f9fe0 nested namespaces 2025-07-13 19:44:44 -05:00
Mike Nelson d58d924f3e Get, set, browse team colors 2025-07-13 19:23:02 -05:00