How can I make this chariot work properly ?

Get help using Construct 2

Post » Sat Feb 25, 2017 9:52 pm

Hi. I reproduced here an example of what doesn't work in my original project:
1) I have some chariots that are composed of multiple parts, and I want all the parts that have the same number in the instance variable called "nr" to be pinned properly.
2) When the player is pushing the chariot and then stops, but he is still overlapping with the chariot, the wheels are rotating.

How should I solve this ?
https://www.dropbox.com/s/6axmysn7xfn47 ... .capx?dl=0
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Sat Feb 25, 2017 11:28 pm

Is the animation you are pinning a loop?
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Sat Feb 25, 2017 11:54 pm

I don't understand the question.
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Sun Feb 26, 2017 12:10 am

Can't tell a solution of the current algorithm, but you may try this as alternative, works pretty smooth:
Image
Image
B
8
S
1
G
2
Posts: 19
Reputation: 938

Post » Sun Feb 26, 2017 12:16 am

I can't open your CAPX because it has an add-on.

You are using overlapping so check your collision boxes. If I understand your problem you want the wheels to stop turning when the box is no longer overlapping the center of the wheel and that looks like a collision box problem.

Make that collision box on the wheel very small and it should work. You can also adjust the collision box on the box you move to be smaller to end the overlap sooner.

EDIT: Sorry I am looking at Myrmex gif and thought it was your example but still check your collision boxes when using overlap as a trigger.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Sun Feb 26, 2017 9:55 am

I have not explained correctly, apologize for this :)
@Myrmex Thanks. I followed your example but not to achieve that. I wanted the chariot to be one piece, and I've manage to do so.

Image
https://www.dropbox.com/s/ypdyc9ji5fikpw6/chariot.jpg?dl=0

@lamar I added a version without the litetween plugin, it should work now.

Now remains the issue where the player is pushing the chariot and when he stops the wheels keep rotating.
Please have a look:
https://www.dropbox.com/s/vxzs68wcllgsl ... .capx?dl=0
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Sun Feb 26, 2017 10:46 am

I think "else" condition refers just to the last event's conditions of the same level - so if PlayerOverlapper weren't overlapping ChariotBoxMovable and Player weren't on the floor it would work.

You can stop wheels from rotating e.g. this way:

https://www.dropbox.com/s/ifp6ev2wwmons ... dition.png
B
8
S
3
G
1
Posts: 15
Reputation: 705

Post » Sun Feb 26, 2017 11:10 am

@bambo Hello. I tried it and ot almost worked :) . The issue now is if the player pushes the chariot and then jumps over it and goes on, but keeping the A or D pressed, wile doing this, the wheels are rotating. :|
I've tried different things but is the same .

https://www.dropbox.com/s/pigex15bqhev4 ... 3.gif?dl=0
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Post » Sun Feb 26, 2017 12:03 pm

You can add another event like this:
http://www.dropbox.com/s/a5wh3aexmd36pm ... ition2.png

It should solve this problem :) Frankly speaking I think you should contemplate the way you organize your events - e.g. it's unnecessary to set rotate speed of wheels every tick (what happens in your case when player is pushing boxes). As a result the events I've added to make it working are also not that correct - it would be much better if you design this event system which would allow you to set rotate speed to 0 only once - when A key is released. You will achieve what you want in your way but it's just my little tip for future projects ;)
B
8
S
3
G
1
Posts: 15
Reputation: 705

Post » Sun Feb 26, 2017 6:06 pm

@bambo You solved the issue where player jumps, the wheels are not rotating anymore. But if the chariot hits a wall while the player is pushing it, the wheel are rotating until the key A/D/W is released. I tried with "Platform has wall to right/left" but it doesn't work. You are probably right, I should think to another way of doing this. Thanks again.
B
39
S
10
G
9
Posts: 213
Reputation: 7,032

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests