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

[Trigger] Wisp Wheel for TD

Status
Not open for further replies.
Level 2
Joined
May 25, 2006
Messages
13
In my Tower Defence, i have a series for special towers, i need one where a unit orbits around a tower, and when the orbital hits (comes within 150 range) a units it loses armor.


Heres a list of all the variables involved
armorkilltempoint1a(array 1-6)
armorkilltempoint1b(array 1-6)
armorkilltempoint1c(array 1-6)
armorkillunit(array 1-6)


Heres a list of al the triggers involved

I have to Orbiting trigger down, for the most part:
works very well,and may leak im not sure

  • armorkiller
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set armorkilltempoint1a[(Integer A)] = (Position of armorkillunit[(Integer A)])
          • Set armorkilltempoint1b[(Integer A)] = (armorkilltempoint1a[(Integer A)] offset by 10.00 towards ((Facing of armorkillunit[(Integer A)]) + 2.00) degrees)
          • Set armorkilltempoint1c[(Integer A)] = (armorkilltempoint1b[(Integer A)] offset by 10.00 towards ((Facing of armorkillunit[(Integer A)]) + 2.00) degrees)
          • Unit - Move armorkillunit[(Integer A)] instantly to armorkilltempoint1b[(Integer A)], facing armorkilltempoint1c[(Integer A)]
          • Custom script: call RemoveLocation (udg_armorkilltempoint1a[bj_forLoopAIndex])
          • Custom script: call RemoveLocation (udg_armorkilltempoint1b[bj_forLoopAIndex])
          • Custom script: call RemoveLocation (udg_armorkilltempoint1c[bj_forLoopAIndex])

Then when the tower is built to start up the wheel for that player:
Works Flawlessly

  • armorkillerstart
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Armor Melt Tower
    • Actions
      • Unit - Create 1 Wisp for (Owner of Constructed Structure) at ((Position of (Constructed structure)) offset by 400.00 towards 90.00 degrees) facing 180.00 degrees
      • Set armorkillunit[(Player number of (Owner of (Constructed structure)))] = (Last created unit)

The triggers that creates a dummy to cast farie fire to reduce armor.
this trigger currently dosnt work and idk why

  • armorkillerchange
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units within 150.00 of (Position of armorkillunit[(Integer A)]) matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Create 1 armorkilldummy for (Player((Integer A))) at armorkilltempoint1b[(Integer A)] facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
A bonus trigger thats supposed to reset the orbital incase it gets bumped and wont make a circle anymore.
but when its used it moves the unit where it should but it dosnt orbit the tower

  • armorkillerreset
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Reset Orbital
    • Actions
      • Unit - Move armorkillunit[(Player number of (Owner of (Casting unit)))] instantly to ((Position of (Casting unit)) offset by 400.00 towards 90.00 degrees), facing 180.00 degrees
I just need help geting these triggers straight
 
Level 9
Joined
May 27, 2006
Messages
498
I hope you do realise that this trigger is not MUI? You should make it possible to build only one tower of this type per player, otherwise whole trigger wont work...

Just use Unit - A unit comes within 150.00 of Your_unit...
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Still it is not MUI, it is MPI.
I suggest changing:
Set armorkilltempoint1b[(Integer A)] = (armorkilltempoint1a[(Integer A)] offset by 10.00 towards ((Facing of armorkillunit[(Integer A)]) + 2.00) degrees)
Set armorkilltempoint1c[(Integer A)] = (armorkilltempoint1b[(Integer A)] offset by 10.00 towards ((Facing of armorkillunit[(Integer A)]) + 2.00) degrees)
to:
Set armorkilltempoint1b[(Integer A)] = (armorkilltempoint1a[(Integer A)] offset by 19.00 towards ((Facing of armorkillunit[(Integer A)]) + 4.00) degrees)

That is not exactly the same, but if you want it to be, you must make one simple calculation SquareRoot(200*(Cos(4)+1)) the result is the offset distance.
P.s. 19 is close.
And do not put that formula in the trigger, calculate it and put the result.
 
Status
Not open for further replies.
Top