[PLUGIN]Orbiter Behavior

This forum is currently in read-only mode.
0 favourites
  • Orbiter Behavior

    :

    Version: 1.0

    Creator: Chris Hackmann(AKA, linkman2004)

    License: Freeware

    Download now!

    - 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.

  • Amazing! This will be very useful!

  • Not a bad plugin

  • provides speed improvements over doing it with events.

    Oh comon this is negligible.

    Nice plugin anyways, twill help the less mathy people.

    ACTAULLY ITS BAD FOR SOCIETY, NOW THEY WILL NEVER LEARN WHAT SIN AND COS PROPERLY DO ARGHHHHHHHHHHH DESTROY IT DESTROY IT

  • If you use optimized asm routines for sincos the speed dif over events would be fairly big.

  • 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

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

    Oh comon this is negligible.

    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.

    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

    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.

  • 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.

    Hmm, not bad, not bad.

  • 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

    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/

    Anyway, excellent job Sir. Hope to see more plugins from you!

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

    That could be useful, but the current speed setting (in px per second, I assume) is also useful. Can we have both?

  • I could probably add a tick box to switch between unit type. I'll see if I can get around to it at some point.

  • Thank you! This is a thing of beauty - paired with turret behavior it makes some damn fine orbitals for a SHMUP game.

    And sorry for bumping this up after such a long time, but the author deserves it

  • Sorry to bump, but would it be possible to add a deactivate/ activate action?

  • in which folder do I put the plugin ?

    If i put it in the main folder as it says .... nothing happens and if I put it in the behaviour folder .. there is an error ...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Rafael0125 - Extracting the zip into the main Construct folder(with the Plugins directory) should work fine. You aren't trying to use this on C2, right? This was written for Construct Classic and so won't work with C2.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)