Here are the functions I use:
Code: Select all
Create the factory:
(builder is global)
builder=Spring.CreateUnit("bsupportfactory",1000,0,200,0,gaia)
Give build command:
local defID = UnitDefNames.bot.id
Spring.GiveOrderToUnit(builder, CMD.INSERT, {-1,-defID,0,1060,0,300}, {"alt","ctrl"});
Have I to set the CanMove tag to true to make the factory beeing able to build units? Cause most factories have the CanMove tag set to true. My factory has the CanMove tag set to true and MaxVelocity to "0" atm.