Page 1 of 1
Widget - Show Build
Posted: 30 Sep 2013, 14:19
by jamerlan
Hi to all!
There is a widget called "Show Build". I love it and I think it's very useful.
I uploaded it to github. Feel free to download it and install..
If someone have a free time and lua knowledge - feel free to improve this widget. Bluestone made code review and
there are he's comments how this widget could be improved.
If you want to take a look: picture how it works.
P.S. thx to WarXperiment for widget!
P.P.S. Widget was updated for spring 98 engine
Re: Widget - Show Build
Posted: 30 Sep 2013, 15:05
by Broker
you corrected it?
function check(unitID)
local queue = Spring.GetCommandQueue(unitID)
if (queue~=nul) then <<----------------------------
if(queue and #queue > 0) then
--if(#queue > 0) then
Re: Widget - Show Build
Posted: 30 Sep 2013, 15:51
by Jools
Isn't this already part of engine behaviour?
Re: Widget - Show Build
Posted: 30 Sep 2013, 17:47
by jamerlan
Jools wrote:Isn't this already part of engine behaviour?
widget shows allways what ally players are going to build. No need to select own cons or press shift or smth like that
Re: Widget - Show Build
Posted: 30 Sep 2013, 17:49
by jamerlan
Broker wrote:you corrected it?
function check(unitID)
local queue = Spring.GetCommandQueue(unitID)
if (queue~=nul) then <<----------------------------
if(queue and #queue > 0) then
--if(#queue > 0) then
I had no issues there. My version of script is just works. So I did not insert additional checks in that place.
У меня не было никаких проблем в этом месте. Поэтому, я именно тут ничего не менял и у меня все работает.
Re: Widget - Show Build
Posted: 30 Sep 2013, 18:03
by Silentwings
What broker is trying to tell you is that nul doesn't exist in lua & nil does.
Re: Widget - Show Build
Posted: 30 Sep 2013, 18:21
by jamerlan
Lol no

nul exists only in he's version of script I guess.
Broker, Bluestone говорит, что не существует в lua "nul" есть только "nil"
Re: Widget - Show Build
Posted: 30 Sep 2013, 19:19
by Broker
jamerlan wrote:Lol no

nul exists only in he's version of script I guess.
Broker, Bluestone говорит, что не существует в lua "nul" есть только "nil"
Thank you. I had another problem.
http://springrts.com/phpbb/viewtopic.ph ... ld#p525666
Re: Widget - Show Build
Posted: 30 Sep 2013, 19:41
by jamerlan
this was the issue I fixed :-D
Re: Widget - Show Build
Posted: 30 Sep 2013, 19:54
by Jools
Silentwings wrote:What broker is trying to tell you is that nul doesn't exist in lua & nil does.
I thought that nil per definition doesn't exist. If it would, it would not be nil.

Re: Widget - Show Build
Posted: 01 Oct 2013, 00:28
by Silentwings
@Jools, not entirely sure what you mean by the phrase 'nil per definition', but you can set variables in lua to be nil - it works much like a nil pointer in C (and afaik thats also what lua is doing interally).
Re: Widget - Show Build
Posted: 02 Oct 2013, 23:09
by Jools
Re: Widget - Show Build
Posted: 11 Oct 2014, 17:08
by jamerlan
updated this widget to work with spring 98
