Circular Path...

warroom99

New Member
Reaction score
15
i am trying to make a MUI boomerang spell

testar2.jpg


i can't get the right formula in getting the right angle and the right polar offset so that the boomerang would form a perfect circle...

i have to get the right arc and use it as degrees...

i think i should use pi here... i don't know where

i uses periodic time 0.03(i think there is nothing to do with it)

variables
speed[array](real) - the distance of polar offset?
arc[array] - the angle added to the boomerang(every period of time) to make it revolve...
i used the custom values of the dummy boomerang as the integer for the array

* pls see post 3
 

Jackal

You can change this now in User CP... or Die Tryin
Reaction score
38
hmmm...

PHP:
Events
Unit casts an ability

Conditions
Ability being cast equal to boomerang

 Actions
Order Boomerang to Move To ((Position of Boomerang Dummy) offset by 100 towards (Facing of Boomerang Dummy) + 45 degrees

Then continuously change it so it goes in a circle using a mix of that and wait actions

EDIT: Oh yeah, you might want to change the offset and degrees ;)
 

warroom99

New Member
Reaction score
15
the need degrees and offset is my problem..

for example...

the distance between castpoint and targpoint is 600 what should be my offset and degrees to make it a perfect circle?
 

Ninja_sheep

Heavy is credit to team!
Reaction score
64
okay, there are like 2 ways to do this:
1. get the point at the middel between the caster and the target point and put the boomerang at a distance of this point and always change the offset by a little so you get a semi-circle.

2. Use the sentence of phytagoras and the sentence of cathetus... but I gues you don't want to do it that way since it's the same and 100000000 times more complicate :>

edit: no you shouldn't use pi xD
 

Jackal

You can change this now in User CP... or Die Tryin
Reaction score
38
the need degrees and offset is my problem..

for example...

the distance between castpoint and targpoint is 600 what should be my offset and degrees to make it a perfect circle?

I'll just get my compass and protractor and figure this out.
 

warroom99

New Member
Reaction score
15
I'll just get my compass and protractor and figure this out.
LOL!! hehehe

but what if it has 1432.55 range? another problem to figure out?

@Ninja_sheep
1. so i'll get the radius and use it as offset while adding up the degrees? (let's say 10, it will be 36 peroidic time to complete the circle right?)

2. if i am going to use points for every boomerang and there are 100 boomerang ther would be hundred points right? won't it be laggy?
 

Jackal

You can change this now in User CP... or Die Tryin
Reaction score
38
Ok, I've tried to figure out the degrees it should be facing, and its annoying me so I give up for now :banghead:
 

Ninja_sheep

Heavy is credit to team!
Reaction score
64
>1. so i'll get the radius and use it as offset while adding up the degrees? (let's say 10, it will be 36 peroidic time to complete the circle right?)

y, beside you propably want a semi circle ----> only 10 moves if you do 18 degrees per move :)

>2. if i am going to use points for every boomerang and there are 100 boomerang ther would be hundred points right? won't it be laggy?

well, I think it will be laggy if many boomerangs - in both ways. 100 periodic 0.03 timers will propably cause lag. Propably this way is even faster then the first since it uses les actions and more math. But to do it you have to be familiar with the Pythagorean Theorm and the Euclids Prove
 

Frozenwind

System maker
Reaction score
99
I've made a MUI boomerang spell for my TD,
it moves like this:
Code:
OOOOOOOOOOOO
O          O
O  O [COLOR="Red"]O[/COLOR]     O
O O  [COLOR="Red"]O[/COLOR]     O
OO   [COLOR="Red"]O[/COLOR]     O
       OOOO
Hard to draw like this...
The red way is his start direction, and then it circles around you untill it hits you.
Like I said it's for a TD, so my tower doesn't move:)

I done that like this:
  • move your boomerang every 0.05 seconds to his own spot with a small fofset
  • make your boomerang face your unit every 1 second over (x) seconds.
  • reduce x by a small amount so you can be sure it will reach your unit once.
