Hello everyone.
I recently had issues with portrait animations for a Flying Balls model, and the model works perfectly so far.
For a custom ability called "Torrefaction" that is supposed to burn the target for a few seconds, preventing it to move (yes I know damage would be more sensible but I needed more single target slows ^^).
I made a "roasting flying ball" and a "roasting ball" models, and at first tried to use Polymorph to morph my normal Balls and Flying Balls into "roasted" versions. Polymorph had serious issues with the morphed unit's HP and also did not make the model's portrait update.
Then I tried to use the Chaos ability with the exact same results.
Then I went back to my models and added extra versions of their animations to add "roasted" visuals with the tag "Victory" as AlternateEx didn't seem to like being there besides Alternate.
This made my new trigger for the custom ability extremely simple as you can see in that part of the script :
So all I do is add the animation and change the proper name of the targets (yes my creeps are heroes for the sake of recycling).
Everything works fine except with the portrait, once again.
I know the new versions of the models work perfectly, because if I preplace units having these models with the tag "victory" in Required Animations Names, the units properly show the model and the related portrait. But it doesn't work with adding the animations ingame
I know I could easily replace the units with fresh ones (and yes fresh ones have a working portrait for some weird reason), but I have built my complete spawn system around recycling my creeps (Balls), and replacing them, even with a lot of care would render the recycling useless, and also would require to recreate their specific unit triggers everytime.
Does anyone know of a way to change the model of a unit, or to display the proper portrait for a specific sub-animation name like victory, without replacing the unit ?
Note that in the models, I have a portrait animation for every sub-animation, and I also tried with no animation but just a "Portrait" camera with absolutely no better success (and loosing the slight team-colored glow behind the portrait).
One could think this problem is not worth fixing, but the "Roasting" models are quite effective visually in the context, and displaying the basic portrait kind of ruins the effect of the ability (even if it doesn't render it less efficient^^).
I clearly fail to understand why this issue is there to start with...
I recently had issues with portrait animations for a Flying Balls model, and the model works perfectly so far.
For a custom ability called "Torrefaction" that is supposed to burn the target for a few seconds, preventing it to move (yes I know damage would be more sensible but I needed more single target slows ^^).
I made a "roasting flying ball" and a "roasting ball" models, and at first tried to use Polymorph to morph my normal Balls and Flying Balls into "roasted" versions. Polymorph had serious issues with the morphed unit's HP and also did not make the model's portrait update.
Then I tried to use the Chaos ability with the exact same results.
Then I went back to my models and added extra versions of their animations to add "roasted" visuals with the tag "Victory" as AlternateEx didn't seem to like being there besides Alternate.
This made my new trigger for the custom ability extremely simple as you can see in that part of the script :
Lua:
-- unrelated actions in the context of EVENT_PLAYER_UNIT_SPELL_EFFECT
elseif (sId==SpellID[15]) then -- Torrefaction
local t,b=CreateTimer(),GetSpellTargetUnit()
PlayCleanSFX(SFXTor, GetUnitX(b), GetUnitY(b), 1.0, 0.0, 0, 1.5)
SetUnitMoveSpeed(b, 0.0)
AddUnitAnimationProperties(b, "victory", true)
TimerData[t]={b, GetHeroProperName(b)}
if IsFlying then
BlzSetHeroProperName(b, "Roasting Flying Ball")
else
BlzSetHeroProperName(b, "Roasting Ball")
end
TimerStart(t, 2+2*GetUnitAbilityLevel(GetTriggerUnit(), sId), false, function()
local t=GetExpiredTimer()
local b=TimerData[t][1]
DestroyTimer(t)
BlzSetHeroProperName(b, TimerData[t][2])
SetUnitMoveSpeed(b, 522.0)
AddUnitAnimationProperties(b, "victory", false)
if not(IsUnitType(b, UNIT_TYPE_DEAD)) then
PlayCleanSFX(SFXTor, GetUnitX(b), GetUnitY(b), 1.0, 0.0, 0, 1.5)
d=Destination[GetUnitUserData(b)]
IssueDelayedPointOrder(b, "move", WPx[d], WPy[d], 0.0)
end
end)
end
-- other actions
So all I do is add the animation and change the proper name of the targets (yes my creeps are heroes for the sake of recycling).
Everything works fine except with the portrait, once again.
I know the new versions of the models work perfectly, because if I preplace units having these models with the tag "victory" in Required Animations Names, the units properly show the model and the related portrait. But it doesn't work with adding the animations ingame
I know I could easily replace the units with fresh ones (and yes fresh ones have a working portrait for some weird reason), but I have built my complete spawn system around recycling my creeps (Balls), and replacing them, even with a lot of care would render the recycling useless, and also would require to recreate their specific unit triggers everytime.
Does anyone know of a way to change the model of a unit, or to display the proper portrait for a specific sub-animation name like victory, without replacing the unit ?
Note that in the models, I have a portrait animation for every sub-animation, and I also tried with no animation but just a "Portrait" camera with absolutely no better success (and loosing the slight team-colored glow behind the portrait).
One could think this problem is not worth fixing, but the "Roasting" models are quite effective visually in the context, and displaying the basic portrait kind of ruins the effect of the ability (even if it doesn't render it less efficient^^).
I clearly fail to understand why this issue is there to start with...