discriminatingly banned by decimator

discriminatingly banned by decimator

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

discriminatingly banned by decimator

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:20, edited 1 time in total.
PRO_rANDY
Posts: 314
Joined: 17 Jul 2006, 01:06

Post by PRO_rANDY »

To my knowledge, this cannot be done
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

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 :-)
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:20, edited 1 time in total.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

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)

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
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:20, edited 1 time in total.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

It's lua stuff

"wait queued" will place the wait command at
the end of the queue, instead of executing it
immediately (the same is true for "selfd queued").
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

An insert unit into que command would be quite cool.
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:21, edited 1 time in total.
Hunter0000
Posts: 197
Joined: 04 Nov 2004, 00:33

Post by Hunter0000 »

I thought holding alt already did this?

Though if I remember correctlty it immediantly switchs so you'd have to issue the order between the 3rd and 4th windmill, but I thought we already had this.
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:21, edited 1 time in total.
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:21, edited 1 time in total.
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:21, edited 1 time in total.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

That link should work again (the IP changed).
MrNubyagi
Posts: 166
Joined: 11 Nov 2006, 07:29

Post by MrNubyagi »

discriminatingly banned by decimator
Last edited by MrNubyagi on 30 Nov 2006, 05:21, edited 1 time in total.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

bind Ctrl+Shift+w select AllMap+_Waiting+_ClearSelection_SelectAll
Post Reply

Return to “Help & Bugs”