• 🏆 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!

[Wurst] Special Effect not appearing

Status
Not open for further replies.
Level 7
Joined
Sep 16, 2016
Messages
185
Code:
    EventListener.add(EVENT_PLAYER_UNIT_SPELL_ENDCAST) ->
        caster = GetTriggerUnit()
        let stand = "Stand"
        let attack = "Attack"
        if EventData.getSpellAbilityId() == 'A000'
            StopSound(Q1, false, false)
            PlaySound("Q2.mp3")
            SetUnitInvulnerable(caster, false)

            SetUnitAnimation(caster, stand)
            SetUnitAnimation(caster, attack)

            AddSpecialEffect(Units.abomination1, 10, 10)
            AddSpecialEffect(Units.abomination1, 25, 25)
            AddSpecialEffect(Units.abomination1, 0, 0)
            AddSpecialEffect(Units.abomination1, 50, 50)

I tried putting 1 and many of addspecialeffect but it doesnt appear anywhere. Does anyone have a clue as to why?

EDIT:

Okay, seems to be a coordination issue. I would like the effect to happen from my model, then to the direction my channel ability is directed to. What should I use instead?
 
Last edited:
Level 7
Joined
Sep 16, 2016
Messages
185
A bit of an update, I got the effect to show from my caster to the direction I chose, but it destroys immediately (after 1 second) and plays on initial cast, rather than playing on "endcast" and destroying effect after 5 seconds

Code:
let ABIL_ID = 'A000'

init



    Q1 = CreateSound("Q1.mp3", false, false, false, 0, 0, "DEFAULTEAXON")

    EventListener.add(EVENT_PLAYER_UNIT_SPELL_CHANNEL) ->
        caster = GetTriggerUnit()
        if EventData.getSpellAbilityId() == 'A000'
            PlaySoundBJ(Q1)
            SetUnitInvulnerable(caster, true)

    EventListener.add(EVENT_PLAYER_UNIT_SPELL_ENDCAST) ->
        caster = GetTriggerUnit()
           
        EventListener.onPointCast(ABIL_ID) (unit caster, vec2 targetPos) ->
            let fx = addLightning(
                "AFOD",
                true,
                caster.getPos(),
                targetPos
            )

            SetUnitAnimation(caster, "stand")
            SetUnitAnimation(caster, "attack")

            doAfter(5) ->
                fx.destr()
 
How are you getting a special effect the show at all on the second example, and why are you nesting the onPointCast inside your ENDCAST closure?
For the first example, try putting some prints before and after the special effect functions to see if the thread could be crashing.
 
Status
Not open for further replies.
Top