Resurrection halos widget
Moderator: Moderators
Resurrection halos widget
Displays a halo above every resurrected movable unit.
- the halo animates a little with size variation.
- the halo animates a little with size variation.
- Attachments
-
- resurrection_halos.zip
- 18 february 2015
- (11.05 KiB) Downloaded 5 times
-
- screen00098.jpg
- (302.28 KiB) Downloaded 1 time
Last edited by Floris on 18 Feb 2015, 22:44, edited 7 times in total.
Re: Resurrection halos widget
Cool widget! Works!
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Resurrection halos widget
This assumes all robots are good. Approximately 50% of them are evil. Give some of them horns.
Re: Resurrection halos widget
corpses know what teams they are from, so you know that they were not yours before you resurrect, does the new unit know it wasn't? if so that would be a prime candidate for horns instead of halo.
I dunno, I didn't think this halo marker sort of thing was possible, pretty cool!
I dunno, I didn't think this halo marker sort of thing was possible, pretty cool!
Re: Resurrection halos widget
I'm not sure if its possible at all to determine if the resurrected unit belonged to the enemy. But thinking about that its possible to get back the stockpile value, it probably is possible someway. Doesn't get a resurrected unit a new id?
But aestaticly horns are very hard to do right. A halo is a lot easier, it floats and doesn't need to stick very precise on top of the 'head' of the unit.
Like the idea though :D
But aestaticly horns are very hard to do right. A halo is a lot easier, it floats and doesn't need to stick very precise on top of the 'head' of the unit.
Like the idea though :D
Re: Resurrection halos widget
could always do an inverted halo.. you know, red edge black center
Re: Resurrection halos widget
Sometimes halos are too high. (take a look at zeus in attached screenshot)
And probably they could be bigger
Last edited by jamerlan on 23 Jan 2015, 22:45, edited 1 time in total.
Re: Resurrection halos widget
The widget uses unitheight as defined in unitdefs.
Could add an option to define unitheight per unit type separately, maybe also even a off center value so it always hovers above a unit head.
But... maybe later...
Could add an option to define unitheight per unit type separately, maybe also even a off center value so it always hovers above a unit head.
But... maybe later...
Re: Resurrection halos widget
pretty much best you can do is petition the content dev to set the height. Sadly that is a 3do not an s3o. I am not sure if the height can be manually set on that zeus model.
Re: Resurrection halos widget
new version!
- slightly thicker/larger halo + applied bevel 3d effect on the texture
- remembers halo units on /luaui reload
- bugfix for when speccing and changing los
- size animation is based on clock instead of gametime
- slightly thicker/larger halo + applied bevel 3d effect on the texture
- remembers halo units on /luaui reload
- bugfix for when speccing and changing los
- size animation is based on clock instead of gametime
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Resurrection halos widget
The unitID after resurrection will typically be different to the one before death. But, you can save info when it dies because you know when the wreck spawns and that it spawns in (almost) exactly the same place as its unit died, which is (almost) always unique for the current simframe. And then you can do the same trick backwards when it's resurrected. It's a bit of a hack, and it relies on knowing the order in which callins happen within a simframe, but I don't know of a better way to do it.I'm not sure if its possible at all to determine if the resurrected unit belonged to the enemy. But thinking about that its possible to get back the stockpile value, it probably is possible someway. Doesn't get a resurrected unit a new id?
Code (by BrainDamage) for doing it with exp is here http://imolarpg.dyndns.org/trac/balates ... ez_exp.lua. See the GameFrame callin for explanation of the callin order.
Re: Resurrection halos widget
That uses gadget callins, unavailable at widget level
And widget:UnitDestroyed is only called with your own units...
And widget:UnitDestroyed is only called with your own units...
Re: Resurrection halos widget
Could you do health halos? Instead of bars..?
Re: Resurrection halos widget
[f=0010324] Error: LuaUI::RunCallIn: error = 2, Initialize, [Internal Lua error: Call failure] error = 2, LuaUI/bawidgets.lua, [string "LuaUI/Widgets/gui_resurrection_halos.lua"]:249: attempt to compare number with nil
stack traceback:
[C]: in function 'Include'
[string "-------------------------------------------..."]:25: in function 'chunk'
[string "luaui.lua"]:50: in main chunk
if I add "data and data.haloUnitsCount ~= nil" - then error is gone
like that:
if data and data.haloUnitsCount ~= nil and data.haloUnitsCount > 0 and data.haloUnits ~= nil and os.clock() - data.lastOsClock < 2 then
P.S. bug was found during watching repay: http://replays.springrts.com/replay/4c1 ... 7c4c9fd36/
stack traceback:
[C]: in function 'Include'
[string "-------------------------------------------..."]:25: in function 'chunk'
[string "luaui.lua"]:50: in main chunk
if I add "data and data.haloUnitsCount ~= nil" - then error is gone
like that:
if data and data.haloUnitsCount ~= nil and data.haloUnitsCount > 0 and data.haloUnits ~= nil and os.clock() - data.lastOsClock < 2 then
P.S. bug was found during watching repay: http://replays.springrts.com/replay/4c1 ... 7c4c9fd36/
Re: Resurrection halos widget
local haloImg = ':n:'..LUAUI_DIRNAME..'Images/halo21.png'
fail widget contains only halo.png
fail widget contains only halo.png
Re: Resurrection halos widget
thanks!, already was aware of the halo img name bug.
i'll update the file on the forum later.
i'll update the file on the forum later.
Re: Resurrection halos widget
I think this widget could use more unit type checks.
For example I built t2 lab in place of dead unit - t2 lab had halo :-D It was not dead before
How to deal with "new nano built in place of dead nano - have halo" - I have no idea.
For example I built t2 lab in place of dead unit - t2 lab had halo :-D It was not dead before
How to deal with "new nano built in place of dead nano - have halo" - I have no idea.
Re: Resurrection halos widget
Ugh.. I don't understand why this can happen at all. (or did you just suggest what should/could happen?)
First it checks every unit that is created if its builder can resurrect.
Secondly it excludes if the unit unitdefs: isBuilding, isFactory or it's speed == 0..
...updated file...
First it checks every unit that is created if its builder can resurrect.
Secondly it excludes if the unit unitdefs: isBuilding, isFactory or it's speed == 0..
...updated file...
Re: Resurrection halos widget
I had this bug on DSD my new t2 lab had halo
Maybe you can check wreckage being resurrected? like com counter widget
Maybe you can check wreckage being resurrected? like com counter widget
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Resurrection halos widget
All callins used in that gadget are available too widgets. Check the widget handler or https://springrts.com/wiki/Lua:Callins if you are ever confused about such things. Of course, you would have to handle the difficulty that LuaUI only has access to information that is available to the player running your widget; as such you cannot determine in every case whether a wreck was last owned by a friendly or enemy player, but in most cases you have enough information to make a reasonable guess.That uses gadget callins, unavailable at widget level... And widget:UnitDestroyed is only called with your own units...