User:Frost
Jump to navigation
Jump to search
my base layout
converting UFO_Base_Kit layouts to extender.ini format
gawk ' BEGIN { FS="|"; row=0; longest = length("PsionicLaboratory"); } function Convert(kitname) { switch (kitname) { case "lift": return "AccessLift"; case "lab": return "Laboratory"; case "workshop": return "Workshop"; case "psi": return "PsionicLaboratory"; case "containment": return "AlienContainment"; case "stores": return "GeneralStores"; case "quarters": return "LivingQuarters"; case "hangar1": return "HangarTL"; case "hangar2": return "HangarTR"; case "hangar3": return "HangarBL"; case "hangar4": return "HangarBR"; case "small_radar": return "SmallRadar"; case "large_radar": return "LargeRadar"; case "hyperwave": return "HyperWaveDecoder"; case "grav": return "GravShield"; case "mind": return "MindShield"; case "missile": return "MissileDefense"; case "laser": return "LaserDefense"; case "plasma": return "PlasmaDefense"; case "fusion": return "FusionBallDefense"; } return "Empty"; } function Pad(ininame) { while (length(ininame) <= longest) ininame = ininame " "; return ininame; } /^\|/ { printf("row" ++row "="); for (i = 2; i <= NF; ++i) { if (substr($i,0,1) != "=") printf(Pad(Convert($i))); } printf("\n"); } '