Collision Problems with Run-time Loaded Animations

For questions about using Classic.

Post » Fri Sep 05, 2008 6:03 pm

So, I'm working on my game, and I have it set up to where it will load the tile-sets for maps externally. The problem arises when the images are loaded during run-time using the sprite's "Load animation from file" action. Whenever they are loaded like this, the collision mask remain unchanged, even when they are set to per-pixel. This poses problems when the loaded tile is a ramp, but the collision mask remains a square. :? Is this by design, or is this a bug that needs to be fixed? Thanks.
Moderator
B
99
S
38
G
19
Posts: 1,584
Reputation: 17,942

Post » Mon Sep 15, 2008 2:02 pm

[quote="linkman2004":3twy90a2]So, I'm working on my game, and I have it set up to where it will load the tile-sets for maps externally. The problem arises when the images are loaded during run-time using the sprite's "Load animation from file" action. Whenever they are loaded like this, the collision mask remain unchanged, even when they are set to per-pixel. This poses problems when the loaded tile is a ramp, but the collision mask remains a square. :? Is this by design, or is this a bug that needs to be fixed? Thanks.[/quote:3twy90a2]

I do believe you can change the collision mode during runtime as well... have you tried that, or did you try to change the item properties in the design view?
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Sep 15, 2008 2:37 pm

Loading collision masks from files is not yet implemented. I'll try have done something about it by 1.0.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Mon Sep 15, 2008 11:59 pm

A workaround could possibly be to use invisible "detector" objects which are spawned relative to the number of "ramp" objects. The detector object would not need to be loaded from a file, it would be built into the runtime, therefore the collision mask would stay as "per-pixel". You could then tie the detector to the object being loaded from file using some simple events (detector.xy = object.xy).

This was a trick I used to apply (when I used MMF2) to objects that I wanted to collide with other things using different effects etc. for whatever reason.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Tue Sep 16, 2008 5:38 pm

I actually found a work-around to this shortly after posting. I just have the objects pasted onto a canvas and have the collision mask update. Unfortunately, that method only works on mid-high range machines. It doesn't work on either of the crappy computers in my house, just my good one. :? I'm gonna have to post it later to see if anybody else with an older computer has problems with it.

Also, hope to see something about loading collision masks soon, then. :)
Moderator
B
99
S
38
G
19
Posts: 1,584
Reputation: 17,942


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests