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

heres a challenge for you TRIGGER

Status
Not open for further replies.
Level 26
Joined
Apr 13, 2008
Messages
2,050
I need a trigger for a moving turret.
In the game Halo for example, there is a jeep with a gun on top, the gun swivels and fires at the enemy as the jeep continues to (for example) circle the opponent. you can use this model for the map (or reference) Puma - The Hive Workshop - A Warcraft III Modding Site or if you need two models for the trigger, you can use the steam tank and cannon tower to test it, and i will replace them with proper units later on. i will appreciate any help in the matter, and of course REP and thanks will be gladly given
 
Level 22
Joined
Jun 23, 2007
Messages
3,242
u cant without modifying the model.
so mmm... i think you would need to take off the guy and the machinegun, making it a seperate model.
the machinegun/gunner is attached ingame as a seperate unit. using unit moves to position of blah blah every x seconds or some shit like that. then he'll be able to rotate me thinks. Illidan(evil)x made this with tanks. it looked so pro.
 
Level 26
Joined
Apr 13, 2008
Messages
2,050
tower models such as the cannon tower in game swivels to face an opponent because it has no movement speed, no turn speed and the model itself has a bone called "Bone_Turret" which the game recognizes should be facing an enemy it is attacking. Good eyes on that one ike_ike, but it does not really help me here, but if you are someone else could figure it out by using that i would be eternally grateful
 
Level 9
Joined
Nov 28, 2008
Messages
704
Here you go.

Things to note:

This system can handle any unit being considered a tank, and any unit being considered a "turret".

  • Add Tank
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Siege Engine
      • Set TankCount = (TankCount + 1)
      • Set Tanks[TankCount] = (Last created unit)
      • Unit - Create 1 Gargoyle
      • Set Turrets[TankCount] = (Last created unit)
      • Unit - Turn Collision Off For (Last created unit)
Thiis isnt the full trigger.. but you MUST, where those Create things are.. you must set those variables to the last created unit, or if you make the trigger trigger when a building creates a unit, to the built unit... you must do the last 2 lines, with the 1 Gargoyle being your 1 Turret.

Dont forget any of those parts! Except for the first line if you are making it trigger when a tank is built.

ALso a thing to note: If you are just copying the triggers over, make sure you take a look in the Tank.wc3x at the top. Like, click on it as if it were a trigger. It contains code youll have to copy over to your map as well.

Also: your turret must have 1 move speed.It can have more, but 1 is what I recommend. 0 bugs it (the unit moves with it, but it doesnt show its model).

I recommend adding Locust to your Turret as well.

Enjoy! Oh, and test the map to see what it does.

Any complaints? Eh.. I might not check this thread.. Ill try to.

P.S. dont forget to create the variables I have in my map in yours as well if your copying it over!


To anyone else reading this, this is in normal JASS, and is usable by GUI triggering. it uses JASS triggers though. See above for what your trigger should be if using GUI!

For JASS people.. I hope if you know how JASS works you can figure it out yourself :) Just Custom Text that GUI above.
 

Attachments

  • Turret.w3x
    17.6 KB · Views: 48
Level 22
Joined
Jun 23, 2007
Messages
3,242
when the tank holds position, the gargoyle messes up and decides to try to run towards the target. wont attack anything else.
future problems: when you manually order the tank to attack an enemy unit.
making seperate models for tank and turret
the tank's own attack being used against another unit, while the turret attacks something else. could be useful like machine guns on the top of the turret though.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Alright, here is the bug fixed.

Enjoy.

(By the way, the bug wasnt ONLY with just hold position. Oh, and if you wanted to know, the bug fix is checking the units current order and issuing a stop order the instant it becomes "move".)
 

Attachments

  • Turret.w3x
    18.3 KB · Views: 75
Last edited:
Status
Not open for further replies.
Top