Can not render special costume/headgear effects
miixel2 opened this issue · comments
Hello,
Just found that the application could not render some costume with following issues.
- Does not in sprite id list.
- The costume have some effect
For example, Costume Spotlight
Link: https://www.divine-pride.net/database/item/410127/costume-spotlight
Do you have any advise to use or call some functions to render the costume with special effect added?
Best Regards
Hi @miixel2 , TL;DR: It is currently not supported. Not just for costumes but also for headgears that use these effects.
I am aware of this feature but out-scoped it for the initial release because it requires a different rendering approach as is done currently with the sprites. I wanted to implement it at some point but didn't find the time and motivation to do it.
For some technical information: These effects are stored in data/luafiles514/lua files/hateffectinfo/hateffectinfo.lub
.
The spotlight is defined as such:
HatEFID = {
-- <snip>
HAT_EF_C_Spot_Light = 174,
-- <snip>
}
hatEffectTable = {
-- <snip>
[HatEFID.HAT_EF_C_Spot_Light] = {
resourceFileName = "C_Spot_Light\\Spotlight.str",
hatEffectPos = -6,
hatEffectPosX = 0,
isIgnoreRiding = true,
isAdjustPositionWhenShrinkState = true,
isAdjustSizeWhenShrinkState = true
},
-- <snip>
}
The table itself is easy to parse but it requires the rendering of STR
effects (see C_Spot_Light\\Spotlight.str
) which is non-existant. Even if rendering itself would be done another issue would be on how to add these effects to the existing sprite in regards to frame count. zrenderer currently always chooses the frame count depending on the body sprite or animated headgears which are guaranteed to be in sync and end up in a perfect loop. The STR
effects however do not adhere to that and selecting the least common denominator might not be feasible due to filesize. Hence I would prefer to simply cut off the STR
effect and it starts repeating (ugly).
However, once STR
effects are supported it would be as easy as to define these effects via an argument such as --hateffect=174
.
Hi @zhad3 ,
Thanks for explianation.
I will waiting for the next release that support this ;)
I did some base work on implementing this but then noticed that half of the hateffects are hardcoded inside the client executable. Truly a shame. I don't think its worthwhile to implement STR effect support for only a handful of hateffects.
Even less do I feel the need to somehow replicate the hardcoded effects.
Sorry but I will outscope this feature and close this ticket :'(