• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] special effect issue

Status
Not open for further replies.
Level 4
Joined
Aug 2, 2015
Messages
63
why when i create this function and use it doesn't work
Code:
function SpawnEffect takes string model,real x,real y,real yaw,real pitch,real roll,real scale,real duration,integer red,integer green,integer blue,integer trans returns nothing
set bj_lastCreatedEffect=AddSpecialEffect(model,x,y)
call BlzSetSpecialEffectOrientation(bj_lastCreatedEffect,yaw,pitch,roll)
call BlzSetSpecialEffectScale(bj_lastCreatedEffect,scale)
call BlzSetSpecialEffectColor(bj_lastCreatedEffect,red,green,blue)
call BlzSetSpecialEffectAlpha(bj_lastCreatedEffect,trans)
call BlzSetSpecialEffectTime(bj_lastCreatedEffect,duration)
endfunction
 
Level 7
Joined
Apr 17, 2017
Messages
316
local effect x
set x = AddSpecialEffect (model, x, y)
then use x instead of bj_last createdspecialeffect.
I am not that familiar with yaw but why dont you try them one by one see which one does what. They are even added in gui as well.
 
Level 4
Joined
Aug 2, 2015
Messages
63
i use the function like this but don't work the effect doesn't appear
Code:
call SpawnEffect("war3mapImported\\kaizokusfxbyvalk4.mdl",GetUnitX(c),GetUnitY(c),270,10,10,3,2,255,255,255,255)
whether the duration is not the effect lifetime like unittimedlife?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I suggest you restart your computer (not shutdown, it must be restart) and make sure Warcraft III is running at maximum visual settings. Graphic drivers can enter a bugged state that causes some types of Warcraft III visuals to not be drawn correctly, restarting usually fixes this because it forces the graphic drivers to reload. Some special effects will not appear at lower visual settings in Warcraft III, an artefact from the days where most computers could not run Warcraft III maxed out while maintaining good performance.

Test that you can get the effect model to appear in game at all. This is to rule out the problem being the model, especially if it is a custom one.

If it still does not work, try disabling various effect transform calls until it does work. It might be that some of them are buggy with regard to that specific model, or that the parameters they use have different meanings from what you expect.
 
whether the duration is not the effect lifetime like unittimedlife?
No it is not a auto destroy. It jumps to a time in the effects models current animation frame. Your example plays the effects animation from second 2.0, therefore skipping 0.0 to 1.999 seconds.

I believe that has also some special behaviour for models with no animation (blizzard, rain of fire). But not sure about this line.
 
Level 4
Joined
Aug 2, 2015
Messages
63
No it is not a auto destroy. It jumps to a time in the effects models current animation frame. Your example plays the effects animation from second 2.0, therefore skipping 0.0 to 1.999 seconds.

I believe that has also some special behaviour for models with no animation (blizzard, rain of fire). But not sure about this line.
Thanks,for the information now i know why my model not appear because the 'duration' i set exceeded the animation frame.
sorry for my stupidity :)

I suggest you restart your computer (not shutdown, it must be restart) and make sure Warcraft III is running at maximum visual settings. Graphic drivers can enter a bugged state that causes some types of Warcraft III visuals to not be drawn correctly, restarting usually fixes this because it forces the graphic drivers to reload. Some special effects will not appear at lower visual settings in Warcraft III, an artefact from the days where most computers could not run Warcraft III maxed out while maintaining good performance.

Test that you can get the effect model to appear in game at all. This is to rule out the problem being the model, especially if it is a custom one.

If it still does not work, try disabling various effect transform calls until it does work. It might be that some of them are buggy with regard to that specific model, or that the parameters they use have different meanings from what you expect.
thanks,for the suggestion ;)
 
Status
Not open for further replies.
Top