• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Create a location from targetted spell?

Status
Not open for further replies.
Level 5
Joined
Oct 10, 2012
Messages
109
So i try to make a GUI spell
Like a meteor fall down from the sky and from the center of explosion it created 8 shockwave to 0,45,90,135,180,225,270,315,360 degrees from the center.

So i tried to use inferno skill for the meteor effect and shockwave to the 8 different points but i don't know how to create a point where the shockwave should be shot

I think its maybe the offset or coordinates things that i should use or maybe location handle. Never use all of that

Can someone give explaination how to do this
 
  • Events
  • Unit - Unit starts the effect of an ability
  • Conditions
  • Ability being cast equal to Your_Ability
  • Actions
  • For each Integer Int_Var from 1 to 8 - Do Actions
    • Actions
      • Set Point = Position of Triggering Unit
      • Set Point2 = Point Offset by ShockWave_Range towards 45 X Int_Var degrees
      • Unit - Create 1 Dummy at Point for Triggering Player facing Default Building degrees
      • Unit - Add 1.00 seconds expiration timer to Last Created Unit
      • Unit - Order Last Created Unit to Orc Tauren Chieftain - Shockwave Point2
      • Custom Script : Call RemoveLocation(udg_Point)
      • Custom Script : Call RemoveLocation(udg_Point2)
 
Last edited:
Level 18
Joined
Sep 14, 2012
Messages
3,413
I would prefer to make it in JASS because it's way easier to use coordinates.
Infact, you can get the location of the casted spell, store it into a variable.
Also there is a bug : you cast only 0,45,90,135,180,225,270 and 315. You don't cast 360 since it's the same as 0.

Then we have our point.
Now use the classic formula : to get a point with a known angle, we use cos and sin.

To now where you should cast use this :
Final point = ( Initial Point - X * 10 * Cos( angle ) ; Initial Point - Y * 10 * Sin( angle ) ) !

EDIT : Too late xD !
 
Maker, sadly, sometimes one dummy can error out (I did have this happened to me once, the dummy just cast the spell once and ignore the rest). I did know Dummy are heavy operation :/ (I guess blame the System). It's better be safe than sorry :)

Anyway :

  • Events
  • Unit - Unit starts the effect of an ability
  • Conditions
  • Ability being cast equal to Your_Ability
  • Actions
    • Unit - Create 1 Dummy at Point for Triggering Player facing Default Building degrees
    • Unit - Add 1.00 seconds expiration timer to Last Created Unit
  • For each Integer Int_Var from 1 to 8 - Do Actions
    • Actions
      • Set Point = Position of Triggering Unit
      • Set Point2 = Point Offset by ShockWave_Range towards 45 X Int_Var degrees
      • Unit - Order Last Created Unit to Orc Tauren Chieftain - Shockwave Point2
      • Custom Script : Call RemoveLocation(udg_Point)
      • Custom Script : Call RemoveLocation(udg_Point2)
^Makers way :)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Maker, sadly, sometimes one dummy can error out (I did have this happened to me once, the dummy just cast the spell once and ignore the rest). I did know Dummy are heavy operation :/ (I guess blame the System). It's better be safe than sorry :)

Anyway :

  • Events
  • Unit - Unit starts the effect of an ability
  • Conditions
  • Ability being cast equal to Your_Ability
  • Actions
    • Unit - Create 1 Dummy at Point for Triggering Player facing Default Building degrees
    • Unit - Add 1.00 seconds expiration timer to Last Created Unit
  • For each Integer Int_Var from 1 to 8 - Do Actions
    • Actions
      • Set Point = Position of Triggering Unit
      • Set Point2 = Point Offset by ShockWave_Range towards 45 X Int_Var degrees
      • Unit - Order Last Created Unit to Orc Tauren Chieftain - Shockwave Point2
      • Custom Script : Call RemoveLocation(udg_Point)
      • Custom Script : Call RemoveLocation(udg_Point2)
^Makers way :)


Alternatively create 8 hidden dummies to use for this spell at map init.

Then move them all to the center using setunitx/y

Then order them to cast shockwave. This allows only 8 units to be created for this spell for the entire map.
 
Status
Not open for further replies.
Top