The Daily Click ::. Forums ::. Klik Coding Help ::. Platform Swing Object - Reducing Acceleration to 0
 

Post Reply  Post Oekaki 
 

Posted By Message

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1331

VIP MemberStarSnow
13th August, 2011 at 21:36:06 -

I'm just full of dumb questions lately.
I have a title screen where I'm trying to swing an active object on a chain, then reduce its acceleration to 0; basically making it stop after a set amount of time by reducing acceleration by an increment every 1 seconds until the object comes to a full rest on it's own.

I've tried the glaringly obvious,
Every 1 seconds; so long as acceleration <> 0 set acceleration to acceleration(platform swing object) -1
When I test it out, instead of slowly coming to a rest, the damn platform swing object goes into hyperdrive and starts swinging the active object (platform) around like a badger high on crack and speed.

NO LIKE!
I've checked the examples that came with the object, and it seems acceleration doesn't rest at 0. In fact, small increments of 0.01 and the like have massive adverse effects on the object, and the only example I've been able to find that has anything to do with acceleration is an acceleration increase when a player object interacts with the platform swing object. This is a title screen. There's no player object involved, and the event scripting looks like trig. I barely passed algebra 2.

I've also tried bringing the object to a halt by increasing mass and gravity, which just reduces the swing angle and makes the active move a lot faster, but it never actually comes to a stop.

The only thing I can assume is that acceleration means just that. It's not a modifier that determines swing speed, but rather a modifier that adds or removes swing speed by multiplying by current swing speed; since setting acceleration to 0 doesn't bring the swing to a full stop.

Now, there's an event for testing chain swing speed, but no event for setting chain swing speed. Awesome. Since I can't make any sort of sense of the event scripting in the example when the player object climbs the platform swing object and swing speed is determined by user input, I guess I'm sort of stuck.

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

Golem



Registered
  08/08/2011
Points
  264
14th August, 2011 at 08:25:52 -

I have no experience with the Platform Swing Object, but it sounds like all you need to do is set acceleration to a negative value and hopefully just leave it at that. If it starts swinging again, add an event that sets acceleration to 0 if speed is 0. Hope this works.

 
/**
* A simple signature.
*
* @author Golem
*/
   

Post Reply



 



Advertisement

Worth A Click