This report documents the migration and enhancement of the Ramscoop mod from Starsector 0.95a to Starsector 0.98a-RC8, the addition of LunaLib support in version 0.4.0, and configuration/UI refinements in 0.5.0>.
- Visual Feedback Default: Changed
ramscoop_enable_visual_feedbackdefault totrueto improve new user experience. - Supply Configuration: Added
ramscoop_supply_per_crewto LunaLib settings, allowing configuration of supply generation per crew member (previously hardcoded/legacy). - Build Script: Improved
build.batrobustness for path detection.
data/config/LunaSettings.csv– Addedramscoop_supply_per_crew; updated visual feedback default.src/ramscoop/ModPlugin.java– Updated to read new supply setting; changed default visual feedback boolean.build.bat– Enhanced Starsector directory detection logic.
- Added a CSV validator and CI integration to prevent malformed
LunaSettings.csvfiles and to flag legacy UI keys that clutter the LunaLib settings menu. - Cleaned LunaLib UI by removing legacy
nebula_*entries and exposing two dedicated no-crew controls:nebula_no_crew_rate_percentandnebula_no_crew_rate_flat. - Code updated to read the new keys and convert percent values to fractions as needed.
- Added corona fuel generation with separate caps and rate; supplies remain nebula-only.
- Moved supplies settings under Nebula; removed Global Fuel Caps concept and use-global toggles.
- Hardened corona detection using terrain-plugin checks and a star-distance fallback; added a one-line corona diagnostic.
- Fixed: Corona cap values now loaded from LunaLib/settings.json (previously defaulted to 100% if not read), ensuring caps are respected in corona.
data/config/LunaSettings.csv– tabs are now General, Nebula, Corona; no Global caps; supplies under Nebula.settings.json– nebula_* and corona_* fuel caps; no global_* keys.src/ramscoop/ModPlugin.java– loads nebula/corona fuel caps; legacy supply keys aliased to nebula_*.src/ramscoop/Ramscoop.java– detects corona reliably and applies per-tab caps; logs corona mode line.
- Fuel UI: rate and soft cap are 0–100% sliders; converted to fractions in code
- Fuel clamping: soft cap (fraction of max), hard cap (absolute), margin (units)
- Supplies respect the master "Scoop Enabled" toggle
- Immediate application: toggling in LunaLib updates fleet memory at runtime
- Defaults aligned for gameplay convenience (fuel 4%/day, soft cap 20%; supplies 20%)
data/config/LunaSettings.csv– added tabs and new fields/types; adjusted defaultssettings.json– aligned fallback defaults (decimal fractions)src/ramscoop/ModPlugin.java– convert % sliders to fractions; seed from legacy before LunaLib; sync toggle to memorysrc/ramscoop/Ramscoop.java– clamp fuel adds; guard supplies by master toggle
- ModPlugin.java Changes:
- Added
MOD_IDconstant for consistent mod identification - Implemented
loadSettings()method with smart detection of available settings sources - Added
loadLunaLibSettings()using reflection for dynamic LunaLib access - Enhanced
loadLegacySettings()with better error handling - Added
fuel_per_dayvariable to match LunaLib configuration
- Added
Ramscoop.java Changes:
- Updated fuel generation calculation to use
ModPlugin.fuel_per_dayinstead ofsupplies_per_crew
- LunaLib Settings Support: Added comprehensive in-game settings configuration through LunaLib
- LunaLib Version Checker Support: Added LunaLib.version file for automatic update notifications
- Soft Dependency Implementation: LunaLib is optional - mod functions normally without it
- Enhanced Settings Management: Improved settings loading with automatic fallback
data/config/LunaSettings.csv- LunaLib configuration file defining all mod settingsLunaLib.version- Version checker file for LunaLib update notifications
src/ramscoop/ModPlugin.java- Added LunaLib integration with reflection-based loadingmod_info.json- Updated version to 0.4.0, enhanced descriptionRamscoop.version- Version Checker integration fileREADME.md- Added LunaLib documentation and usage instructionschangelog.md- Documented new features
- Uses Java reflection to avoid hard dependency on LunaLib JAR
- Implements graceful fallback to settings.json if LunaLib is not available
- Maintains full backward compatibility with existing configurations
The following settings were mapped from settings.json to LunaLib configuration:
| settings.json | LunaSettings.csv | Type | Description |
|---|---|---|---|
| enable_fuel | ramscoop_enable_fuel | Boolean | Enable fuel generation |
| enable_supplies | ramscoop_enable_supplies | Boolean | Enable supply generation |
| fuel_per_day | ramscoop_fuel_per_day | Double | Fuel generation rate |
| percent_supply_limit | ramscoop_percent_supply_limit | Double | Supply limit percentage |
| hard_supply_limit | ramscoop_hard_supply_limit | Double | Hard supply limit |
| crew_usage | ramscoop_crew_usage | Radio | Crew usage mode |
| supply_per_crew | ramscoop_supply_per_crew | Double | Supply per crew |
| no_crew_gen | ramscoop_no_crew_gen | Radio | No-crew generation type |
| no_crew_rate | ramscoop_no_crew_rate | Double | No-crew generation rate |
- Old API:
Global.getSettings().loadJSON("settings.json") - New API:
Global.getSettings().loadJSON("settings.json", "m561_ramscoop") - Notes: The newer API requires specifying the mod ID as the second parameter to correctly locate mod-specific files.
- Added null checks in
isNebula()method to prevent potential NullPointerExceptions.
- Added simple error logging using
System.out.println()andprintStackTrace()to avoid dependency on log4j.
- Modernised the switch statement structure for better readability.
- Added comments to explain key components of the code.
- starfarer.api.jar
- starfarer_obf.jar
- janino.jar
- commons-compiler.jar
- commons-compiler-jdk.jar
- fs.common_obf.jar
- fs.sound_obf.jar
- lwjgl.jar
- lwjgl_util.jar
- json.jar
Two build scripts are provided for flexibility:
- Ensure Starsector is installed at the path specified in
build.ps1or update the path. - Run
.\build.ps1from PowerShell. - The compiled JAR will be placed in
Passive-Ramscoop/jars/.
- Ensure Starsector is installed at the path specified in
build.bator update the path. - Run
build.batfrom the command line. - The compiled JAR will be placed in
Passive-Ramscoop/jars/.
- Launch game with both Ramscoop and LunaLib enabled
- Access settings via F2 during campaign
- Verify all Ramscoop settings appear in LunaLib menu
- Test settings changes are applied immediately
- Enter nebula and verify resource generation works with LunaLib settings
- Check console output for "Loaded settings from LunaLib" message
- Launch game with only Ramscoop enabled
- Verify settings.json is loaded correctly
- Enter nebula and verify resource generation works with settings.json
- Check console output for "Loaded settings from settings.json (LunaLib not available)" message
- Start a new game
- Enter a nebula with a fleet
- Verify fuel generation works
- Verify supplies generation works
- Verify no errors in starsector.log
- Test with different crew usage modes
- Verify hard limits are respected
- None identified at this time.
- Consider adding visual feedback when resources are being generated
- Potential integration with other settings management mods
- Enhanced error reporting for invalid LunaLib configurations
- Added a CI version consistency checker (.github/scripts/check-versions.ps1) to ensure
mod_info.json,version.json, andRamscoop.versionmatch. This prevents TriOS/auto-updaters from missing releases due to mismatched metadata. - Release workflow now auto-applies the release tag's semantic version to the three canonical files before packaging (it will commit the updated files back to
main).