Skip to content

Fix errors when adding player ship upgrade paths to the science database - #2928

Open
dj803 wants to merge 1 commit into
daid:masterfrom
dj803:pr/2290-upgrade-path
Open

dj803 wants to merge 1 commit into
daid:masterfrom
dj803:pr/2290-upgrade-path

Conversation

@dj803

@dj803 dj803 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Refs #2290 (part a only; b-d are not touched).

Hello! While running 44_outpost headlessly I saw the Ship Yard database build fail for several of the ships listed in #2290 a. Please correct me if this is not the same error.

Cause (player_ship_upgrade_downgrade_path_scenario_utility.lua)

  • Beam and tube tables use {idx = -1} as "no beam/tube at this level"; the description loops then format the missing fields: beams at line 60 (Player Missile Cr.), tubes at line 87 (Benedict, Ender, Kiriya, MP52 Hornet, Striker).
  • Phobos M3P sensor levels 10-13 had no prox_scan, so line 279 compared a number with nil.
  • Ender missile levels 11-12 use ord = 7, but the Ender ordnance table has 6 rows, so line 133 would index nil (found by reading the table; on master the line 87 error comes first).

Change (10 insertions, 6 deletions): skip idx < 0 entries in the beam and tube loops; add prox_scan = 3 to Phobos M3P levels 10-13; Ender ord = 7 -> 6.
The prox_scan = 3 and ord = 6 values are my best guess from the neighbouring levels; please check them.

Checks

  • Windows 11, headless, scenario that calls playerShipUpgradeDowngradeData() then pcall(addShipUpgradeInfoToScienceDatabase, name) for each of the 22 templates in upgrade_path (2026-11-13):
ok fail
master 29df4600 (control) 15 7: Benedict, Ender, Kiriya, MP52 Hornet, Striker (:87); Phobos M3P (:279); Player Missile Cr. (:60)
this branch 22 0
  • Lua 5.4 syntax parse of scripts/**.lua (the engine's own Lua): 0 failed.

NOT tested

  • Any real client: the resulting Science Ship Yard database text was not looked at on screen.
  • Linux, macOS.
  • Whether the intended prox_scan/ord values are right.

🤖 Generated with Claude Code

The database builder formatted the {idx = -1} 'no beam / no tube at this level'
placeholders, indexed an ordnance row that does not exist for the Ender (levels 11
and 12 used row 7 of 6), and compared a missing prox_scan on the Phobos M3P sensor
levels 10-13.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant