Collision Mask

For questions about using Classic.

Post » Mon Nov 23, 2009 9:31 pm

Could someone explain to me how the collision masks work? Can they be used for animated player sprites? I've watched David's YouTube video showing them being used for a platform, but I'm not sure how to implement them for an animated sprite.

Also, it seems that whenever I update the collision mask it reverts to the bounding box size after importing it. I don't know what I'm doing wrong :(

Also, is the "Copy collision mask to each frame" feature supposed to copy the collision mask to all the frames for all the animations in the sprite, or just the currently selected animation? The dialogue says "in the animation package," but I'm not entirely sure what that means.

And if anyone has a sample .cap with the collision mask feature being used on a player sprite I'd be much obliged :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Nov 24, 2009 12:13 am

I think someone else was having problems with animated sprites and the collision mask. I think the conclusion was to not do it for animated objects.
I could be wrong though.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Tue Nov 24, 2009 12:24 am

I think it copies one collision mask for a whole animation.

=/
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Nov 25, 2009 2:09 am

Hrm... anyone have a more authoritative answer on the subject?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Nov 25, 2009 8:08 am

For each frame of the animation there is a mask frame.
Show just do what David did in his video for each frame and it will work.
doing this is really good for oddly shape frames that changes height or width in an animation.

And yes, "Copy collision mask to each frame" will add the collision mask to
all the frames in that animation set "not all the animations". so pick the mask frame you want for this. this is good for animation where the frames shape don't change from frame to frame and is centered.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Wed Nov 25, 2009 10:01 am

Grumph. Sounds like a pain in the butt. I'll just stick with using dummy objects for player sprite collision...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Nov 25, 2009 7:59 pm

[quote="deadeye":3oa6xlfe]Grumph. Sounds like a pain in the butt. I'll just stick with using dummy objects for player sprite collision...[/quote:3oa6xlfe]

It is actually a is not a pain.
It will save more time them doing dummy objects.
With that being said it would be nice to be able to open the mask in the picture editor and change the mask that way.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Thu Nov 26, 2009 1:55 am

[quote="toralord":25i7m8dc]It is actually a is not a pain.
It will save more time them doing dummy objects.[/quote:25i7m8dc]

Okay then... I must once again be misunderstanding. What it sounds like you're saying is that:

1: I must "Copy the collision mask" for each animation of the sprite, rather than just once for the entire sprite and

2: It won't work properly unless all of the hotspots are centered and all of the frames are the same width

... but yet you say it would be easier and save more time. When I make a dummy object, I just draw a box and make one event that says "Always -> Set sprite position and angle to box" and it's done. I don't see how repeatedly setting the mask for each animation will save more time, and if it won't work with varying width of frames anyway then what's the point?

Ugh. I am as confused as ever. Does it work, or not? Can someone make an example .cap?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Nov 26, 2009 2:37 am

I've set up a sprite with a few animations and put Platform behavior on it already. The animation tags are set, and it's ready to go. All it needs is the collision mask so the sprite doesn't freak out:

http://www.box.net/shared/ol5ujkjmyp

Here's what I'm doing, step by step:

1. I select the Mega Man sprite.
2. I click the "Angle 0 (Right)" angle in the "blueStand" animation in the Animator tab.
3. I right-click the frame in the lower portion of the Animator, and select "Launch explorer."
4. I use Photoshop to open the mask png that appears in the folder. I draw a box, I save the file.
5. I click OK on the dialogue to import the images to Construct.
6. I click YES to import the mask.
7. I right-click the frame in the lower portion of the Animator and select "Copy collision mask to each frame."

When I run the game, it's like nothing has changed at all. When I check the masks for the sprite frames, there's nothing there, even for the first standing frame I changed. It's like I'm not accomplishing anything at all.

So am I doing it wrong, or is it broke? And if someone can show me how to fix it, I'd be much obliged :)



[size=50:35799ce8]please for the love of god[/size:35799ce8]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Dec 09, 2009 5:44 pm

Bumping this because i am also having difficulties with the new collision mask thing.

For me, when i try right clicking and then selecting "launch explorer", a window pops up that just has a text file labelled "stub". No image files at all. And i just downloaded the latest version of Construct yesterday.
B
2
G
3
Posts: 52
Reputation: 954

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests