• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

any advice for making units into missiles

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I'm making "lasers" for my star wars game. So far I've made them into locust-based units that fly using a periodic trigger that detects nearby enemies and explodes doing damage when they come into contact.

I didn't see a tutorial on this, but I know it's been done before. Is there any advice for the following problems:

1. making the lasers fly straight over terrain
2. making the lasers impact on cliffs rather than fly over them

Thanks, and any general advice is welcomed, you don't have to write the whole triggers or anything. Note that I am experienced with the world editor but not with JASS.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
why don't you use the search engine if you know that it has been done before?
it sucks to have to write the same things again and again you know?
there are only a few people who are willing to change their knowledge and sometimes its quite boring....
however
the function you are looking for is:
JASS:
set udg_z = GetLocationZ(udg_zLoc)
this way you can get the exact height at any point of your terrain
to increase performance you can create a single location at map ini and move it with
JASS:
call MoveLocation(udg_zLoc, udg_x, udg_y)
1. to make things fly in a straight line to this:
save the height at the start point
move the missile
set the flying height to your value - GetLocationZ

make sure your dummy can't fly but has the Storm Crow Form ability so you can change it's flying height because flying units tend to fuck up things with their pitch angles and setting their flying height might not work correctly on cliff edges

for parabolas things are a little more complicated but I wrote a tutorial which also mentiones how to do it (it's not approved yet (don't know why) so that might be the reason why you couldn't find it)

2. if GetLocationZ > flying height make the missile die because it hit the ground
 
Level 14
Joined
Aug 30, 2004
Messages
909
That looks very interesting. I read your tutorial and I think I'll try to implement that as well.

I did search for previous posts, but I think I was missing all the key terms. When you're new to the area it's hard to know what words to use, you know?

I'm still new to JASS, but I've been using a few custom scripts here and there. Your tutorial looked very clear so I'll try to implement a version of it later tonight.

Thanks again, and +rep
 
Status
Not open for further replies.
Top