• 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] Math formula for simple star

Status
Not open for further replies.
Hi guys, I am trying to make a simple star effect for one of my spells, but I have problems =(

I want something like this


|||
|
...\|/...
|| /|\

I hope some of you can understand. However I can't do that, my maths are not correct. Can some one help me ?

JASS:
local real x 
        local real y
        local integer i
        local integer j
        local real distInc
        local real angle = 0
        
        set i = 0
        loop
            exitwhen(i == 8)
            
            set distInc = 0
            //in this inner loop we create the lights of each SunRay
            set j = 0
            loop
                exitwhen(j == LightNumber(level))
            
                set x = (casterX + distInc) * Cos(angle)
                set y = (casterY + distInc) * Sin(angle)
            
                call DestroyEffect(AddSpecialEffect(LIGHT_EFFECT, x, y))
            
                set distInc = distInc + 100
                set j = j + 1
            endloop
            
            set angle = angle + 45
            set i = i + 1
        endloop

To start, the image should be centered on the caster, and it is not ... than everything messes up basically ... =S
 
Level 2
Joined
Aug 31, 2008
Messages
22
I think i can help you since i got some math skillz but, what does this trigger actually do ?
Do the special effects appear ?
Does it look like a star ?
Can i have a screenshot ?
Did you try with rads ? (i mean values like θ = π/2 [2 π])
 
Status
Not open for further replies.
Top