Posted by: Pete_Keller
« on: November 20, 2007, 10:41:10 PM »Quote from: "Randy"
Code: [Select]Base Tech Table:
Laser Focal Size = 1-30 where 10cm = 1
Laser Wavelength = 31-60 where Infrared = 31
Capacitor recharge rate = 61-90 where rate 1 = 61
Doing this is rather dangerous long term as it puts severe problems into the system if you ever run into the end of a block (ie want to add a 31st laser focal size).
You need to have a slightly different structure:Code: [Select]Base Tech Table:
Thus a fully level 1 laser would have 3 records:
TechTypeID where laser = 15
BaseTechType =1-x (unique for each TechTypeID; lasers need 1-3)
1=Focal Size, 2 = Wavelength, 3 = Capacitor Recharge Rate
BaseTechLevel = 1-xCode: [Select]TechTypeID | BaseTechType | BaseTechLevel
15 1 1 (for focal size 10cm)
15 2 1 (for wavelength)
15 3 1 (for capacitor rate)
To lin to a specific component, you really only need a similar table but use SDComponentID instead of TechTypeID. Add TechTypeID to the ShipDesignComponents table. Gives the flexibility and removes artificial hard limits.
If you've ever coded using line numbers (basic... ewww!), you know what these kinds of limits do to ya when you hit one...
Randy, have you looked in the database? The way it is set up, it has a tech type ID column which would be used to select the subcomponents of the tech you are building.
If you get 31 Laser Focal Sizes (which I am not expecting), you would just grab another set of 30 later in the database. I only wanted him to put them put them in order to make it easier to visually search for data in the database.
Pete