Crate Gravity Problems

For questions about using Classic.

Post » Sun Feb 13, 2011 9:05 pm

I have a problem where crates won't fall if one is stacked on another. They have a custom movement behavior telling them to move down if they're not overlapping a solid, but if you destroy one below two others the other two will stay floating in the air.
[url=https://docs.google.com/uc?id=0B9d5pqOItfvfODI2OTlmNTEtNmFiOS00NWUxLWIxODktYzRiNTIwOTRlMWNi&export=download&hl=en:mjktnkye]Download[/url:mjktnkye]
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Sun Feb 13, 2011 10:59 pm

Have it so it only checks to see if it's overlapping a solid below it, or else it will overlap things above it and just 'float' there.
B
3
S
1
G
4
Posts: 37
Reputation: 1,299

Post » Mon Feb 14, 2011 12:47 am

How do I do that?
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Mon Feb 14, 2011 3:55 am

I have Just had a look at your cap, and would recommend that you use the 'Physics' behavior instead of 'Custom' for moving your crates. This will save you having to write extra collision detecting events, and will make your game look more realistic.

[u:pku8x3rj]Step by step for crates[/u:pku8x3rj]
1, Remove the 'Custom movement for the crates and replace it with the 'physics' behavior.
2, In the crates settings, tick the use 'Gravity' box.
3, in the crates settings, set 'Collisions' to 'Bounding box'.
4, In the spite editor, move the crates collision point to the center of the box (12x12)

[u:pku8x3rj]Step by step for the floor[/u:pku8x3rj]
1, Assign the 'Physics' behavior to the floor(to stop the crates falling through it)
2, DONT tIck the use 'Gravity' box for the floor, for obvious reasons.
3, In the floors properties settings, tick the box that says, 'Immovable'
4, in the floors properties settings, tick the box that says "solid"
5, In the Event editor, remove any leftover event lines concerning the crates custom movement.

if i have left anything out, or it doesn't work, you can download an amended cap here-

[url:pku8x3rj]http://dl.dropbox.com/u/15858089/Partial%20ex%28gravity%29.cap[/url:pku8x3rj]

Good luck
B
20
S
6
G
7
Posts: 1,214
Reputation: 7,341

Post » Tue Feb 15, 2011 2:28 am

I was thinking of using the physics behavior, but then it's a pain to make every object it interacts with a physics object aswell.
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Tue Feb 15, 2011 2:47 am

[quote="AfterShock":244podx0]I was thinking of using the physics behavior, but then it's a pain to make every object it interacts with a physics object aswell.[/quote:244podx0]


You don't have to make everything else a 'Physics' object. You can create a 1 sprite that using the 'Physic's' behavior, create an event that makes it invisible when the game runs and place multiple copies of it in your level where you need it (resizing the sprite as you go, not in the picture editor)

Anyway post a cap when you have finished the game....I think i have got a copy of the original Halflife mod on my other P.C.
B
20
S
6
G
7
Posts: 1,214
Reputation: 7,341

Post » Tue Feb 15, 2011 6:25 am

I finally gave up and decided to use the physics behavior, and I'll make a thread for the project when it's in a playable state.
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Post » Wed Feb 16, 2011 1:20 am

If you only want your crates to simply fall down when they're not on ground, the physics behavior might be a little overkill.

Here is how I made your events work with some minor adjustments and most important of all an For each loop:

[url:q3rdlh1i]http://dl.dropbox.com/u/2306601/crategrav.cap[/url:q3rdlh1i]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Feb 16, 2011 9:23 pm

Platform behavior should work.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Thu Feb 17, 2011 5:11 am

[quote="PixelRebirth":2a5m1vhc]If you only want your crates to simply fall down when they're not on ground, the physics behavior might be a little overkill.

Here is how I made your events work with some minor adjustments and most important of all an For each loop:

[url:2a5m1vhc]http://dl.dropbox.com/u/2306601/crategrav.cap[/url:2a5m1vhc][/quote:2a5m1vhc]
I don't really get how the "For Each" event works but this is definately what I was trying to do. I'm still split between using the physics behavior or a custom movement. A custom movement would be less glitchy, but the Physics Behavior looks alot better. fV:
B
7
S
2
G
3
Posts: 139
Reputation: 2,331

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests