I know that most of the answers will probably be "yes, you can do it... with lua!" So I ask for either examples or strong nudging in the right direction
Is it possible for certain units to be allocated to certain landing pad points? Some of you may recall me working on a factory that builds different units on different points several months ago (thanks to flozi, knorke and others for getting it working!) which is basically the exact same deal. I want aircraft to go to padA, and cruisers to go to padB.
Of course it seems that the landing pads work with a table so the code that worked for the factory did not work for this... I'm sure it is similar. The bit of code I use for the factories is:
Code: Select all
function script.QueryBuildInfo()
return buildSpots [bdefID] or normalpad
end
Code: Select all
function script.StartBuilding()
Sleep (10) --otherwise GetUnitIsBuilding returns nil
local spGetUnitIsBuilding = Spring.GetUnitIsBuilding (unitID)
bdefID = Spring.GetUnitDefID (spGetUnitIsBuilding)
if UnitDefs[bdefID].canFly then
StartThread(cruiser_descend)
else
StartThread(normal_unit)
end
end
Thanks :)