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

[JASS] Create a Sphere Nova

Status
Not open for further replies.
Level 16
Joined
Mar 3, 2006
Messages
1,564
  • Events
  • Conditions
  • Actions
    • Set Centre = (Player 1 (Red) start location)
    • Set R = 500.00
    • For each (Integer A) from 0 to 36, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 0 to 18, do (Actions)
          • Loop - Actions
            • Set X = (R x (Cos((10.00 x (Real((Integer B)))))))
            • Set Y = (R x (Sin((10.00 x (Real((Integer B)))))))
            • Unit - Create 1 effect for Player 1 (Red) at Centre facing Default building facing degrees
            • Animation - Change (Last created unit) flying height to Y at 0.00
            • Unit - Order (Last created unit) to Move To (Centre offset by X towards (10.00 x (Real((Integer A)))) degrees)
I was just messing with the WE until the idea of making a sherical Nova came on my mind. Above are the triggers I used, It has leaks because my aim was to create the spherical nova.

And I'm sure if this was made in JASS it will be much better.

Notice that I didn't make the angle from 0 to 360 because there will be many units any will greatly slow down the game.
 
Level 11
Joined
Apr 6, 2008
Messages
760
dont order it too move, it may cause it too bugg/look wierd.

use a repeting timer with lets say 0.3 sec delay, and move the units towards the desierd angel by like 30 range.

  • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
or if u are using X/Y

  • Custom script: call SetUnitX("Unit",udg_x)
  • Custom script: call SetUnitY("Unit",udg_y)

  • Set X = (R x (Cos((10.00 x (Real((Integer B)))))))
  • Set Y = (R x (Sin((10.00 x (Real((Integer B)))))))
Sin((10.00 x (Real((Integer B)) this is not radians.
but i don't think u wanna calc it like this :>

the correct formula is X+dist*cos and Y+dist*sin

use this instead
  • Custom script: set udg_X = udg_R*Cos((10*bj_forLoopBIndex)1*0.0174)
  • Custom script: set udg_Y = udg_R*Sin((10*bj_forLoopBIndex)*0.0174)

sorry for the messy response, im in a hurry
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
dont order it too move, it may cause it too bugg/look wierd.

use a repeting timer with lets say 0.3 sec delay, and move the units towards the desierd angel by like 30 range.

How could I use timer and not a loop as the index in the loop determins the angle at which the unit will move and also adding waits in loops causes undesired results?
 
Level 17
Joined
Jun 17, 2007
Messages
1,433
Of course, here I'll make a simple one in JASS for you:

JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    local real r = .349
    local unit u = GetTriggerUnit()
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local player p = GetOwningPlayer(u)
    local unit u2
    loop
        exitwhen r>6.98
        set u2 = CreateUnit(p,'h000',x,y,r)
        call IssuePointOrder(u2, "move", x + 400. * Cos(r), y + 400. * Sin(r))
        call UnitApplyTimedLife(u2, 'BTLF', .7)
        set r=r+.349
    endloop
    set u2 = null
endfunction
'h000' is the dummy unit used for the effect of the nova. So just use that function as the actions in your spell.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
JASS:
call IssuePointOrder(u2, "move", x + 400. * Cos(r), y + 400. * Sin(r))

Won't this function will move the dummy unit in 2D plan.

x + 400. * Cos(r) represents X coordinate of the point the dummy unit will move to.

and

y + 400. * Sin(r) represents y one.

In order to create a sphere you need a height, isn't it ?
 
Status
Not open for further replies.
Top