Circle of 13 units

Status
Not open for further replies.

Donnerkoettel

Level 3
Lets make it as short as possible...
I am currently trying to make an Orcish-Roulette.
In the end it should be for 12 players.
Therefore I want to have 13 units standing in a circle. The first one is the "bank"-unit, wich is the zero.

This is not about "how to make a roulette", i can handle the deeper stuff myself. The problem i have is to make a circle of those units.

For an example i tried the Frost-Nova special-effect animation trigger from the map ExtremeCandyWar2004. You can find that map ingame under:

FrothenThrone\Scenario

When you select the Mage, wich is in Team 1 the Troll-Priest, you can choose the Frost-Nova spell as hero ability. This spell creates 13 special-effects, that doesnt show up in a real circle, as i notices by playing.

The trigger for the Spell uses following function to crate its special effects:
-For each integet A from 0-12 (1-13?)
-Create specialeffect at Pont with polar offset

The offset is 500, wich doesnt really matter for me. (Im just guessing at this point) The degrees used for this function are 28 x player[integer A]. (This is easy to understand for me)

The spell didnt create a real circle, it was near to it, but did not work for Blizzard eather.

So i put out my calculator and asked it, what is 360÷13?
So i got 27,69. (Becouse real variables only allow 2 spaces behind the [ , ])

I have rebuild this function using Units instead of special-effects. I was unable to make a real circle. The units are flying, have an collision of -1 and in the trigger, just after they are createt, they'r collision is turned off.

So this seems to be more an mathematic problem. My math is pritty bad, specialy my geometry! ^^

Last edited:

Frotty

Level 23
Your idea about the calculation is correct, maybe try posting your trigger next time so we can see exactly what's going on.
The collision and flying stuff you should just be able to remove.

• Circle
• Events
• Time - Elapsed game time is 2.00 seconds
• Conditions
• Actions
• Set center = (Center of (Playable map area))
• For each (Integer A) from 0 to 12, do (Actions)
• Loop - Actions
• Unit - Create 1 Footman for Player 1 (Red) at (center offset by 512.00 towards ((Real((Integer A))) x (360.00 / 13.00)) degrees) facing Default building facing degrees
Leaks included

Donnerkoettel

Level 3
Sorry i forgot that part. I found out that one unit from player neutral-passiv does not spawn. I replaced this player with neutral-enemy.
Now it works.

I have also changed the degrees in the loop from 27.69 to 360/13 like you.

Why doesn't it work with neutral-passive?

Edit:
Changed
-create unit facing angle with unit facing point. (P_Center)

There was times i have failed the mathe test but my teachers never gave me an:

xD

Last edited:

Illidan(Evil)X

Level 34
Why doesn't it work with neutral-passive?
Because you're using player numbers in your angle formula for the polar offset, so changing the player changes the point at which the unit is created.
To fix it, multiply the angle with integer A directly as in Frotty's example.

Also, you're looping from 0 to 13, but your player array does not contain a player at index 0. Change the loop start position to 1.

Donnerkoettel

Level 3
@Illidan(Evil)X
You are right. The Array from 0 - 13 made the game crash. Now it works perfect.

Status
Not open for further replies.

Replies
2
Views
755
Replies
6
Views
652
Replies
6
Views
607
Replies
5
Views
420
[JASS] Circles.
Replies
10
Views
913