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

Angle problem

Status
Not open for further replies.
  • Flame Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Blast
    • Actions
      • Set FS_AoE = (Position of (Casting unit))
      • Set FS_Player = (Owner of (Casting unit))
      • For each (Integer A) from 1 to 35, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Universal Dummy for Player 4 (Purple) at FS_AoE facing Default building facing degrees
          • Set FS_Dummy = (Last created unit)
          • Unit - Order FS_Dummy to Undead Dreadlord - Carrion Swarm (FS_AoE offset by 700.00 towards (10.00 x (Real((Integer A)))) degrees)
          • Unit - Add a 0.45 second Generic expiration timer to FS_Dummy
      • Custom script: call RemoveUnit(udg_FS_Dummy)
      • Custom script: call RemoveLocation(udg_FS_AoE)
The Angles don't seem to work accurately. I wanted it to release a blast every 10 angles but it just doesn't. Can anyone tell me why?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
You have a memory leak where you order the spell to be cast. Set the target point to a new location variable and clean it up in the loop.

As far as the malfunction goes, try setting the unit's facing angle in the unit creation action. That aside, I don't see why it wouldn't work.

Please post a screenshot of the malfunction.
 
like this?
  • Flame Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flame Blast
    • Actions
      • Set FS_AoE = (Position of (Casting unit))
      • Set FS_Player = (Owner of (Casting unit))
      • For each (Integer A) from 1 to 36, do (Actions)
        • Loop - Actions
          • Set FS_Angle = (10.00 x (Real((Integer A))))
          • Unit - Create 1 Universal Dummy for Player 4 (Purple) at FS_AoE facing FS_Angle degrees
          • Set FS_Dummy = (Last created unit)
          • Unit - Order FS_Dummy to Undead Dreadlord - Carrion Swarm (FS_AoE offset by 700.00 towards FS_Angle degrees)
          • Unit - Add a 0.45 second Generic expiration timer to FS_Dummy
      • Custom script: call RemoveUnit(udg_FS_Dummy)
      • Custom script: call RemoveLocation(udg_FS_AoE)
Edit: still has it.
Untitled.jpg

------------------
Edit 2: Still left out dummies.. what can I do?
 
Last edited:
Level 9
Joined
Dec 12, 2007
Messages
489
for instant cast:
0 movement speed means it need to be set in Gameplay Constants to allow movement speed of zero, and it still allow unit to turn if i remember correctly, it just disable movement.
better option is to remove the dummy ability to move via script.
JASS:
    call UnitRemoveAbility(udg_FS_Dummy,'Amov')

btw i agree with rulerofiron99, there might be some dummies not casting the Carrion Swarm, as there should be 36 carrion swarms seen in screenie.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
for instant cast:
0 movement speed means it need to be set in Gameplay Constants to allow movement speed of zero
That would seem logical, but it's not true.
Without changing the gameplay constants, a movement speed of 0 removes the ability to move (and turn, thus the exact same thing as what you do with the script, but easier).

And as Garfield1337 rightfully mentioned, it does indeed give a single dummy the ability to cast all 36 carrion swarms in all directions at the same time.
It's probably worth the try :)
 
Level 9
Joined
Dec 12, 2007
Messages
489
Set FS_Angle must be set to 0 also in every cast...
I don't think it need to be set to 0 in every cast, as implied in the loop part that udg_FS_Angle value is always set to Integer A x 10.00 in each loop iteration.

and like rulerofiron99 said, it will be better to remove a location leak in the process:
  • (FS_AoE offset by 700.00 towards FS_Angle degrees)
you need to save it to location variable and remove it inside the loop.
 
Status
Not open for further replies.
Top