what a waste of a fing weekend. will wiki the knowledge up after I have rested up with work.
for later wikification:
Code: Select all
local function AlterQueue(teamID, factoryID, researchItems)
local upgrades = researchItems.upgrades
local facCmds = spGetFactoryCommands(factoryID)
if facCmds then -- nil check
for i = 1, #facCmds do
local cmd = facCmds[i]
local newBuildID = upgrades[-cmd.id]
if newBuildID then
-- ctrl in options here forces it to use factory build queue
spGiveOrderToUnit(factoryID, CMD.REMOVE, {cmd.tag}, {"ctrl"})
spGiveOrderToUnit(factoryID, CMD.INSERT, {i, -newBuildID, 0}, {"ctrl", "alt"})
end
end
end
end
Code: Select all
spEditUnitCmdDesc(unitID,f,{disabled=true,hidden=true})
apparently people can make buttons of their own to issue the command id still
be sure to ultramegacockblockwith:
Code: Select all
function gadget:AllowCommand(unitID, unitDefID, teamID, cmd, param, opt, tag, synced)
if cmd < 0 then
if lockedUnits[teamID][-cmd] then --list of shit he cannot build for that team.
return false
end
end
build commands for units have fing negative values to tell them apart from regular commands.
I would like some waffles.