• 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] Whats wrong with this?

Status
Not open for further replies.
Level 12
Joined
Dec 10, 2008
Messages
850
Ok, so I've recently been tying to make VJASS spells, and I've got alot of the basics down, like how to int them and everything, but heres my problem. I have a message that displays right after all the locals are declared so I know if it works or not. Its showed up everytime I have it right there, but nothing elsew after it apears to work, and warcraft doesn't close or do anything diffrent..... So whats wrong with this?

JASS:
scope Test initializer IntTrig_Test

     private function Conditions takes nothing returns boolean
         return GetSpellAbilityId() == 'AOOO'
     endfunction
     private function Actions takes nothing returns nothing
         local unit x = GetSpellAbilityUnit()
         local location l = GetSpellTargetLoc()
         local string e = "Abilities/Weapons/PhoenixMissile/Phoenix_Missile_mini.mdl"
         local string f = "Objects/Spawnmodels/Other/NeutralBuildingExplosion/NeutralBuildingExplosion.mdl"
         local effect c
         local effect g
         local string w = "weapon"
         local string h = "chest"
         local integer i =10
         call BJDebugMsg ("It worked")
         call AddSpecialEffectTarget(e,x,w)
         set c = GetLastCreatedEffectBJ()
         loop
         exitwhen i==0
             call AddSpecialEffectLoc(f,l)
             set g = GetLastCreatedEffectBJ()
             call TriggerSleepAction(0.30)
             call DestroyEffect(g)
         endloop
         call TriggerSleepAction(0.20)
         call DestroyEffect(c)
         set x=null
         call RemoveLocation(l)
         set e=null
         set f=null
         set w=null
         endfunction
         
     private function IntTrig_Test takes nothing returns nothing
         local trigger I = CreateTrigger()
         call TriggerRegisterAnyUnitEventBJ(I, EVENT_PLAYER_UNIT_SPELL_EFFECT )
         call TriggerAddCondition(I, Condition (function Conditions))
         call TriggerAddAction(I, function Actions)
         endfunction
endscope

I'm not looking for leaks and other bad things YET, but I will be as soon as this problem goes away.
 
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
816
JASS:
     private function Actions takes nothing returns nothing
         local unit x = GetSpellAbilityUnit()
         local location l = GetSpellTargetLoc()
         local string e = "Abilities/Weapons/PhoenixMissile/Phoenix_Missile_mini.mdl"
         local string f = "Objects/Spawnmodels/Other/NeutralBuildingExplosion/NeutralBuildingExplosion.mdl"
         local effect c
         local effect g
         local string w = "weapon"
         local string h = "chest"
         local integer i =10
         call BJDebugMsg ("It worked")
         set c = AddSpecialEffectTarget(e,x,w)
         loop
         exitwhen i==0
             set g = AddSpecialEffectLoc(f,l)
             call TriggerSleepAction(0.30)
             call DestroyEffect(g)
             set i=i-1
         endloop
         call TriggerSleepAction(0.20)
         call DestroyEffect(c)
         set x=null
         call RemoveLocation(l)
         set l=null
         set c=null
         set g=null
         endfunction
 
Level 12
Joined
Dec 10, 2008
Messages
850
Oh, I missed probably the stupidest thing ever...... Thanks

Edit: I'd rep you, but I need to spread it around first

Edit2:
Still no effects apearing, theres sothing terribley wrong I'm guessing... could it be that I'm running 1.23 WC? because it doesn't cause problems with other VJASS spells
 
Last edited:
Status
Not open for further replies.
Top