Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Unknown Parameter for createRevoluteJoint

Author
Message
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 1st Apr 2012 19:51
I keep getting an unknown parameter for createRevoluteJoint. I can't figure it out. Not sure if it has to do with my array or not.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 1st Apr 2012 22:01 Edited at: 1st Apr 2012 22:01
Quote: "CreateRevoluteJoint ( 11, 6, 42, 25)"


definition of createrevolutejoint:

CreateRevoluteJoint( iJointIndex, iSpriteIndex1, iSpriteIndex2, x, y, colConnected )

OR

integer CreateRevoluteJoint( iSpriteIndex1, iSpriteIndex2, x, y, colConnected )

So, you should do:

CreateRevoluteJoint( 1, 11, rope[6], X, Y, 1 )

If that's what you wanted to attach it to, because I don't see any sprite creation under number 6.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Apr 2012 22:54
The "unknown parameter" error comes up if you use too few parameters as well as if you use too many.

You either need to specify the joint number as the first parameter or let AppGameKit assign a joint number as kamac has said.

Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 2nd Apr 2012 06:18
Thanks guys. I was following this guide

http://www.appgamekit.com/documentation/examples/physics/7_joints2.htm

It fails to mention the joint index.

Kamac, I have SpriteI handling one through five. Just don't ask why I have two arrays to handle this when I could have one it with one.
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 2nd Apr 2012 11:48
Yah, that code at the end of the guide won't compile. And it has more problems than just the missing parameter for creating the joint.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 11th Apr 2012 02:13
Looks like a typo and untested example, if you can report the link and error to the issues board (http://code.google.com/p/agk/issues/list), that would be great, thanks!

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-05-08 20:37:47
Your offset time is: 2024-05-08 20:37:47