• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Solved] BlzPlaySpecialEffectWithTimeScale ?

Status
Not open for further replies.
Level 12
Joined
Jan 30, 2020
Messages
875
Hello everyone !

As some might have read recently, I made a custom spell that changes my attacking creeps (Balls) into "Roasting" versions.

As I could not transform the unit properly with changing animation as the portrait did not change (even with Chaos or other metamorphosis spells, I opted for hiding the Ball and displaying a temporary "Roasting" version dummy unit.

The good thing is that this spell is supposed to stop the Ball from moving.

But as the TimedLife buff does not have any coundown timer bar, I decided to make my own version of the progress bars models hanging around in these forums.

So I have this bar model with a single "stand" animation lasting 1 second and a "fire" color bar that goes from full to nothing with this animation.

My idea was to add this bar as a special effect on the overhead of the roasting unit, and use the native

BlzPlaySpecialEffectWithTimeScale

To change the animation speed of the effect to make it correspond to the duration of the temporary roasting ball.

But this native does not seem to work.

I tried different values for the scale to test it, but the animation seems to always run at its default speed of 1s :

Lua:
            countdown=AddSpecialEffectTarget(SFXCountdown, r, "overhead")
            BlzSetSpecialEffectScale(countdown, 1.0)
            BlzPlaySpecialEffectWithTimeScale(coundtown, ANIM_TYPE_STAND, 100.0)

if I replace 100.0 with 0.01 or 1.0 nothing changes.

Is this because the special effect is used as an attachment ?

Am I condemned to use a destructable with this "progress bar" model and use native SetDestructableAnimationSpeed takes destructable d, real speedFactor returns nothing

Anyone has ever tested BlzPlaySpecialEffectWithTimeScale ?

I have found nothing at all about this native on Google...
 
Level 12
Joined
Jan 30, 2020
Messages
875
Dam, I just finished implementing the Destructible "way" and It is quite annoying.
I will try with a non-attached special effect, thanks !

EDIT :

Oh well, creating a special effect at the position ends up having the same problem.

It seems BlzPlaySpecialEffectWithTimeScale simply does not change the animation duration.

The animation played at the same speed with a duration of 100 * (duration of the spell) or 1.0 / (duration of the spell) so I guess it has no other effect than playing the animation.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
UPDATE :

Well I should have expected it, there was a variable syntax error in my Lua code, thats why BlzPlaySpecialEffectWithTimeScale didn't work.
Lua is really killing me, if only we could have a decent syntax error checking for non initialized variables...

The one I had been advised to use before was only taking Blizzard natives into account, but not the map script initialized variables.
 
Status
Not open for further replies.
Top