healthbars widget (v7) *Jan. 4 08*
Moderator: Moderators
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
I can not use this widget (latest version) because it take 10 to 20 seconds to initialize here, which often times me out during loading.
If, in Initialize, I comment this out, it loads instantly:
I take it this triggers Spring to load all unit models.
Any chance you could make it lazy load these heights so it initializes within reasonable time?
(This is on Win XP Prof SP2 on an AMD 3200+ @ 2 GHz, 1G RAM, 7600 GT)
EDIT: tested with XTA v9 mod on Bluebend map.
If, in Initialize, I comment this out, it loads instantly:
Code: Select all
if (UnitDefs[1].height == nil) then
for udid, ud in ipairs(UnitDefs) do
ud.height = Spring.GetUnitDefDimensions(udid).height+20
end
end
Any chance you could make it lazy load these heights so it initializes within reasonable time?
(This is on Win XP Prof SP2 on an AMD 3200+ @ 2 GHz, 1G RAM, 7600 GT)
EDIT: tested with XTA v9 mod on Bluebend map.
Last edited by Tobi on 23 Aug 2007, 23:54, edited 1 time in total.
I already surround it with "if (UnitDefs[1].height == nil)", so it is only executed once (multiple widgets need this code). I don't like lazy loads, but I already thought about to spread the work on multiple gameframes. And you aren't the first, who complained about timeouts/long loading times, but 10-20secs are WOW, normally it should take 2-3secs.
Btw, in the next Spring release the loaded variable should be directly provided by the engine, so we wouldn't need that code anymore >_>
PS: the newest release should be bug free <_<
Btw, in the next Spring release the loaded variable should be directly provided by the engine, so we wouldn't need that code anymore >_>
PS: the newest release should be bug free <_<
Cool, I will be testing it shortly.
Hrmm... question...
If two Widgets exist (oh, say... if I bundled my mod with this Widget)... and I changed something (oh, say, I made the length of the delay more than 5 seconds)... what will happen?
Crash? Two Widgets both running the same code, simultaneously? Will my Widget take precedence over a user's version?
Hrmm... question...
If two Widgets exist (oh, say... if I bundled my mod with this Widget)... and I changed something (oh, say, I made the length of the delay more than 5 seconds)... what will happen?
Crash? Two Widgets both running the same code, simultaneously? Will my Widget take precedence over a user's version?
<tries it>
Hmm. It works for me, and I think it's fine, even with the stuff that isn't strictly necessary. Not bad at all. A little bit bigger than is maybe ideal, but if that is the only thing I can find to whine about, then it must be pretty good
Only real trouble is that I need to re-adjust all the heights of my S3Os, to keep it well above the units... and that causes it to clip into my NanoBlobs-style teamcolor dots. Which, as we all know, I'm not terribly attached to.
I don't suppose that I could get an alpha, teamcolored icon, just above the rest of this? Just a very small square one- nothing very large- it'd replace the teamcolor dots.
Then I'd be pretty much feature-complete, for what I'd like players to see, between this and other stuff that's already available, and I'd be all done with the teamcolor thing, unless I change my mind and add it to the S3Os... or get the dynamic-icon thingy, which I have described so vaguely that I'm not surprised there's been no interest.
<ducks objects thrown by grumpy coders> Sorry... just... uh, that one thing? It'd mean I could cut a fairly high-poly Piece out've every model, among other benefits...
Hmm. It works for me, and I think it's fine, even with the stuff that isn't strictly necessary. Not bad at all. A little bit bigger than is maybe ideal, but if that is the only thing I can find to whine about, then it must be pretty good

Only real trouble is that I need to re-adjust all the heights of my S3Os, to keep it well above the units... and that causes it to clip into my NanoBlobs-style teamcolor dots. Which, as we all know, I'm not terribly attached to.
I don't suppose that I could get an alpha, teamcolored icon, just above the rest of this? Just a very small square one- nothing very large- it'd replace the teamcolor dots.
Then I'd be pretty much feature-complete, for what I'd like players to see, between this and other stuff that's already available, and I'd be all done with the teamcolor thing, unless I change my mind and add it to the S3Os... or get the dynamic-icon thingy, which I have described so vaguely that I'm not surprised there's been no interest.
<ducks objects thrown by grumpy coders> Sorry... just... uh, that one thing? It'd mean I could cut a fairly high-poly Piece out've every model, among other benefits...
The version on UF still gives the error: in infolog.txt
Edit: Change "include('headers/billboard.lua')" to "include('Headers/billboard.lua')" for proper linux case compatability.
Code: Select all
Failed to load: unit_healthbars.lua (Include() could not load 'LuaUI/headers/billboard.lua'
)
Edit: Change "include('headers/billboard.lua')" to "include('Headers/billboard.lua')" for proper linux case compatability.
It doesn't screw your original healthbars. Spring 75b2 has a typo, it doesn't initialize a value (which should be zero), so if your ram has something different than a zero at that position, you can't see any healthbars and some widgets don't work. 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.ginekolog wrote:this widget screwed up original health bars, even with disabled widget i could not see original health bars, so i had do delete it.
Its alsto a bit slow on mass of units... but on fast pc its very good.
And the slow down with mass of units should be around ~15-20% (tested with 440 corsol), and it shouldn't slow down if there are less units on the screen.
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
- TechnoTone
- Posts: 165
- Joined: 23 Aug 2005, 22:02
You can remove the text on the bars by changing line 35:
to
To remove the % values you'd have to change line 401:
to
and line 416:
to
Code: Select all
local drawBarTitles = true
Code: Select all
local drawBarTitles = false
To remove the % values you'd have to change line 401:
Code: Select all
glDrawFuncAtUnit(unitID, true, DrawUnitInfos, unitID, height, true, canStockpile, reloadTime, primaryWeapon)
Code: Select all
glDrawFuncAtUnit(unitID, true, DrawUnitInfos, unitID, height, false, canStockpile, reloadTime, primaryWeapon)
Code: Select all
DrawFeatureInfos(featureID, 70, true, wx,wy,wz)
Code: Select all
DrawFeatureInfos(featureID, 70, false, wx,wy,wz)