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

How to make a unit fire at an enemy without changing direction to face them

Status
Not open for further replies.
Level 8
Joined
Jul 29, 2010
Messages
319
I've got 2 giant spaceships, part of new type of map I'm working on and basically what happens is at the start of the match, a ship is spawned and very slowly makes it's way to enemies half of the map flying in a straight line, i want it to be able to fire on units without needing to stop, turn and face the enemy to attack it, how can i do this, I'll accept trigger methods.
 
Level 38
Joined
Feb 27, 2007
Messages
4,951
You can trigger your own target detection using some sort of a periodic trigger and checking nearby enemies. A projectile system or just using a spell like acid bomb could work for dealing damage periodically (cast an abilities from a dummy unit created at its location). Alternatively, Phoneix Fire is what Battleships uses, which could work for your scenario. It hits random nearby targets though.
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
Disable the ship's attack and trigger your own attack from a dummy when an enemy comes near the ship. When an enemy comes, make sure to stop the ship movement so it doesn't look like the ship is attacking while moving (or leave it if it's intended to be like that).
 
Level 11
Joined
May 16, 2016
Messages
730
I've got 2 giant spaceships, part of new type of map I'm working on and basically what happens is at the start of the match, a ship is spawned and very slowly makes it's way to enemies half of the map flying in a straight line, i want it to be able to fire on units without needing to stop, turn and face the enemy to attack it, how can i do this, I'll accept trigger methods.
Here is my GOLDLIKE template for you. If you want cooperate i could help you then.
This map contains the heavy ship which:
- have few cannons (they would shot if you face the right angle)
- able to attack while moving
- has the shooting cooldown
 

Attachments

  • SHIP.w3x
    9.2 MB · Views: 41
Last edited:
Level 11
Joined
May 16, 2016
Messages
730
thank you so much that's insane, will these triggers lag a multiplayer match though?
Can you use this version? I fixed the problem with side shooting. Now battleship side cannons works perfectly well.
I added anti air ship with fast attack speed and few side cannons. Air units gain 300% of damage.
 

Attachments

  • SHIP.w3x
    9.2 MB · Views: 33
Last edited:
Level 8
Joined
Jul 29, 2010
Messages
319
If you need help with your project, I can create more ships with abilities (if I'm not mistaken, your project is kind of battle tanks, right?)
My project is basically a 10 player map, 2 teams, it's basically an altered melee except there are two massive spaceships that will slowly fly from one side of the map to the other, one team has to destroy the two ships, the other has to ensure that they get to their objective, each ship having 200000 hp and a maximum movement speed of 10
 
Status
Not open for further replies.
Top