Page 1 of 1
Ghosted Build Queue
Posted: 29 May 2010, 04:58
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:
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
Re: Ghosted Build Queue
Posted: 29 May 2010, 06:37
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 :)
Re: Ghosted Build Queue
Posted: 29 May 2010, 08:22
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.
Re: Ghosted Build Queue
Posted: 29 May 2010, 08:35
by aegis
oh, I see, didn't notice you checked for duplicates using the command table
Re: Ghosted Build Queue
Posted: 29 May 2010, 15:50
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.
Re: Ghosted Build Queue
Posted: 29 May 2010, 16:10
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.
Re: Ghosted Build Queue
Posted: 29 May 2010, 16:14
by SirArtturi
Seems nice. Thanks!