discriminatingly banned by decimator
Moderator: Moderators
discriminatingly banned by decimator
discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:20, edited 1 time in total.
I just wrote a SaveQueue() / LoadQueue() command set that might
help with this kind of situation. It saves the command queue for any
selected units when SaveQueue() is called, and appends the saved
queue when LoadQueue() is called.
Could also do command queue rebuilds to allow shifting specific
commands within the queue. I've already done some similar for
changing the build order counts in factory queues.
These types of queue routines can be expensive with respect to the
amount of network bandwidth they use. It all depends on how long
the queues are
help with this kind of situation. It saves the command queue for any
selected units when SaveQueue() is called, and appends the saved
queue when LoadQueue() is called.
Could also do command queue rebuilds to allow shifting specific
commands within the queue. I've already done some similar for
changing the build order counts in factory queues.
These types of queue routines can be expensive with respect to the
amount of network bandwidth they use. It all depends on how long
the queues are

It will affect network traffic, the commands are routed
through the network before being processed locally.
As for when you can see it ... here it is. This version
isn't setup for factory command queues yet, but it won't
take much to finish it off (I'm currently tweaking the
GetCommandQueue() / GetFactoryQueue() calls)
through the network before being processed locally.
As for when you can see it ... here it is. This version
isn't setup for factory command queues yet, but it won't
take much to finish it off (I'm currently tweaking the
GetCommandQueue() / GetFactoryQueue() calls)
Code: Select all
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- Save Queue interface
--
function SelectedString()
local s = ""
uidTable = Spring.GetSelectedUnits("raw")
uidTable.n = nil -- or use ipairs
for k,v in pairs(uidTable) do
s = s .. ' +' .. v
end
return s
end
savedQueue = {}
function SaveQueue()
local uTable = Spring.GetSelectedUnits("raw")
uTable.n = nil
for x,uid in pairs(uTable) do
local facQueue = Spring.GetFactoryQueue(uid);
if (facQueue ~= nil) then
savedQueue[uid] = facQueue
else
savedQueue[uid] = Spring.GetCommandQueue(uid)
end
end
end
function LoadQueue()
local reselect = false
local selstr = SelectedString()
local uTable = Spring.GetSelectedUnits("raw")
uTable.n = nil
for x,uid in pairs(uTable) do
local queue = savedQueue[uid]
if (queue ~= nil) then
for k,v in ipairs(queue) do -- in order
if (not v.options.internal) then
local opts = {}
table.insert(opts, "shift") -- appending
if (v.options.alt) then table.insert(opts, "alt") end
if (v.options.ctrl) then table.insert(opts, "ctrl") end
if (v.options.right) then table.insert(opts, "right") end
Spring.SendCommands({ "selectunits clear +" .. uid })
Spring.GiveOrder( v.id, v.params, opts )
reselect = true
end
end
end
end
if (reselect) then
Spring.SendCommands({"selectunits clear" .. selstr})
end
end
-
- Posts: 197
- Joined: 04 Nov 2004, 00:33