Saturday, July 7, 2012

Year 12 - Day 188

I took a break for the last week or so due to the holidays and a small amount of coding burnout, but I got back into it tonight.

First up I was trying to kill a bug where all the new ships I was creating was starting with Morale set to 0, when it should have been 10.  At first I thought it was a problem with my SQL insert, but I checked everything and an almost duplicate default value for Ship Class was working fine, so I tried not using the default value on the insert and it still came up 0.  After over an hour, I finally started thinking "oh, it must be a bug with MySQL", which is almost always NOT the case, but after a while you start getting desperate for answers.  I finally figured out it was because I wasn't initializing the time for when morale was last checked for the new ship, so the game though morale for the new ship hadn't been checked since Jan 1, 1970, which caused it to go to zero instantly.  Bleh.

After that I started giving some love to the Shipyard functionality when a ship is landed at a colony.  I've got it cleaned up a good bit, and now I just need to make it use resources, which will likely be Starship Structural Units.  Initially I'm going to set it to New Ship Class * 100 Structural Units, so to go from 0.1 to 0.2 it will take 20 units.  These units will either have to be in the ship's cargo hold, or in the colonies warehouse if your ship is at a colony you own.  I'll post a screenshot soon.

No comments:

Post a Comment