I tracked down the gadget in S44 to game_hqBuildSpot and I've started playing with it. I think I understand it, but there is one hangup.
name = "HQ unit ID informer",
desc = "Tells HQ scripts which build platter to use",
author = "Nemo/B.Tyler",
date = "14th April, 2009",
license = "PD",
layer = -5,
enabled = true -- loaded by default?
if (gadgetHandler:IsSyncedCode()) then
function gadget:UnitCreated(unitID, unitDefID, unitTeam, builderID)
local ud = UnitDefs[unitDefID]
if builderID then
local builderDefID = Spring.GetUnitDefID(builderID)
local bud = UnitDefs[builderDefID]
if (bud.customParams.separatebuildspot) then
if (ud.customParams.buildoutside) then
buildPlace = 1
buildPlace = 0
--> Spring.CallCOBScript(builderID, "pickPlace", 0, buildPlace)
The "Spring.CallCOBSript blah blah blah" (with the arrow above) is giving me errors, because I'm using a Lua script and not Cob. This is where my knowledge runs out, as I don't know how to make it read a lua script.
Also, this is what I put into my factory's script:
if (buildPlace == 1) then
Move(pad, z_axis, -20)
Move(pad, z_axis, 20)
I'm not sure if that is how it is supposed to look, but I can't get the actual gadget to work so I haven't gotten that far.