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

Spawning Units in a circle

Status
Not open for further replies.
Level 9
Joined
Dec 4, 2007
Messages
562
Hey I am using GUI and I wonder how I spawn units in a circle around my caster when I cast a spell. Like summoning smoke in a wide circle around my caster and then making them a unit group so it like damages all units that stand close to it.

I did find a guide http://www.hiveworkshop.com/forums/f279/chapter-1-static-shapes-gui-7337/ but I doesnt understand alot of that. So if somebody just coud tell me how to figure out the points and stuffs like that or just give me a the code for a circle plz. :)

remember I use GUI. :D
 
Level 9
Joined
Dec 4, 2007
Messages
562
Well try For loop integer A and spwan unit like offset of the hero by 300 and angle 60 x For loop integer A .... Remember to remove leaks :p

This is what I did
  • Fire Wall
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Fire Wall
    • Actions
      • Set FireWallCaster = (Casting unit)
      • Set FireWallMiddle = (Position of (Casting unit))
      • Unit - Create 1 Fire Wall (Dummy) for Player 1 (Red) at (FireWallMiddle offset by 400.00 towards ((Real((Integer A))) x (360.00 / 36.00)) degrees) facing (Random angle) degrees
      • Unit - Create 1 Fire Wall (Dummy) for Player 1 (Red) at (FireWallMiddle offset by 400.00 towards ((Real((Integer A))) x (360.00 / 36.00)) degrees) facing (Random angle) degrees
      • Set FireWallDummy = (Last created unit)
      • Trigger - Turn on Fire Wall Damage <gen>
      • Trigger - Turn on Fire Wall Cancel <gen>
      • Wait 6.00 seconds
      • Trigger - Turn off Fire Wall Damage <gen>
      • Trigger - Turn off Fire Wall Cancel <gen>
      • Unit - Remove FireWallDummy from the game
This doesnt work, can somebody tell me what the problem is?

Yes I know that it has some leaks but It aint done yet. I will fix other stuffs once I get a circle :p
 
Level 9
Joined
Dec 4, 2007
Messages
562
Worked :D thanks, and do somebody know how to ehh do so that all units in 150 range of the spawned units will take like 20 damage per second? I tried but as most of the times I tries, it didnt work out very well...
  • Fire Wall Damage
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 150.00 of (Position of (Matching unit)) matching ((Unit-type of (Matching unit)) Equal to Fire Wall (Dummy))) and do (If (((Picked unit) belongs to an enemy of (Owner of (Matching unit))) Equal to True) then do (Unit - Cause (Matching unit) to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal) else do (Do nothing))
 
Status
Not open for further replies.
Top