How do I fix the wire physics correctly

Get help using Construct 2

Post » Mon Nov 02, 2015 2:43 pm

I'm using the @R0J0hound example of rope to do something to my game.

Here is the example of what i'm trying to do.
https://dl.dropboxusercontent.com/u/659 ... ueba3.capx

Problems:
The electric point is not ajusted correctly to the final part of the wire.
When i press R to restart the layout the physics are not working ¿? .

Things to improve:
The first part of the wire/rope have to be by default inamovable. Actually i put a "blue-squared" that if is touched set inamovable. Works but will be great know how to do it automatically.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Mon Nov 02, 2015 3:12 pm

Not using the most beautiful method, but working..
I was able to pick the first and the last link created by choosing their group and lowest and highest UID numbers, Using that to spawn the electricity on the right spot and setting the immovable attribute..

Fixed Capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 02, 2015 3:24 pm

Change tickcount=0 to "on start of layout" to fix the Restart issue.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Mon Nov 02, 2015 3:32 pm

blackhornet wrote:Change tickcount=0 to "on start of layout" to fix the Restart issue.


Thanks, forgot about that part of his question..
Changed it in the linked capx..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 02, 2015 5:35 pm

Thanks guys!

But if i create another chain_box not works equal. The same if i import this into the game or erase the actual and create other :S .

I think this is for the UniqueID that appears "7". And only works on that.

How i can create all the chain_boxes i want and this one create the size of the wire depending of the chain_box like now and some instace number that say "electric" , and 1 for put the electricty and 0 to normal. I thought create a rope/wire was more easy :P .

Maybe there is any other rope example more easy to use that can be capable to create all that you want of any size,etc.. ? I looked in the forums but the only that works good was this one by R0J0hound .

Edit: Also how can i erase the wire colisions? i want the swing and move beetween them without collision.

Edit2: Scirra, create a Rope Behaviour please! :P
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Mon Nov 02, 2015 5:42 pm

Indeed in this case I just used the group variable of the links (which is the uid of the chainbox) straight from the editor..
Making it a function and calling the function with chainboxes.uid as parameter, would solve this..
You'd only have to decide which chainboxes to attach electricity to and which to close at both ends..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 02, 2015 5:53 pm

matriax wrote:Edit: Also how can i erase the wire colisions? i want the swing and move beetween them without collision.


You mean disable collisions with a certain object?
There's an action for that in the physics actions of every object..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 02, 2015 5:54 pm

Yes, i deactivate the collisions in the "properties" but when runs the "link" the sprite that creates the wire collides with other from others chain_boxes ¿? Or i'm doing something wrong ¿?
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Mon Nov 02, 2015 6:35 pm

There's a difference between the physics engine and the normal engine..
To disable physics collisions add an action in the event sheet to do so, like I said in my previous post..

If you deactivate collisions in the properties you will not be able to check for overlap with the object and I'm guessing that is not what you want..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 02, 2015 6:38 pm

Ah! i don't know that, now worked! thanks! ;)
B
23
S
10
G
3
Posts: 538
Reputation: 4,426


Return to How do I....?

Who is online

Users browsing this forum: adamebastin, ketramtu18 and 8 guests