This is a bit of a hungry felhound spell....
You might wanna use it...

And for your thingy:
I'd say move your boomerang instantly to the center of your circle and slowly decrease the offset and increase the angle.
You might use a formula like: 360/angle = offset.
Then you got a offset of 0 when it went 360°.

frozenwind.
 
Reaction score
333
The center of the circle is the average of casters center and the targets center. The radius of the circle is half the distance between caster and target. You can get a circular motion like this:

Code:
Event: Every X Seconds.

Action: Set Temp_Int = Temp_Int + 10
Move <Boomerang> to <Average of casters and targets position> offset by <Half the distance between target and caster> towards <Temp_Int> degrees.
 

warroom99

New Member
Reaction score
15
>1. so i'll get the radius and use it as offset while adding up the degrees? (let's say 10, it will be 36 peroidic time to complete the circle right?)

y, beside you propably want a semi circle ----> only 10 moves if you do 18 degrees per move :)

>2. if i am going to use points for every boomerang and there are 100 boomerang ther would be hundred points right? won't it be laggy?

well, I think it will be laggy if many boomerangs - in both ways. 100 periodic 0.03 timers will propably cause lag. Propably this way is even faster then the first since it uses les actions and more math. But to do it you have to be familiar with the Pythagorean Theorm and the Euclids Prove
>1 i tried doing that and the time of the boomerang to return is always the same(no matter how far is it).

so when the radius is 350 and the other is 900 the one with 900 radius revolves very fast...

it them them 0.60 secs to revolve around the revolvepoint...

how can i make it slower when it has a larger radius?
 

Ninja_sheep

Heavy is credit to team!
Reaction score
64
well, I think the only way is to do a formula based on the radius. I can calculate this for you (propably) but it will take a little time. I'll post it today in the evening or tomorrow.

oh, and i made the formula for the second point (if you are still interested)

okay, first set 2 variables:
the line the boomerang passes first (600 range) + line from the caster position and the position the boomerang would have if not flying in a semi circle.
first variable = S
second variable = D

(((Root(S*D))^2)-D^2) = the distance of the straigt line to the point where the boomerang currently is (you have to define angle before). If you want I can draw it for you, but just if you want.
 

takethat

Active Member
Reaction score
12
turning?

Code:
Turn Left
    Events
        Player - Player 1 (Red) Presses the Left Arrow key
        Player - Player 2 (Blue) Presses the Left Arrow key
        Player - Player 3 (Teal) Presses the Left Arrow key
        Player - Player 4 (Purple) Presses the Left Arrow key
        Player - Player 5 (Yellow) Presses the Left Arrow key
        Player - Player 6 (Orange) Presses the Left Arrow key
        Player - Player 7 (Green) Presses the Left Arrow key
        Player - Player 8 (Pink) Presses the Left Arrow key
        Player - Player 8 (Pink) Presses the Left Arrow key
        Player - Player 9 (Gray) Presses the Left Arrow key
        Player - Player 10 (Light Blue) Presses the Left Arrow key
        Player - Player 11 (Dark Green) Presses the Left Arrow key
        Player - Player 12 (Brown) Presses the Left Arrow key
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by (Player((Player number of (Triggering player)))) matching ((Unit-type of (Picked unit)) == ship)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((((Picked unit) is in SailingShips) == True) or (((Picked unit) is in DivingShips) == True)) or (((Picked unit) is in SlowSailingShips) == True)
                    Then - Actions
                        Set TurnLeft[(Player number of (Triggering player))] = ((Position of (Picked unit)) offset by 10.00 towards ((Facing of (Picked unit)) + 30.00) degrees)
                        Unit - Make (Picked unit) face TurnLeft[(Player number of (Triggering player))] over 0.02 seconds
                        Custom script:   call RemoveLocation( udg_TurnLeft[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] )
                    Else - Actions
                        Do nothing

When a ship leaves the dock, it will auto sails which using sliding trigger.
the sliding have no problem. However it just don't turn when presses the left arrow key
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top