Widget - Show Build

Widget - Show Build

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

Moderator: Moderators

Post Reply
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Widget - Show Build

Post 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.Image

P.S. thx to WarXperiment for widget!
P.P.S. Widget was updated for spring 98 engine
Attachments
unit_showbuild.lua
updated for spring 98
(4.23 KiB) Downloaded 11 times
Last edited by jamerlan on 11 Oct 2014, 17:10, edited 1 time in total.
Broker
Posts: 156
Joined: 02 Jul 2012, 13:16

Re: Widget - Show Build

Post 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

jamerlan wrote:Hi to all!

There is a widget in "widgets database" called "Show Build". I love it and I think it's very useful.

I fixed "widget crash" bug. But I can't upload fixed version to widgets database.So 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.Image

P.S. thx to WarXperiment for widget!
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Widget - Show Build

Post by Jools »

Isn't this already part of engine behaviour?
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Widget - Show Build

Post 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
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Widget - Show Build

Post 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.
У меня не было никаких проблем в этом месте. Поэтому, я именно тут ничего не менял и у меня все работает.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Widget - Show Build

Post by Silentwings »

What broker is trying to tell you is that nul doesn't exist in lua & nil does.
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Widget - Show Build

Post by jamerlan »

Lol no :-) nul exists only in he's version of script I guess.

Broker, Bluestone говорит, что не существует в lua "nul" есть только "nil"
Broker
Posts: 156
Joined: 02 Jul 2012, 13:16

Re: Widget - Show Build

Post 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
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Widget - Show Build

Post by jamerlan »

Broker wrote:
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
this was the issue I fixed :-D
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Widget - Show Build

Post 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.

:wink:
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Widget - Show Build

Post 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).
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Widget - Show Build

Post by Jools »

I just meant this:
http://www.wordreference.com/definition/nil wrote: nil /nɪl/ n

another word for nothing: used esp in the scoring of certain games

Etymology: 19th Century: from Latin
User avatar
jamerlan
Balanced Annihilation Developer
Posts: 683
Joined: 20 Oct 2009, 13:04

Re: Widget - Show Build

Post by jamerlan »

updated this widget to work with spring 98 :-)
Post Reply

Return to “Lua Scripts”