• 🏆 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!

"Shoot" Spell - How to make it?

Status
Not open for further replies.
Level 12
Joined
May 30, 2009
Messages
829
Hey,

I would like to know how to make a spell that sends out an arrow (shoot) at a targeted point, and deals damage to the first unit it comes in contact with. GUI, JASS, or vJASS is all fine. If you could post a map, link, or code here, I would really appreciate it. :smile:

~Aesthetics~
 
Level 12
Joined
May 30, 2009
Messages
829
Do you know vJass?
I'm an idiot who knows how to convert some GUI to vJass using my head, and since I know GUI, I assume I can do vJass. But experience is really limited, and I never made a spell using vJass, or have made anything in vJass before. I'll give it a try.

Anyways, +REP

EDIT: I epic failed after trying to make the spell. Will request spell in request section.
 
Last edited:
Level 4
Joined
Apr 23, 2009
Messages
65
Well simply, all you have to do is create a dummy unit(with arrow model or whatever you want it to be) then instantly move it to a set point infront of it. This does require the triggers to understand so i will post a test map as soon as i can.
EDIT: hopefully this is what you wanted. I havent cleared the leaks added special effects or make it enemies only because it was sort of a rush job :S
 

Attachments

  • Shoot Arrow.w3x
    18.8 KB · Views: 80
Last edited:
Level 12
Joined
May 30, 2009
Messages
829
It works, that's nice, but I see two flaws.

1. That shock wave effect is really a turn-off. :hohum:

2. An arrow got stuck:
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    1.1 MB · Views: 148
Level 4
Joined
Apr 23, 2009
Messages
65
I felt bad for submitting such a crappy one before so i fixed it up by alot. Arrow no longer gets stuck, no more shockwave effect, added blood effect and no longer hits allies. Hope this helps.
 

Attachments

  • Shoot Arrow.w3x
    19.9 KB · Views: 63
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Set SA_Angle = (Angle from (Position of (Triggering unit)) to (Target point of ability being cast))
Leaks

  • Set SA_Angle = (Angle from (Position of (Triggering unit)) to (Target point of ability being cast))
This leaks too

Here
  • Set SA_HitUnits = (Random 1 units from (Units within 50.00 of SA_MoveLoc))
I suggest you to increase the AOE of the arrow to 150-175, b/c it may pass thru bigger units without hitting them
 
Level 4
Joined
Dec 9, 2008
Messages
52
Here's how you do it in English.

An archer shoots an arrow at an orc behind a tree.
The arrow flies through the air.
The arrow hits the tree.
Tree takes damage.

Here's what is really happening:

"An archer shoots an arrow at a target behind a tree."
The archer's shot is detected. A unit named "Arrow" is created. Arrow is added to a group called "arrows being shot". Arrow's direction and speed are added to a hashtable under the arrow's handleid. Direction is calculated by atan2(tree's y coordinate - archer's y coordinate, tree's x coordinate - archer's x coordinate). Speed is a constant that you get to make up.

"The arrow flies through the air."
Every .0167 seconds, the group called "arrows being shot" is cycled through. Arrow is in that group. Its direction and speed are retrieved from the hashtable. Arrow's position is changed based on those two numbers. Units around arrow are cycled through. If any of those units are viable, then arrow has hit something. Position is changed by setting arrow's X and Y positions. New X position is speed*cos(direction) + current X position. New Y position is speed*sin(direction) + current x position.

"The arrow hits the tree."
During one of the .0167 second cycles, a tree is detected. Arrow is removed from the group "arrows being shot", arrow is destroyed, its hashtable values are flushed, and the damaging effect is executed.

"Tree takes damage."
A dummy unit is created, it casts a spell of whatever damaging effect the arrow will do on the tree. The dummy unit expires.
 
Status
Not open for further replies.
Top