• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Shooting a Gun Ability

Status
Not open for further replies.
Level 2
Joined
Feb 2, 2008
Messages
10
Hey Guys, here's what I'm trying to do:
Make an ability that when used, kills the closest enemy to the caster in the caster's facing angle. Think of it this way, if my Marine is facing a Spider and I use my 'Shoot' ability, a bullet flys through the air and kills the Spider. Some things need to be a certain way though. I need to be able to kill only the CLOSEST Spider, and not the other Spider behind the dying one. Basically meaning I want to only kill one enemy per bullet, without it going through 5 and killing them all too. I have already made an ability based off 'Battle Roar', which when used plays my Marine's 'Attack' animation. I made a trigger that sets a 'Point' Variable where the Marine is facing offset by 500. I can't figure out how to play a 'Flying Bullet' animation between the caster and the 'Point' Variable, and have the closest enemy between those two points die. Please help contribute with whatever you can. I'd like to do this with Triggers, but if JASS or whatever need to be in there, that's ultimately ok.
Thanks,
 
  • Event
  • Unit - A unit casts (Shoot)
  • Conditions
  • Actions
  • Unit - Create 01 (Dummy Shooter) at (Position of (Triggering Unit))
  • Unit - Issue order (Last Created Unit) to (Attack) (Unit Owned by (Player that is an Enemy of (Owner of (Triggering Unit))) that is within (Range) of (600.00)
Shud look something like that
Altho this doesnt belong in the tut section
 
Level 2
Joined
Feb 2, 2008
Messages
10
That attacks any random unit within range of the dummy, I want to attack the closest enemy to my Marine in his facing angle. Plus, that won't have a bullet fly through the air unless I give my Marine an attack and make him attack the dummy, but then the Marine will attack on his own which defeats the purpose of a Shoot ability.
 
Level 2
Joined
Feb 2, 2008
Messages
10
That gives my an idea on how to make this work though, thanks for the suggestion. Any other help is still much appreciated and needed!
 
Eh, then just make your point and it has to be a unit in range of X of that point. As for the bullet;
  • Event
  • Unit - A Unit casts Shoot
  • Conditions
  • Actions
  • Unit - Spawn 1 (Dummy Bullet) at (Position of (Triggering Unit))
  • Unit - Issue Order (Last Created Unit) to (Move) to (Position of (Point X))
  • Variable - Make (Last Created Unit) (Bullet (Number of (Owner of (Triggering Unit))))
or your dummy shooter would just have a missile - a lot easier. Just make it attack a unit near that point. Not that hard.
 
Level 2
Joined
Feb 2, 2008
Messages
10
I was trying to get a tutorial response to my question. If it's the wrong forum, please note I only have 10 posts. Noone reads the rules anyway. Thankyou Belgarth for your help so far, I'll try a few of your ideas later tonight.
 
Level 2
Joined
Aug 11, 2007
Messages
12
Why make this triggered at all....?

Base the ability off of shockwave. Then make the dmg 99999 or something, and the max dmg 99999. Then, only one unit will be hit, and that unit will die. The shockwave (bullet) will likey go through that unit...but maybe not. I dunno. =P

Change shockwave's fields as nessesary...and I'm pretty sure it should work.
 
Status
Not open for further replies.
Top