healthbars widget (v7) *Jan. 4 08* - Page 3

healthbars widget (v7) *Jan. 4 08*

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

Moderator: Moderators

User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post by ginekolog »

damn, even with this witdet i sometimes dont get original health bars. Waiting for new spring relese i guess :(
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It'd look quite strange if you had this widget turned on and still got the original health bars.

This widget disables the health bars and displays its own custom health bars when activated. It has nothing to-do with the bug that causes the default health bars to go haywire, this is a replacement not a fix. Besides, this is much better than the default ones.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post by ginekolog »

jK wrote:The healthbars widget has a fix, so you always see the healthbars (even if the orig. don't work) and it was my first impulse to write this widget (I only get in <20% of all matches the orig. healthbars). So it is a fix for ppl who has this problem.
Its a fix too AF.. but this fix does not allways work. On big battles this widget is too slow 4 me.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

It fixes the default healthbars by drawing its own.

Look at the code.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

ginekolog, you didn't have understand what lua is or what it can do and what not.
So it is impossible to fix a bug in the engine itself, I only can write lua code which fix the problem under lua (it is also possible to make it lua global, so all widgets use your fix). However it is impossible to fix an engine bug, I only can replace the corresponding entire feature with lua (as I did).

Also an deactivated widget is deactivated! -> it does nothing ...

This means finally: widgets can never ever bring your inbuild healthbars back.
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Post by ginekolog »

ok, got it, ty.
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

When pressing F9 it echos "waaa, nil" three times!!
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

But when you press F13 it echos "Ia! Ia! Cthulu fthagn!"
User avatar
Pendrokar
Posts: 658
Joined: 30 May 2007, 10:45

Post by Pendrokar »

KDR_11k wrote:But when you press F13 it echos "Ia! Ia! Cthulu fthagn!"
Just like the "Any Key"? - http://www.ravib.com/images/funny/anykey.jpg
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

[I suppose macs have F1-F15, also the keyboard standard support iirc upto F20.]

Either I forgot to remove the debug message again ("waaa" is my foobar :p) or you use a very old version. 'cause uf is down I can't check which was my last uploaded version.
User avatar
stilicho
Posts: 46
Joined: 21 Mar 2007, 02:49

Post by stilicho »

Bug Report - Just crashed out of a game. Here's the last bit from the infolog:

gl.DrawFuncAtUnit: error(2) = [string "LuaUI\Widgets\unit_healthbars.lua"]:302: attempt to call global 'Type' (a nil value)
LuaUI: error = 2, DrawWorld, invalid key to 'next'
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)
LuaUI: error = 2, Update, [string "LuaUI/widgets.lua"]:1006: bad argument #1 to 'ipairs' (table expected, got nil)
LuaUI: error = 2, DrawWorld, [string "LuaUI/widgets.lua"]:199: attempt to get length of local 't' (a nil value)


Awesome widget btw, looks great, and it's nice to see reload\stockpile time.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

that's a common lua bug, we all hope it gets fixed in the next spring release

and ty
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

:idea: new version :idea:
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Does it still spam the console with waa and a null value when hitting F9?
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

Spring would be version 12.0 if you were in charge of it's versioning, wouldn't it jK? :wink:
Good job!
MetalSkin
Posts: 77
Joined: 31 Aug 2007, 02:42

Post by MetalSkin »

Tried it out last night.

Couldn't find any problems with the widget, got the usual luaui crashes but other than that it seemed to work flawlessly.

I do like the fact that now you can hide the bars ala F9 and i also like how now the bars are hidden if the health is full.

Very nice mate... thanks. :)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

DAMN the new feature which was a new release worth didn't worked :evil:

here a gif of the effect
Image
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The overlay for stunned units should be separated out into a new widget
User avatar
BigHead
Posts: 145
Joined: 12 Jul 2007, 18:55

Post by BigHead »

I think it's ok to have it in one widget. It should be configurable though:
drawStunOverlay = true/false

Edit: I've realized that you might want to have stun overlay without using healthbars widget, right?
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

What do think about showing the ETA time instead of the percentage for building stuff?

That way we wouldn't need the trepan's extra ETA widget..
Post Reply

Return to “Lua Scripts”