• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

"Shoot" Spell - How to make it?

Status
Not open for further replies.
Level 13
Joined
May 30, 2009
Messages
828
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~
 
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:
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

Last edited:
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: 193
  • 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
 
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.
Back
Top