• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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