• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Simple effect not showing up

Status
Not open for further replies.
Well, I'm trying to create a simply projectile system to use in an RPG. It creates the unit but the effect that it's supposed to make does not show up. Here is my struct and the trigger:
JASS:
globals
    //timer projectileTimer = CreateTimer()
endglobals

struct projectile
    real speed = 0.0
    real dir = 0.0
    effect ef
    unit dummy
    
    static method create takes real x, real y, real speed, real dir, string model returns projectile
        local player ply = GetLocalPlayer()
        local projectile p = projectile.allocate()
            set p.dummy = CreateUnit( ply, 'hpea', x, y, dir ) //Temporary dummy (so that i can see it is created)
            set p.speed = speed
            set p.dir = dir
            set p.ef = AddSpecialEffectTarget( model, p.dummy, "origin" )
            call DisplayTextToPlayer( ply, 0.0, 0.0, "PROJECTILE CREATED AT POSITION " + R2S( x ) + ", " + R2S( y ) + "!" )
            set ply = null
        return p
    endmethod
    
    method onDestroy takes nothing returns nothing
        call DestroyEffect( .ef )
        call RemoveUnit( .dummy )
        set .dummy = null
        set .ef = null
    endmethod
    
endstruct
Trigger:
JASS:
function Trig_CreateExample_Actions takes nothing returns nothing
    local projectile p = projectile.create( 200.0, 200.0, 0.0, 270, "Abilities/Spells/Other/GeneralAuraTarget/GeneralAuraTarget.mdl" )
endfunction

//===========================================================================
function InitTrig_CreateExample takes nothing returns nothing
    set gg_trg_CreateExample = CreateTrigger(  )
    call TriggerAddAction( gg_trg_CreateExample, function Trig_CreateExample_Actions )
endfunction

Any suggestions? Right now it only creates the unit and displays the message. I've tried with two other models and they don't work either.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
you have to write effect-strings with "\\" instead of "/"

it would be
JASS:
"Abilities\\Spells\\Other\\GeneralAuraTarget\\GeneralAuraTarget.mdl"
in your example function, right now the editor cant read it and returns "null".
 
Status
Not open for further replies.
Top