//Contain basic data libraries.
//Soon to be updated with more usefull stuff.

function packscale(%pack)
{
if (%pack $= "BaseInventoryPack")
   return "3 3 1.5";
else if (%pack $= "BaseSentryPack")
   return "1.5 1.5 0.5";
else if (%pack $= "BaseGeneratorPack")
   return "4 3 4";
else if (%pack $= "BaseLargeSensorPack")
   return "2 2 6";
else if (%pack $= "BaseMediumSensorPack")
   return "3 3 5";
else if (%pack $= "BaseturretPack")
   return "4 2.5 2.5";
else if (%pack $= "BaseSolarPack")
   return "2 3 1";
else if (%pack $= "BaseGPTPack")
   return "1 1 1";
}

function scalelibrary(%pack,%setting,%direction)
{
// This contains all the scales from all the updated packs
// This Might be a good place to start editing.
// The stuff is pretty straight forward.
// The numbers are Scale: x,y,z. (normal for sizing pieces)
// and Deploy surface scale: x,y.

if (%pack $= "spineDeployable")
        {
	if (%setting == 0)
		%scale = "0.5 0.5 8 0.5 0.5";
        else if (%setting == 1)
		%scale = "0.5 0.5 40 0.5 0.5";
        else if (%setting == 2)
		%scale = "0.5 0.5 160 0.5 0.5";
        else if (%setting == 3)
		%scale = "0.5 0.5 4 0.5 0.5";
        else if (%setting == 4)
		%scale = "0.5 4 4 0.5 0.5";
        }

if (%pack $= "wallDeployable")
        {
	if (%setting == 0)
		%scale = "7 7 0.5 0.5 0.5";
        else if (%setting == 1)
		%scale = "7 7 0.5 0.5 0.5";
        else if (%setting == 2)
		%scale = "7 7 0.5 0.5 0.5";
        else if (%setting == 3)
		%scale = "7 7 0.5 0.5 0.5";
        else if (%setting == 4)
		%scale = "7 7 0.5 0.5 0.5";
        }

//Decides which value to return.

if (%direction == -1)
        return GetWord(%scale,0) SPC GetWord(%scale,1) SPC GetWord(%scale,2);
else if (%direction == -2)
        return GetWord(%scale,3) SPC GetWord(%scale,4);
else 
        return GetWord(%scale,%direction);
}

function scaleright(%scale,%shape)
{
//Transforms from meters to units depending on the shape.
if (%shape $= "plug")
   return Getword(%scale,0) / 4 SPC Getword(%scale,1) /3 SPC GetWord(%scale,2) / 0.5;
}