[PLUGIN]Orbiter Behavior

Completed plugins, behaviors and effects.

Post » Thu Jun 18, 2009 1:26 am

[size=150:3vqdssms]Orbiter Behavior[/size:3vqdssms]:

Version: 1.0
Creator: Chris Hackmann(AKA, linkman2004)
License: Freeware

[size=150:3vqdssms]Download now![/size:3vqdssms] - 98KB

NOTE: I suggest reading the below description/documentation before use. There are is also an example at the bottom.

What does this plugin do? - This is a behavior which can be added to object to make them orbit another object. This usually takes a small bit of complex math, but the Orbiter behavior takes all the math out and provides speed improvements over doing it with events.

What features does it have? - You can change many orbit options, including speed, maximum X distance, maximum Y distance, the angle of the orbit, and the step of the orbit. You can also retrieve all of these values at runtime, including the current distance between the orbiter and the orbited. See below for a complete list of parameters, actions, and expressions.

Parameters:

- Speed: Set the starting speed of the orbit in pixels-per-second.

- X-Distance: Set the starting, maximum X distance of the orbit.

- Y-Distance: Set the starting, maximum Y distance of the orbit.

- Angle: Set the starting angle of the orbit.

- Start step: Set the starting step in the orbit from 0-360. If the starting step is set to 90, the object will start out one quarter of the way through it's initial orbit.

Actions:

- Set Object to Orbit: Set the object that the orbiter will orbit. This only has to be set once.

- Set Orbit Distance: Set the maximum X and Y orbit distances at the same time using ONE value, setting both settings to the same amount.

Expressions:

- Get Orbit Distance: Get the current distance from the orbiter to the orbited. If the maximum X and Y orbit distances are the same, this value will be constant.

Shared Actions/Expressions:

- Set/Get Orbit Speed: Set/get the current speed of the orbit.

- Set/Get Max X-Distance: Set/get the maximum X distance of the orbit.

- Set/Get Max y-Distance: Set/get the maximum Y distance of the orbit.

- Set/Get Orbit Angle: Set/get the angle of the orbit.

- Set/Get Orbit Step: Set/get the current step of the orbit.

Installation: To install the plugin, simply extract the the contents of the ZIP file into the main Construct folder.

Example(s):

Orbiter Behavior - Example File

So there you have it. I've actually been sitting on this plugin for a few days waiting for the finished plugins board to go up. :P As usual, be sure to leave your comments and ideas here. :)
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Thu Jun 18, 2009 10:26 am

Amazing! This will be very useful!
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Thu Jun 18, 2009 11:16 am

Not a bad plugin :D
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jun 18, 2009 11:45 am

[quote="linkman2004":uejy72q5]provides speed improvements over doing it with events.[/quote:uejy72q5]
Oh comon this is negligible. :mrgreen:

Nice plugin anyways, twill help the less mathy people.


:shock:
ACTAULLY ITS BAD FOR SOCIETY, NOW THEY WILL NEVER LEARN WHAT SIN AND COS PROPERLY DO ARGHHHHHHHHHHH DESTROY IT DESTROY IT :twisted:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Jun 18, 2009 12:14 pm

If you use optimized asm routines for sincos the speed dif over events would be fairly big.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Jun 18, 2009 2:01 pm

Hm, how can I set the "Orbit to Object" object to another instance of the same sprite?

I want:

sprite with uid = 0

to orbit around

sprite with uid = 1
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Thu Jun 18, 2009 2:38 pm

Thanks for the comments, guys. :) By the way, I'm just wondering, would anybody rather see the speed in degrees-per-second?

[quote="Davioware":1tb4uyca]Oh comon this is negligible. :mrgreen:[/quote:1tb4uyca]

For normal applications, yes, but it actually takes 50% more objects with the behavior to slow the game down to VSync rate. That's 4000 objects with events and 6000 objects with the behavior.

[quote="SuperV":1tb4uyca]Hm, how can I set the "Orbit to Object" object to another instance of the same sprite?

I want:

sprite with uid = 0

to orbit around

sprite with uid = 1[/quote:1tb4uyca]

You're on the right track, but it would best to use a private variable so each object can hold a sequential ID. Here's an example.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Thu Jun 18, 2009 8:29 pm

[quote="linkman2004":3crj8si7]For normal applications, yes, but it actually takes 50% more objects with the behavior to slow the game down to VSync rate. That's 4000 objects with events and 6000 objects with the behavior.
[/quote:3crj8si7]
Hmm, not bad, not bad.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Fri Jun 19, 2009 6:03 pm

Hehe, excellent! I could probably do the maths myself, but this is faster (slightly) and it's much neater to just slap a behavior on something :P

Besides, at the moment it's excellent to get any third-party plugins at all, and finally, and most importantly, it has a nice icon that fits with the others \o/ :P

Anyway, excellent job Sir. Hope to see more plugins from you!
B
2
S
2
G
3
Posts: 193
Reputation: 1,636

Post » Wed Jul 22, 2009 7:06 pm

[quote="linkman2004":1asrs3zc]Thanks for the comments, guys. :) By the way, I'm just wondering, would anybody rather see the speed in degrees-per-second?[/quote:1asrs3zc]
That could be useful, but the current speed setting (in px per second, I assume) is also useful. Can we have both?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Completed addons

Who is online

Users browsing this forum: No registered users and 0 guests