HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I don't see whats wrong...

09-23-2006, 06:56 PM#1
darkwulfv
Collapse JASS:
function Trig_Flame_Stomp_Conditions takes nothing returns boolean
    if ( GetSpellAbilityId() == 'A004' ) then
    endif
    return true
endfunction

function Trig_Flame_Stomp_Actions takes nothing returns nothing
   local unit u = GetTriggerUnit()
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call AddSpecialEffectLoc( OffsetLocation(GetUnitLoc(u), 0, 0), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
    call RemoveLocation(GetUnitLoc(u))
   set u = null
endfunction

//===========================================================================
function InitTrig_Flame_Stomp takes nothing returns nothing
    set gg_trg_Flame_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Flame_Stomp, Condition( function Trig_Flame_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Flame_Stomp, function Trig_Flame_Stomp_Actions )
endfunction

This is what I have. JassCraft parser says "cannot convert location to string" and vice versa for every line that creates an effect.
WE parser says "Invalid Argument type (string) for only 4-5 of those lines.
Help is appreciated!
09-23-2006, 07:04 PM#2
Thunder_Eye
you are leaking 9 locations there btw
09-23-2006, 07:14 PM#3
Vexorian
All the Add*Effect natives require you to put the effect path before anything else
09-23-2006, 08:53 PM#4
darkwulfv
RemoveLocation(u) doesn't take care of those? huh... I'll have to fix that.
Thanks Vex. Wouldn't have found that out myself.
09-24-2006, 12:07 AM#5
The)TideHunter(
Ya, the native is:

Collapse JASS:
native AddSpecialEffectLoc          takes string modelName, location where returns effect

It takes the modelpath first.

And OffsetLocation returns a location, and your using it directly instead of setting it to a variable and destroying it later
Also, you could optimize that by putting it in a loop, seen as though its all exactly the same.
A unleaked loop would look like this:

Collapse JASS:
function Trig_Flame_Stomp_Conditions takes nothing returns boolean
    if ( GetSpellAbilityId() == 'A004' ) then
    endif
    return true
endfunction

function Trig_Flame_Stomp_Actions takes nothing returns nothing
    local location l = GetUnitLoc(GetTriggerUnit())
    local location offset = OffsetLocation(l, 0, 0)
    local integer i = 0
    loop
        call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset)
        set i = i + 1
        exitwhen i==9
    endloop
    call RemoveLocation(l)
    call RemoveLocation(offset)
    set l = null
    set offset = null
endfunction

//===========================================================================
function InitTrig_Flame_Stomp takes nothing returns nothing
    set gg_trg_Flame_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Flame_Stomp, Condition( function Trig_Flame_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Flame_Stomp, function Trig_Flame_Stomp_Actions )
endfunction
09-24-2006, 01:18 AM#6
darkwulfv
I hadn't gotten the chance to do it, so... I can't set these to a loop, because the offsets need to be set. I just hadn't gotten the chance. Oh, and I notced I had one too many effects. I could make a ton of offset locals, but that'd be a pain... So maybe I can just set, remove, set, remove, and so on.

EDIT: Ok, here's my new (and hopefully better) code.
Collapse JASS:
function Trig_Flame_Stomp_Conditions takes nothing returns boolean
    if ( GetSpellAbilityId() == 'A004' ) then
    endif
    return true
endfunction

function Trig_Flame_Stomp_Actions takes nothing returns nothing
   local location l = GetUnitLoc(GetTriggerUnit())
   local location offset = OffsetLocation(l,0,0)
   set offset = OffsetLocation(l,50,0)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset)
   set offset = OffsetLocation(l,50,50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,0,50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,-50,50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,-50,0)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,-50,-50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,0,-50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   set offset = OffsetLocation(l,50,-50)
    call AddSpecialEffectLoc("Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl", offset) 
   call RemoveLocation(offset)
   call RemoveLocation(l)
   set l = null
   set offset = null
endfunction

//===========================================================================
function InitTrig_Flame_Stomp takes nothing returns nothing
    set gg_trg_Flame_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Flame_Stomp, Condition( function Trig_Flame_Stomp_Conditions ) )
    call TriggerAddAction( gg_trg_Flame_Stomp, function Trig_Flame_Stomp_Actions )
endfunction