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

Missiles Exploding on Doodads/Units

Status
Not open for further replies.
Level 6
Joined
Jun 14, 2008
Messages
191
Ok I have basically no idea how to do this, and know almost nothing on jass (but a lot about GUI). I've seen maps where missiles collide with walls/interact with terrain and explode or bounce. Is there a non-lagtastic way to do this with GUI, and if not, what would need to be done in jass?

I havn't tried to do this one yet, I have some ideas, but they all sound very laggy. Any help appreciated.
 
Level 5
Joined
Jan 3, 2008
Messages
164
No, he isn't trying to do that Hoernchen, he needs a way to stop a missile if it hits a wall, column or anything on its way. TM-Magic, what ways of doing this did you think of? Maybe if we hear them, we can help you more.
 
Level 6
Joined
Aug 13, 2008
Messages
197
are you using sappers as missiles. If so it relatively easy to make them interact with the enviroment. Simply allow the kaboom ability damage doodad and trigger the rest such as random targeting %chance to explode and so on in the triggers.
 
Level 9
Joined
Apr 5, 2008
Messages
529
The best way to do this would be to move the unit every 0.04 second or so and detect if the cordinate the missile is moving to is pathable. I think someone posted a simple scrip to do this some time ago, i'll see if i can find it.
It's very simple Jass so i guess you can use it. =P

Yay, found it:

JASS:
function CheckPathabilityTrickGet takes nothing returns nothing
    set bj_rescueChangeColorUnit = bj_rescueChangeColorUnit or (GetEnumItem()!=bj_itemRandomCurrentPick)
endfunction

function CheckPathabilityTrick takes item p, real x, real y returns boolean
    local integer i=30
    local rect r
    call SetItemPosition(p,x,y)
    if ((Pow(GetItemX(p)-x,2)+Pow(GetItemY(p)-y,2))<=100) then
        return true
    endif
    set r=Rect(x-i,y-i,x+i,y+i)
    set bj_itemRandomCurrentPick=p
    set bj_rescueChangeColorUnit=false
    call EnumItemsInRect(r,null,function CheckPathabilityTrickGet)
    call RemoveRect(r)
    set r=null
    return bj_rescueChangeColorUnit
endfunction

function CheckPathability takes real x, real y returns boolean
    local item it = CreateItem('ciri',x,y)
    local boolean b = CheckPathabilityTrick(it,x,y)
    call SetItemVisible(it,false)
    call RemoveItem(it)
    set it=null
    return b
endfunction

I think Vexorian made this one so give him credits in your map.
 
Level 6
Joined
Jun 14, 2008
Messages
191
Epimeliad, I'm not looking for a way for it to target walls/doodads. I'm looking for a way for it to target a unit and instead of going through terrain, gets destroyed by touching it.

RolePlaynGamer, thank you, I think that's what I"m looking for. It doesn't have any leaks does it? This trigger will be used a LOT and I need it as perfect as possible.
 
Status
Not open for further replies.
Top