Special effect with JASS not working

Komaqtion

You can change this now in User CP.
Reaction score
469
Hi!
I'm trying to do my first thing with JASS all alone, ive copied things like a revive timer from thehelper before.
im trying to make 2 special effects at the target unit of the ability Ardent Mist, from Drunken Haze. this should be a very easy thing to do rught? but i cant get it to work
JASS:
function Trig_Ardent_Mist1_Actions takes nothing returns nothing
    local point ARDENTLOC
    local unit ARDENTUNIT
    set ARDENTUNIT =  GetSpellTargetUnit
    set ARDENTLOC = GetUnitLoc(ARDENTUNIT())
    call AddSpecialEffectLocBJ( ARDENTLOC, "Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl" )
    call AddSpecialEffectLocBJ( ARDENTLOC, "Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl" )
endfunction
 

Exide

I am amazingly focused right now!
Reaction score
448
Your special effects leak, and you never cleaned up the points.
Use this:

JASS:

call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", ARDENTLOC))

//Also

call RemoveLocation(ARDENTLOC)
set ARDENTLOC = null
set ARDENTUNIT = null


EDIT: Of course, change the special effect model to whatever you want.
 

Exide

I am amazingly focused right now!
Reaction score
448

Exide

I am amazingly focused right now!
Reaction score
448
Yea, of course. :p
Stupid copy and paste.. his fault!
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
and even better:



JASS:
    local unit ARDENTUNIT = GetSpellTargetUnit
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
And even better:
JASS:
    local unit ARDENTUNIT = GetSpellTargetUnit()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)


Resulting in:
JASS:
function Trig_Ardent_Mist1_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit()
    local location ARDENTLOC =GetUnitLoc(ARDENTUNIT)
    call AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction

Thought the unit variable is very unnecessary...
 

Exide

I am amazingly focused right now!
Reaction score
448
You forgot to remove the special effects. =(

JASS:

call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", ARDENTLOC))
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Thank you oo much all of you. youve been very helpfull :D:D

I wrote that before i tried it, it still doesnt work. this is how it looks now
JASS:
function Trig_Ardent_Mist1_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit ()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
    call AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
We've gotten to the point where "doesn't work" isn't nearly enough of a problem description. What happens? What should happen? What is the full code, including where you create the trigger and conditions?

With the "remove destructables" addition by exide the code should look like this:
JASS:
function Trig_Ardent_Mist1_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction

However, I think Doom and CloudOfFog are looping effects so destroying them right away might defeat the purpose of having them in the first place...
 

Komaqtion

You can change this now in User CP.
Reaction score
469
We've gotten to the point where "doesn't work" isn't nearly enough of a problem description. What happens? What should happen? What is the full code, including where you create the trigger and conditions?

With the "remove destructables" addition by exide the code should look like this:
JASS:
function Trig_Ardent_Mist1_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction

However, I think Doom and CloudOfFog are looping effects so destroying them right away might defeat the purpose of having them in the first place...

This is the entire trigger:
JASS:
function Trig_Ardent_Mist_Copy_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00L' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Ardent_Mist_Copy_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit ()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
    call AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction

//===========================================================================
function InitTrig_Ardent_Mist_Copy takes nothing returns nothing
    set gg_trg_Ardent_Mist_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ardent_Mist_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ardent_Mist_Copy, Condition( function Trig_Ardent_Mist_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Ardent_Mist_Copy, function Trig_Ardent_Mist_Copy_Actions )
endfunction

and i would like the effects to be there for the time it is on the spell, which is 7.50s 8s 8.50s 9s 9.50s 10s. i dont know the reason for it not working because i dont have it enabled and when i try to enable it there is an error
 

Exide

I am amazingly focused right now!
Reaction score
448
All your trigger does is to add special effects, why are you using JASS for this, you could do it easier with GUI. :p

Remove these two:
JASS:

    call AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    call AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)

