Joints Extension [IDEA]

P01

  • Posts: 155
I relied on these for creating joints during runtime in 2.2 but I can't get them to work in 3.0

I am using a code block in a behavior attached to an actor like this:
Code: [Select]
createCustomStickJoint(actor.getBody(), 0, 0, _OtherActor.getBody(), 0, 0);

but it always gives me a compile error of "null (##) - Unknown identifier". Anyone know how to get it working?

« Last Edit: March 24, 2014, 11:12:25 am by Jon »

Almakos

  • Posts: 632
I would also love to see this solved.
In fact I have some doubts about joints work in 3.0. I have tried to create some joints in scene designer and they didn't work. Not sure if that was my mistake or a bug.
Fishing Fantasy Trailer


Jon

  • *
  • Posts: 17529
Joints work fine - the API might have changed a little in the transition to Haxe. I haven't had anybody step up to research and generate API docs - maybe if you're motivated enough, you could do this for me?

You have to use the haxedoc binary under plaf to do it, but past that I haven't had a chance to research the exact command to use. All the sources exist under plaf/haxe/lib/, as you probably already know.

Almakos

  • Posts: 632
I am totally not capable of researching API docs =)
spent whole evening just to draw one single curve I wanted (using API), it happened to be trickier than I thought at first.

p.s. nopies, have no idea where plaf is...
p.p.s that's what happens when most of your user-base are noobs at programming )
Fishing Fantasy Trailer


Jon

  • *
  • Posts: 17529
I'm glancing at the code and it looks like they exist in the Engine class but not in the Script (the "API") class yet.

Jon

  • *
  • Posts: 17529
Given that this was code-only to begin with and the transition to Haxe, I wonder if it makes sense to remake this as an extension (with blocks), at least until it gets built in in the future?

saulochina

  • Posts: 214
please make a extension :) hehe

and start the stencylpedia project where we'll learn how to code and use with the engine  ;D i remember to read something about when the new stencylpedia was released  :D
Finding the fun!
Squib Wars. Now complete, and avaible for free on App Store! http://bit.ly/LxJ62L
https://www.facebook.com/twoheadedgames
Twitter: @saulochina
MSN: sauloj.china@hotmail.com

Jon

  • *
  • Posts: 17529
I can't, but someone else probably can - it's all already there, just waiting to be dug up.

zawrot13

  • Posts: 783
I also really need custom joints for 3.0.  I stuck with big project because on 2.2 i used revolute joints and I cannot continue the same in 3.0 . This is  very important feature for many developers.

Any takers or should I take this up ?
Zen - Newgrounds - goo.gl/fd4mU

Shoot me a PM or something..

zawrot13

  • Posts: 783
Rev joints works fine in 3.0

h1rnz1lla

  • *
  • Posts: 649
Oh, I forgot to mention the imports. Put this in a custom import event:
Code: [Select]
import box2D.common.math.B2Vec2;
import box2D.dynamics.joints.B2Joint;
import box2D.dynamics.joints.B2RevoluteJoint;
import box2D.dynamics.joints.B2RevoluteJointDef;

use this import code and the scene browser joints work, to delete them you need to delete the actor.