Please help with BALL AND CHAIN capx. :(

Get help using Construct 2

Post » Thu Oct 13, 2016 9:24 am

Hey guys. I've been trying trying to create a proper chain link from scratch since I'm having a hard time getting the PIN function to work the way I want to.

So what I did was put the origin of a single link close to the front and used that for positioning as well as angles.

Right now I have a hard time figuring out how to CONNECT THE TWO CHAINLINKS.
I also want to know how to CREATE MORE CHAINLINKS when both the balls are far enough from each other but I don't know where to begin.

I hope you guys understand my problem. Thank you.

CAPX: http://s000.tinyupload.com/?file_id=050 ... 9750723852
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Fri Oct 14, 2016 9:29 am

24 hours, Yo!
Bump! >; )

EDIT: 24 h + 5 Minutes too late... : (((
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Thu Oct 26, 2017 8:49 pm

This is something I still haven't figured out after a year.
@R0J0hound do you mind taking a look at my Capx?
I have a problem getting the links of the chain to link at the opposite end.
I've tried revolute joints but this isn't really a capx that needs physics.

Capx: https://www.dropbox.com/s/4zaon4bgge5s1 ... .capx?dl=0
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Sat Oct 28, 2017 7:01 am

Hey @MPPlantOfficial
At first I though "how hard can it be? Just pin links to each other!"
Turned out - quite hard :)

Here is what I came up with:
https://www.dropbox.com/s/4ach2ss7ujtbx ... .capx?dl=0
The code is quite dirty and can be optimized, but I hope you find it helpful.

Sorry, I didn't modify your capx, it's too complex.
Check out my awesome game Doptrix
B
17
S
9
G
50
Posts: 828
Reputation: 27,965

Post » Sat Oct 28, 2017 6:19 pm

dop2000 wrote:Here is what I came up with:
https://www.dropbox.com/s/4ach2ss7ujtbx ... .capx?dl=0
The code is quite dirty and can be optimized, but I hope you find it helpful.

Gold! Sorry didn't reply earlier. I haven't gotten the chance to check back immediately.
Thanks again! :D
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Sat Oct 28, 2017 6:27 pm

dop2000 wrote:Sorry, I didn't modify your capx, it's too complex.

Oh I forgot to specify.

I actually wanted one end to be grounded while the other one moves. That was the challenging part.
I imagine it'll take something like 2 loops constantly following the moving chain while the "grounded" end "tugs back" at the same rate when max distance is exceeded.

Speaking of which, I could start there:

RedBox/Greenbox is dragging
Distance Bar greater than or equal to [cumulative lengths of all chain links] | [some code to keep opposite box grounded.]

This was my initial struggle
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Sat Oct 28, 2017 6:59 pm

Basically think of Chain Chomps from Mario / Zelda WITHOUT the gravity.

As you can see, each link follows the head but stays grounded on the opposite end.
If this is a nightmare to program now, how much more back then? XD

https://www.youtube.com/watch?v=pi4X5JtQfqU&t=7m57s
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Sat Oct 28, 2017 8:26 pm

Here's my approach. It's more like a rope than a chain. I wasn't able to get that nice loose link feel of dop2000's.
https://www.dropbox.com/s/95ht71np5jrti ... .capx?dl=1

Fixed end version. Basically pulls one way, minus the last, then pulls the other way.
https://www.dropbox.com/s/ecjsc9mmn509i ... .capx?dl=1
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273

Post » Sun Oct 29, 2017 2:54 am

@R0J0hound
Wow, this is so cool and works so much better than my petty attempt! :)
Check out my awesome game Doptrix
B
17
S
9
G
50
Posts: 828
Reputation: 27,965

Post » Sun Oct 29, 2017 3:40 am

Thanks dop2000
I rather like how yours bunches up like a real chain, and letting two chains connect is a nice touch. I'll have to look at how you did that for ideas.
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 48 guests