• 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.

Storm bolt question

Status
Not open for further replies.
Level 7
Joined
Jul 12, 2008
Messages
295
Can u tell me how can I detect when the stormbolt hits the target.. So i want when the stormbolt hits the target to play a sound? PLease help
 
Level 7
Joined
Jul 12, 2008
Messages
295
But I can't make it i don't know why, because how can i find when the stormbolt missle hits?! I have tryed to copy the stunned(pause) buff and make it custom for my spell but doesn't show the buff and what if the unit dies? The buff won't even show?. When I'm done +rep i promise
 
Level 6
Joined
Sep 13, 2008
Messages
261
someone told me that if you wait x seconds

where x is distance between unit and caster / missle speed

It will be exactly what you are looking for for your wait time.


But all those are good ways that I didn't think about thank you all for expanding my knowledge
 
Last edited:
Level 17
Joined
Jan 21, 2007
Messages
2,014
someone told me that if you wait x seconds

where x is distance between unit and caster / missle speed

It will be exactly what you are looking for for your wait time.


But all those are good ways that I didn't think about thank you all for expanding my knowledge

But that would only work on not moving targets, wouldn't it?

For slow-moving missiles and/or fastmoving units, or even units that teleport away from the missile, it would mess up totally.

Unless i got it totally wrong xD


As for a solution for if the target is killed(for future spells maybe) just set the storm bolt dummy damage to 0 and do the damage via triggers after the unit has the stun.
 
Level 6
Joined
Sep 13, 2008
Messages
261
terradont is right

But that screws up any single wait time.

But most poeple know that the only way to make a reliable on hit effect is with periodic .01 sec checks or to use a jass damage detection system(no clue how this works haven't checked it yet).

well besides object editor stuff that is
 
Level 5
Joined
Jan 6, 2006
Messages
106
Here is how I use to time the exact time when a projectile based target spell hits a target.
My procedures are quite tedious though, although I inserted my own leak prevention. Maybe someone else can make a simplified version of this.

JASS:
function SpellMove takes nothing returns nothing
    local trigger trg = GetTriggeringTrigger()
    local unit u = GetHandleUnit(trg,"u")
    local unit t = GetHandleUnit(trg,"t")
    local unit e = GetHandleUnit(trg,"e")
    local unit f = null
    local location l = GetUnitLoc(e)
    local location m = GetUnitLoc(t)
    local location n = PolarProjectionBJ(l,---(Missile Speed * 0.02)---,AngleBetweenPoints(l,m))
    local group k = GetUnitsInRangeOfLocAll(---(Missile Speed * 0.02)---, l)
    call SetUnitPositionLocFacingBJ(e,n,AngleBetweenPoints(l,m))
    if IsUnitInGroup(t, k) then
 
        ----(Insert Spell Effect here)-----

        call RemoveLocation(l)
        call RemoveLocation(m)
        call RemoveLocation(n)
        call GroupClear(k)
        call DestroyGroup(k)
        call DisableTrigger(trg)
        call FlushHandleLocals(trg)
        call DestroyTrigger(trg)
        set u = null
        set t = null
        set e = null
        set k = null
        set l = null
        set m = null
        set n = null
        set f = null
        set trg = null
    endif
    call RemoveLocation(l)
    call RemoveLocation(m)
    call RemoveLocation(n)
    call GroupClear(k)
    call DestroyGroup(k)
    set u = null
    set t = null
    set l = null
    set m = null
    set n = null
    set k = null
    set e = null
    set f = null
    set trg = null
endfunction

function Trig_SpellName_Actions takes nothing returns nothing
    local unit u = GetSpellAbilityUnit()
    local unit t = GetSpellTargetUnit()
    local location l = GetUnitLoc(u)
    local unit e = CreateUnit(GetOwningPlayer(u),---(Dummy Caster)---,GetLocationX(l),GetLocationY(l),0.00)
    local trigger trg = CreateTrigger()
    call SetHandleHandle(trg,"u",u)
    call SetHandleHandle(trg,"t",t)
    call SetHandleHandle(trg,"e",e)
    call TriggerRegisterTimerEventPeriodic(trg,0.02)
    call TriggerAddAction(trg,function SpellMove)
    call RemoveLocation(l)
    set u = null
    set t = null
    set l = null
    set e = null
    set trg = null
endfunction

I created a dummy caster and move it towards the target in 0.02 second intervals upon casting, and destroy it and initialize spell effects upon contact.

And yeah, don't worry about lag issues. I've used these types of spells on really crap PCs and they still run smoothly.
 
Level 7
Joined
Jul 12, 2008
Messages
295
Thank you guys for the help but... bountygiver can i get that in GUI cuz i don't understand JASS rly....? And doom_sheep it doesn't work with giving the buff a sound because u can't give imported sounds to the buff... That is the problem
 
Level 5
Joined
Jan 6, 2006
Messages
106
Thank you guys for the help but... bountygiver can i get that in GUI cuz i don't understand JASS rly....? And doom_sheep it doesn't work with giving the buff a sound because u can't give imported sounds to the buff... That is the problem

Well... I tried, it can be done in GUI, but I can't find a way to make it support multiple casters with GUI, so... sorry but I'm making it in JASS here. I've included a test map with my post. It's a storm bolt with an exploding effect which basically uses the previous system i mentioned in my last post a few weeks ago. I've put the instructions in the trigger comments.

Hope this will help. :)

EDIT: Fixed a critical bug with the last uploaded test map.
 

Attachments

  • Explosive Storm Bolt.w3x
    18.5 KB · Views: 35
Last edited:
Level 7
Joined
Jul 12, 2008
Messages
295
OK i will use it somehow but i think it won't be that helpful cuz i don't understand JaSS but i'll try something +rep for your hard work
 
Status
Not open for further replies.
Top