However, calling DestroyEffect(AddSpecialEffectLoc .... might be too fast to remove the effect, for you to see it. (It gets removed the second it's born. -This only work with a few effects, like Thunderclap.)

I would've done it with two triggers and in GUI, if I were you.

To fix it in JASS, you will probably need to add waits, before removing the special effects. -Then you can't call DestroyEffect(AddSpecialEffectLoc...


I THINK this will work: (Never tested it.)

JASS:

function Trig_Ardent_Mist_Copy_Conditions takes nothing returns boolean
    if ( ( GetSpellAbilityId() == 'A00L' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Ardent_Mist_Copy_Actions takes nothing returns nothing
    local unit ARDENTUNIT = GetSpellTargetUnit ()
    local location ARDENTLOC = GetUnitLoc(ARDENTUNIT)
    local effect SFX1
    local effect SFX2
    set SFX1 = AddSpecialEffectLoc("Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl", ARDENTLOC)
    set SFX2 = AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl", ARDENTLOC)
    call TriggerSleepAction( 10.0 )    //The actual wait, whatever it&#039;s called, can&#039;t remember.. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
    call DestroyEffect(SFX1)
    call DestroyEffect(SFX2)
    call RemoveLocation(ARDENTLOC)
    set ARDENTLOC = null
    set ARDENTUNIT = null
endfunction

//===========================================================================
function InitTrig_Ardent_Mist_Copy takes nothing returns nothing
    set gg_trg_Ardent_Mist_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ardent_Mist_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ardent_Mist_Copy, Condition( function Trig_Ardent_Mist_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Ardent_Mist_Copy, function Trig_Ardent_Mist_Copy_Actions )
endfunction
 

Komaqtion

You can change this now in User CP.
Reaction score
469
well if i do it in GUI, how will i be able to remove the effects, they will be overwritten as last created special effect
 

Exide

I am amazingly focused right now!
Reaction score
448
This is how I do it:

Trigger 1:

Code:
Special Effect Destruction
    Events
    Conditions
    Actions
        Custom script:   local effect tempEffect
        Custom script:   set tempEffect = udg_SpecialFX
        Wait 7.00 game-time seconds
        Custom script:   set udg_SpecialFX = tempEffect
        Special Effect - Destroy SpecialFX


Trigger 2:

Code:
Crypt Spawn Runes
    Events
    Conditions
    Actions
        Set specloc = (Random point in Crypt Runes Spawn <gen>)
        Special Effect - Create a special effect at specloc using Abilities\Spells\Items\VampiricPotion\VampPotionCaster.mdl
        Set SpecialFX = (Last created special effect)
        Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
        Custom script:   call RemoveLocation(udg_specloc)

-Just change Trigger 2 so that it suits your needs.

This will keep the special effects for 7 seconds, then remove them -so they will have plenty of time to do whatever they do..
Just change the wait in Trigger 1 to suits your needs. (Or leave it as it is, it works fine.)
 

N-a-z-g-u-l

New Member
Reaction score
30
umm well what are you doing there?

JASS:
function Trig_Ardent_Mist_Copy_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == &#039;A00L&#039;
endfunction

function Trig_Ardent_Mist_Copy_Actions takes nothing returns nothing
    local location ARDENTLOC = GetUnitLoc(GetSpellTargetUnit())
    local effect e1 = AddSpecialEffectLoc(&quot;Abilities\\Spells\\Other\\Doom\\DoomTarget.mdl&quot;, ARDENTLOC)
    local effect e2 = AddSpecialEffectLoc(&quot;Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl&quot;, ARDENTLOC)
    call RemoveLocation(ARDENTLOC)
    set ARDENTLOC = null
    call PolledWait(7.5+0.5*GetUnitAbilityLevel(GetSpellTargetUnit(),GetSpellAbilityId()))
    call DestroyEffect( e1 )
    call DestroyEffect( e2 )
    set e1 = null
    set e2 = null
endfunction

//===========================================================================
function InitTrig_Ardent_Mist_Copy takes nothing returns nothing
    set gg_trg_Ardent_Mist_Copy = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ardent_Mist_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ardent_Mist_Copy, Condition( function Trig_Ardent_Mist_Copy_Conditions ) )
    call TriggerAddAction( gg_trg_Ardent_Mist_Copy, function Trig_Ardent_Mist_Copy_Actions )
endfunction


what about this one? :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top