GDevelop-examples icon indicating copy to clipboard operation
GDevelop-examples copied to clipboard

Added parameter inputs from the slider and checkboxes

Open planktonfun opened this issue 1 year ago • 3 comments

Added parameter inputs from the slider and checkboxes

planktonfun avatar Oct 18 '22 04:10 planktonfun

@tristanbob It can be tested here: https://editor.gdevelop.io/?project=https://raw.githubusercontent.com/planktonfun/GDevelop-examples/joint-connector/examples/joint-connector/joint-connector.json

Bouh avatar Oct 23 '22 15:10 Bouh

Thanks Bouh! I was able to start looking at this but sadly I will not have a lot of time available this week.

I am excited by the potential of this extension, it will make ragdolls accessible to everyone!

On Sun, Oct 23, 2022 at 9:47 AM Aurélien Vivet @.***> wrote:

@tristanbob https://github.com/tristanbob It can be tested here:

https://editor.gdevelop.io/?project=https://raw.githubusercontent.com/GDevelopApp/GDevelop-examples/8a9b1672eefaaacd7ccb8071a877bd8698c15b76/examples/joint-connector/game.json

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/pull/396#issuecomment-1288141391, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDX5Q3UDTZXHNHUWBAPYLDWEVMYDANCNFSM6AAAAAARHVXBEU . You are receiving this because you were mentioned.Message ID: @.***>

-- Tristan Rhodes

tristanbob avatar Oct 23 '22 20:10 tristanbob

@planktonfun wow, this was even closer to fully functional than I first thought! Here is the playable game. Everything except breakable joints is working!

https://liluo.io/victrisgames/extension-joint-connector

Next steps:

  • In the javascript function, can you create object links between each physics object and the joint connector that was used to position the joint? I think this is necessary for the breakable joint action to work. Let me know if you have other ideas as well.

  • I also want to offer a "Weld" joint that can be used to connect two objects. Do you think this should be done as a parameter to the existing javascript function? Joint type: Revolute, Weld

tristanbob avatar Nov 21 '22 23:11 tristanbob

I added Weld Joints... I'm really excited about this extension!!! https://twitter.com/VictrisGames/status/1604125638440284160

I think I will keep working on this:

  • Create a Weld Joint behavior so the variables can be adjusted during the game
  • Implement Distance joints (useful for wheels)

tristanbob avatar Dec 17 '22 14:12 tristanbob

So much progress today!

  • Weld joints
  • Distance joints
  • Breakable joints

https://twitter.com/VictrisGames/status/1604273466743537665

@D8H I'm done for today. If you want to use the "generate functions button" you are working on, we still need to create get/set functions for the "Weld" and "Distance" joint behaviors. If you are busy, then I can work on this tomorrow (about 16 hours from now).

tristanbob avatar Dec 18 '22 00:12 tristanbob

Added fix to enable/disable breakable joints per individual group

https://user-images.githubusercontent.com/1837825/208309059-ccadeda7-6684-42dc-ad46-ba85b15c5673.mp4

planktonfun avatar Dec 18 '22 16:12 planktonfun

Added fix to enable/disable breakable joints per individual group

I'm not certain what this does. Was this a fix or a new feature? Can you explain it some more?

Thanks!

tristanbob avatar Dec 19 '22 04:12 tristanbob

I'm not certain what this does. Was this a fix or a new feature? Can you explain it some more?

Thanks!

Test the last build, it cannot make two instances breakable and unbreakable at the same time. The new and old joints are modified globally.

more specifically:

everytime a layout is created the "CreateRevoluteJoints" function also includes the old joints that's already been modified.

image

planktonfun avatar Dec 19 '22 23:12 planktonfun

I fixed the reference angle so it is now dynamic, based on the starting angles of the objects.

@planktonfun I'm not sure your last commit is doing what you think it is. I'm debating on keeping it, removing it, or trying to fix it.

tristanbob avatar Jan 31 '23 05:01 tristanbob

How do you explain this, Its like grouping each ragdoll individually, if one ragdoll reach high velocity that ragdoll will break, the other ragdoll is unaffected. you can remove it if everything works as expected

planktonfun avatar Jan 31 '23 07:01 planktonfun

@D8H this is ready for review, but some of the checks seem to have internal errors (perhaps from using the new version of GDevelop, v5.1.157). Can you see what is causing these errors?

tristanbob avatar Feb 05 '23 03:02 tristanbob

What is the difference between the variable "JointID" and "JointId"?

The BreakJointIfNeeded is a bit strange. Users will expect BreakingEnabled it to work without having to call an action or if they call an action to break the joint why would they need to set the property.

findIndex can make the code that searches for 2 objects easier to follow: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex

D8H avatar Feb 08 '23 23:02 D8H

What is the difference between the variable "JointID" and "JointId"?

@planktonfun can you answer this?

The BreakJointIfNeeded is a bit strange. Users will expect BreakingEnabled it to work without having to call an action or if they call an action to break the joint why would they need to set the property.

I agree, but there is no way to perform an action on multiple objects inside a lifecycle event (let me know if I am wrong about this).

One minor improvement might be to remove the "BreakingEnabled" property and then users can simply use the "Break joint if exceeds limits" action instead. What do you think about this idea?

findIndex can make the code that searches for 2 objects easier to follow: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex

I understand what this function does, but not how it could be used to simplify this extension. Can you provide more info?

tristanbob avatar Feb 22 '23 03:02 tristanbob

I removed the "Enable/Disable" breaking of joints.

I also commented out the lines of code that had the "JointId*" variables. I wasn't able to figure out what they did, and after disabling those lines, the game example still functions the same. I can delete these lines if we agree they are not needed.

tristanbob avatar Feb 27 '23 04:02 tristanbob

Closing, replaced by https://github.com/GDevelopApp/GDevelop-examples/pull/514.

tristanbob avatar Apr 18 '23 04:04 tristanbob