[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Mon Oct 12, 2015 7:34 am

@R0J0hound , thanks for the explanation. I was looking through your code trying to understand how things connect.
Have you thought about making a tutorial on how to port an existing library to a construct2 plugin/behavior? I'd be really interested, even if it is something simple- just to show how to integrate someone else's code with construct's.
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Mon Oct 12, 2015 7:38 pm

@Prominent
I started a topic here about a way to use a third party library without writing a plugin:
viewtopic.php?f=147&t=162405

There are pros and cons of doing it that way. A pro is you can access everything a library has to offer instead of going through a wrapper that may not allow everything. A con is you're limited to what you can access from events.

Actually making a plugin is similar, but you have to design the ACE's in a way that's usable for C2.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Mon Oct 12, 2015 9:33 pm

Ah cool, I never thought of doing something like that. Wasn't what I had in mind, but I'll have to try this method out sometime.
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Sat Oct 17, 2015 2:40 pm

Are there any examples of switching between chipmunk physics and standard platform behavior (for player character) as needed? Is this feasible or is it just best to forget it and stick with either no physics at all or try to build everything with physics objects and have them enabled all the time?
B
35
S
10
G
4
Posts: 149
Reputation: 4,559

Post » Sat Oct 17, 2015 5:01 pm

@waltuo
I'd recommend just using physics, but you could try it. Whenever you switch between the two be sure to set the velocities from the other behavior.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Sat Oct 17, 2015 5:04 pm

@Waltuo , I would just use chipmunk to create the platform movement. It's not that difficult to setup if you understand how chipmunk works. If you can get it working with chipmunk, you'll be more knowledgeable on how to use it for other things, etc.
here's a gif of something I'm working on that shows a basic platform movement using only chipmunk: http://i.imgur.com/vtWs7Ch.gif
An important step is to disable friction on the player while moving it, and then reset the friction when move input is released (and also when player is on the ground; you need a way to check if it is or not).
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Sun Oct 18, 2015 2:52 am

@R0J0hound , I'm trying to create an elevator. I'm trying to make the elevator not receive any forces from other objects when they touch, so that the force I apply on the elevator is the only force influencing the movement. Any ideas on how to accomplish this?
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Sun Oct 18, 2015 3:32 am

@prominent
You could try giving the elevator a mass of infinity and just set it's velocity.
Alternatively you could use joints to emulate how an actual elevator is built. Maybe a groove joint with distance joint that you adjust the length of.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Sun Oct 18, 2015 3:50 am

@R0J0hound , I tried setting the mass to Infinity, but it causes errors related to collision stuff. I'm not sure why.
I also thought about using joints, but I'm not sure if it would work the way I want it to.. I was going to see if I could add some action to discard the effects of a collision on a chosen object, but wasn't sure where to start. Is that something even possible?
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Sun Oct 18, 2015 4:09 am

@prominent
Hmm, I think I had to work around that infinity mass issue elsewhere. So scratch that for now.
Maybe we could do something in post collide. You can get the impulse of the collision with an expression, so maybe you could apply an opposite impulse to negate the force.
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests