• 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.

Turning ship

Status
Not open for further replies.
Level 3
Joined
Sep 4, 2010
Messages
68
I want to make a ship unit that must turn to attack, i mean, like the real cannon ships. I was trying but i didn't find the way to do so; can you help me please?
 
Level 11
Joined
Sep 9, 2010
Messages
368
If you want your ships attack from their sides, should you put up a casting dummy that will do the attacks for your ships.

I've not access to WE at the moment, but I'll do a try to make a trigger for you anyhow.

  • Spell attack:
    • Events
      • Unit starts casting an ability.
      • Condictions
        • Casting spell is equal to YOUR CANNON SPELL
          • Actions
        • Create a CANNON DUMMY for Owner of casting unit at position of casting unit with angle of casting unit + 90 degrees.
        • Add 1 second generic timer for Last Created Unit.
        • Issue Last Created unit to attack ground at Position of Casting unit with 90 degrees offset and 500 range.

Okey, this trigger looks horrible, but I hope you can understand it and can make something out of it. :ogre_hurrhurr:
 
Last edited:
Level 3
Joined
Sep 4, 2010
Messages
68
I think this is necropost, but....
If anyone reads, i see the side attack map doesnt make it work with recently made ships, can you help me?
 
@Davesanz, it's because Trig4 is not correct. It uses picked unit, when it should be triggering unit. Change it to this:
  • Trig 4
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Ship
    • Actions
      • Unit Group - Add (Triggering unit) to Ships
      • Set Loc[0] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Loc[0] facing Default building facing degrees
      • Hashtable - Save Handle Of(Last created unit) as 0 of (Key (Triggering unit)) in ShipHash
      • Hashtable - Save Handle Of(Triggering unit) as 0 of (Key (Last created unit)) in ShipHash
      • Custom script: call RemoveLocation(udg_Loc[0])
 
Level 3
Joined
Sep 4, 2010
Messages
68
Thank u, ill try it.
EDIT: It worked, but units created later dont need to be at 90 degrees to shoot, help a lazy man again please!
 
Last edited:
Status
Not open for further replies.
Top