• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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