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

[Trigger] I Need help with an idea.

Status
Not open for further replies.
Level 3
Joined
Jan 9, 2005
Messages
25
So I have this Ship (unit) and I also terrained an area to look like the interior

of the unit ship. Inside the ship there are gun turrets. What I would very

much like to do is when the ship (Unit) is attacked I want it so the unit

turrets under it turn with it. The Ship (Unit) does not move but it is able to

turn. So I would like it so when the left wing on the ship (Unit) turns the

turret under it turns as well. Also I want it so the left wing turret

can only hit enemies on the left side of the ship. Please give full

trigger(s), I will make sure to put your name in my map.

Thank you!
 
Level 16
Joined
Mar 26, 2004
Messages
569
Just a thought. (haven't tested)
  • Events
    • Time - Every 0.01 seconds periodic
  • Conditions
    • Boolean - UnderAttack is equal to True
  • Actions
    • Unit - Set unit facing of Turret[Rightside] to Facing of ShipUnit +90
    • Comment - This will make the turret look to the RIGHT if the ship is forward.
    • Unit - Set unit facing of Turret[Rightside] to Facing of ShipUnit -90
    • Comment - This will make the turret look to the LEFT if the ship is forward.
Maybe it's vice versa, +90 makes it left and -90 makes it right. Not sure ^^
 
Level 3
Joined
Jan 9, 2005
Messages
25
Uhh the ship can't move it only turns and it doesn't turn in 90 degree intervals it can slowly turn left or right in a 1-360 degree interval.

And it doens't have to be attacked just i want ti to always be beneath the wing when the ship turns.
 
Level 8
Joined
Dec 8, 2007
Messages
312
First make 3 variables
Left_Turret
Right_Turret
Ship
  • Ship cannons
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit - Move Left_Turret instantly to ((Position of Ship) offset by 50.00 towards ((Facing of Ship) + 90.00) degrees), facing ((Facing of Ship) + 90.00) degrees
      • Unit - Move Left_Turret instantly to ((Position of Ship) offset by 50.00 towards ((Facing of Ship) - 90.00) degrees), facing ((Facing of Ship) - 90.00) degrees
That will move turrets like you want. Something similar I was using in my own map so this should work.
Making Turrets attack one side only would be harder. Easiest way would be to give them Shockwave ability and make them cast it in front of them selfs.
 
Status
Not open for further replies.
Top