• 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] Angles in a circle

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
hey.. im trying to do a code for a request that does a circle of units.. (mui)

i've made most of it.. knockback's done, everything..
but i want it to follow the unit aswell..
the way i created it fails, cuz i dont know the exact count (i move them in a unit group, when i created it was a loop)

so i tried this
  • Custom script: local real x
  • Custom script: local real y
  • Set EnergyField_Count[EnergyField_Index[4]] = (EnergyField_Count[EnergyField_Index[4]] + 1)
  • Custom script: set udg_EnergyField_Angle = ((360 / udg_EnergyField_AmountOfDummies[udg_EnergyField_Index[4]]) * udg_EnergyField_Count[udg_EnergyField_Index[4]]) * bj_DEGTORAD
  • Custom script: set x = GetUnitX(GetEnumUnit()) + udg_EnergyField_DistanceFromTarget * Cos (udg_EnergyField_Angle)
  • Custom script: set y = GetUnitY(GetEnumUnit()) + udg_EnergyField_DistanceFromTarget * Sin (udg_EnergyField_Angle)
  • Custom script: call SetUnitX(GetEnumUnit(), x)
  • Custom script: call SetUnitY(GetEnumUnit(), y)
and yeah, at the end of the unit group i do:

  • Set EnergyField_Count[EnergyField_Index[4]] = 0
(also, its really easy to understend EnergyField_Index[4] = my loop..)

well.. my real problem is this:
the created dummies start going mad,
they go forward and forward,
then theres a weird line in minimap, (like when you get vision of a line)
then it crushes the game..

any idea? o.o
 
Status
Not open for further replies.
Top