Small bugfix for Unit Healthbars Widget

Small bugfix for Unit Healthbars Widget

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

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Small bugfix for Unit Healthbars Widget

Post by Argh »

Teensy fix for Unit Healthbars.

Runs ever-so-slightly slower, due to an AND. Could possibly not draw for one cycle, under very unlikely conditions.

Probably whatever Spring bug causes Capture to be returned as 0.5 when fully captured should just get fixed, but meh, here's a workaround, using CA's latest version of the Widget.
Attachments
unit_healthbars.lua
(22.63 KiB) Downloaded 35 times
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Small bugfix for Unit Healthbars Widget

Post by KDR_11k »

Capture at .5 after a capture is on purpose, it's so a captured thing can be captured back more easily. It's not returning a wrong value, it's setting the value to that.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Small bugfix for Unit Healthbars Widget

Post by Argh »

That's... retarded. At any rate, now it's hidden from view.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Small bugfix for Unit Healthbars Widget

Post by KDR_11k »

Argh wrote:That's... retarded. At any rate, now it's hidden from view.
Isn't hiding that even more retarded?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Small bugfix for Unit Healthbars Widget

Post by Pxtl »

Crazy settings like the "recapture" thing are nice balance ideas, but Spring is already such an inscrutable morass of complicated obscure rules that stuff like that should be dyked out and moved to Lua, or at least made optional via TDF, like the damned flanking shield.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Small bugfix for Unit Healthbars Widget

Post by Argh »

Isn't hiding that even more retarded?
Yeah, it is, but I was in the middle of doing stuff. I'll just use a Gadget to silently revert it to 0.0 if it == 0.5, but I'm hiding it until it runs, because I don't want to run a Gadget like that every gameframe, that's a waste of computer time. If people want the Gadget, it'll be in World Builder. I'd vote for just fixing the issue in Spring, myself, but this will serve as a "patch", and it won't do any serious harm if the issue is repaired.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Small bugfix for Unit Healthbars Widget

Post by KDR_11k »

Err, that would just result in a capture being reset if you happened to check at the wrong time. Why not zero it in UnitGiven?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Small bugfix for Unit Healthbars Widget

Post by Argh »

That's an easy way to take care of that, if it counts as Given when captured... thanks, that'll run faster than doing a time-based check.

[EDIT]Works, problem solved... here's the source...[/EDIT]
Attachments
UnitGiven.lua
(962 Bytes) Downloaded 24 times
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Small bugfix for Unit Healthbars Widget

Post by ZellSF »

Speaking of healthbar bugs:
Image
check the middle healthbar. jK says that it might have negative length, at any rate it seems very wrong. Wonder if that's the random red artificating that's been bothering me a lot :/
User avatar
Pressure Line
Posts: 2283
Joined: 21 May 2007, 02:09

Re: Small bugfix for Unit Healthbars Widget

Post by Pressure Line »

Pxtl wrote:...made optional via TDF, like the damned flanking shield.
iirc is *is*

tdf and fbi in concert ;)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Small bugfix for Unit Healthbars Widget

Post by jK »

Pxtl wrote:...made optional via TDF, like the damned flanking shield.
Imo it should removed completely (so I did in my incomming 150kB engine patch) and
those who like the 0.5 should use lua.

PS: before healthbars was out nobody even knew it! (except some insiders)
so it can't be a fundamental `feature`.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Small bugfix for Unit Healthbars Widget

Post by KDR_11k »

I'd really like to simplify the defaults so they assume the least features instead of TA or old Spring behaviour by default but I guess that would break every mod out there.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Small bugfix for Unit Healthbars Widget

Post by Argh »

Imo it should removed completely (so I did in my incomming 150kB engine patch) and
those who like the 0.5 should use lua.

PS: before healthbars was out nobody even knew it! (except some insiders)
so it can't be a fundamental `feature`.
Yup, I had no idea, until I used your Widget, tbh. If it's going to be fixed engine-side, great, I have it forced to 0 for now, which works just fine.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Small bugfix for Unit Healthbars Widget

Post by Tobi »

jK wrote:(so I did in my incomming 150kB engine patch)
submit plz, you're making it harder and harder to check it, and possibly causing ppl to do double work too!
Post Reply

Return to “Lua Scripts”