You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I played a bit with this.
It seems that if the startup ship has equal or less capacity than it's equipments need when setting them up in the MainMenu.lua, then the game hangs.
If I comment out every equipment and cargo from the setupPlayerShip() from the MainMenu.lua, then only the default hyperdrive (class one for the xylpohis) will be on the ship, as defined in the ship.lua
Then it gives the same redscreen at 4t capacity, and the game works with 5t capacity. The Class 1 Hyperdrive is 4t.
If the default hyperdrive is 0, then there's no hang even with 1t capacity.
If I set the startup ship to another ship, and give the xylophis 4t capacity, and a class one hyperdrive, then the game starts fine, and I can buy a xylophis, which has it's hyperdrive, and no more room for anything.
Ok, found the bug. It doesn't actually match the title at all. @nozmajner's analysys helped though, I wouldn't have found it if I hadn't know to drop the ship capacity.
Its nothing to do with the start ship. Adding equipment or cargo to a ship that doesn't have room just causes the add to fail. AddEquip actually returns the number of items added. If we bothered to check it we'd find that they all return 0 when you reduce the start ship capacity. There's no point ever checking it though, because we're never going to make the start ship something that doesn't have room (or we'll not put so much stuff in it!).
The bug comes from giving the ship only enough space to hold its starting drive. TradeShips adds a launch delay of 30-45 seconds per item of cargo added. If there's no room in the ship, then no cargo can be added, so the delay is 0. The delay timer function will not allow a delay of 0, resulting in the slightly-misleading error message.
The fix will be to detect a zero delay and instead choose some random amount. Interestingly, the code in TradeShips that deals with what to do after docking already handles this case. There's some nice code reuse opportunities here for anyone that's interested. Today I'm just going to fix the bug.
The text was updated successfully, but these errors were encountered: