Ghosted Build Queue

Ghosted Build Queue

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
SkyStar
Engines Of War Developer
Posts: 23
Joined: 08 Jul 2009, 15:05

Ghosted Build Queue

Post by SkyStar »

I wanted something to show my/allied build queues as ghosts all the time without using showallcommands

So I came up with this:

Image

It does not show the order of the build queues.

Obvious performance issues would be if you used lots constructors or long build lists.

They have a team colored box around them to make them more distinguishable.

--Updated to V2
Attachments
unit_showbuild.lua
(3.41 KiB) Downloaded 139 times
ghost.jpg
(435.26 KiB) Downloaded 7 times
Last edited by SkyStar on 29 May 2010, 15:59, edited 2 times in total.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Ghosted Build Queue

Post by aegis »

perhaps take a look at the Command callins http://springrts.com/wiki/LuaCallinReturn
I don't remember which ones you'll need for a widget looking at queues, but you can test them by using Spring.Echo on their parameters.

instead of iterating through all of the builders and randomly picking which ones to update, you can maintain a list of queued buildings, only updated when a queue changes.
then you only need to draw each building once.

it looks like you iterate through all of the builders on drawworld, so when two builders are building the same queue, you'll draw each item in their queue twice.

nice widget, though :)
SkyStar
Engines Of War Developer
Posts: 23
Joined: 08 Jul 2009, 15:05

Re: Ghosted Build Queue

Post by SkyStar »

I did include something to prevent drawing the same queue more than once.

I gave a lot of consideration to handling the queues more properly, but my laziness got in the way.

I'll work on it.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Ghosted Build Queue

Post by aegis »

oh, I see, didn't notice you checked for duplicates using the command table
SkyStar
Engines Of War Developer
Posts: 23
Joined: 08 Jul 2009, 15:05

Re: Ghosted Build Queue

Post by SkyStar »

V2:
Changed how I handled the constructors so there are less tables.
Updates now only if unitCommand() is called

-Better response time + less lag

Tried to work out my own queue handling system but detecting removed build items isn't working for me yet.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Ghosted Build Queue

Post by Jazcash »

Nice! This is exactly what I suggested in the other thread, thanks ^_^

Stuff you could add to improve it:
  • Priority and numbered ghosted buildings to see what comes before and after what in the build queue.
  • An option to show or hide commands also, like move, attack etc.
  • An option to make it show only on units which are highlighted or to hide it for allies.
User avatar
SirArtturi
Posts: 1164
Joined: 23 Jan 2008, 18:29

Re: Ghosted Build Queue

Post by SirArtturi »

Seems nice. Thanks!
Post Reply

Return to “Lua Scripts”