My 'Help Me' Thread

For questions about using Classic.

Post » Thu Jan 29, 2009 8:23 pm

Hey guys,

Thought it'd make the most sense to create a thread where I can directly ask questions whenever I'm too stupid to understand how something works :)

In order to learn Construct, I thought I should target some real-world problems, so I thought it'd be smart trying to re-create the classic Super Mario Bros. And I'm pretty happy with what I've got so far, but there are a couple of things I'd love to figure out. I'll also just upload the .cap (it has the sprites included, if that's against the rules, just tell me and I'll take down the link) so you guys can directly look into the problem:

http://www.thomasmahler.com/files/01.cap

I hope this file works if you guys don't have the actual sprites (does the cap file also pack the resources?)

If not, here's the exe file:

http://www.thomasmahler.com/files/smb.exe

Controls are the defaults, arrow keys to move around, left shift to jump. No Run or whatever yet.

1) Controls: That's my biggest hurdle right now. I think I'm getting to a point where I can recreate the actual controls (man, now that I've analyzed it, they're _way_ more advanced than I thought. Mario builds up momentum while running fast, etc.), but what I don't understand:

Since I want to create a co-op mode that you could play simultaneously, I changed the applications controls. So I've changed the naming to P1 Left, P1 Right, etc. and added P1 Run and P1 Jump.

Now, how do I tell the Platform behavior that Z is jump - and not the left shift?

I also tried to put Luigi in there, but the controls sorta always stick to the defaults - I'm pretty sure I'm missing something 'big' here, I just can't figure it out right now.

2) Maybe I don't understand how to set this up properly, my idea was that I create a solid, tileable 'Blocker' Sprite that I'll just make invisible to block Mario from going to places he shouldn't go. Look at the leftmost area of the level, I created a blocker so that Mario can't leave the level. Now, if I jump to the left, the blocker actually blocks me, but if you keep running, Mario will fall through the blocker. Is that a bug?

EDIT: Has been fixed with the update.

3) There are a couple of animations I'd love to know how to implement: I created a 'If Mario is falling, set animation to 'Jumping'' Expression - but it doesn't seem to work. What does the 'is falling?' attribute stand for? I thought it's the downward movement whenever you were in the air. I want to see the jumping sprite whenever Mario is in the air, just like in the real game.

EDIT: Solved 3) - The expression works, but I had it set as a subEvent of the jumping event, that's why it didn't work.

Also, how do I recreate the 'momentum steps'? Say, you're running and you suddenly do a full stop - in the NES game, mario still takes a couple more steps from the built-up momentum. How do I recreate this?

Also, if you're running and you suddenly switch directions, there should be a new sprite animation where Mario already looks into the changed direction while the momentum still moves him into the previous direction for a couple of milliseconds - is there an attr to set this in the platformer behavior?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Thu Jan 29, 2009 8:30 pm

Also, there seems to be a general problem with the beahvior. The moment I remove the platform behavior, I can't jump into the runtime anymore. Is that me screwing up or is that a bug as well? I do think it should work even without the behavior, right?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Thu Jan 29, 2009 9:21 pm

I'm finding your question odd. I'm assuming you found the Application Properties menu, with the controls at the bottom, since you said you renamed them. Well, at that location, you can set what button to use as well...
B
2
G
3
Posts: 71
Reputation: 992

Post » Thu Jan 29, 2009 9:49 pm

Did you look at the cab file? The thing is, I set jumping to 'Z', yet during runtime, Z isn't being recognized and jumping is still set to the left shift button.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Thu Jan 29, 2009 10:37 pm

Ah, I see now. I think the "Jump" name is hard coded into the Platform Behavior, just like "Move Down" is (for purposes of jumping down through platforms). Just one of those things. Hopefully this will be changed in the future.

You can work around it by making an event to tell your platformer to jump when YOUR jump button is pushed, and then set the default jump button to something out of the way.
B
2
G
3
Posts: 71
Reputation: 992

Post » Fri Jan 30, 2009 1:43 am

You can't change the names of the controls if you want them to continue working properly with the Platform behavior. You can, however, change the key that uses the control. So you can use Z if you want, you just can't name it "P1 Jump."

I was unaware of this until recently, so I now have to go back and edit all of my Platform School tutorials, since I said it was okay to change the name. I just never changed the name for Jump.

Odd, though, that you can still move left/right if you rename "Move Left" and "Move Right."

Also, you won't be able to make a separate set of controls for a second player right now. Construct doesn't yet support multiple players, or multiple player controls. You could do it manually with key-presses, rather than control-presses, but you will lose some functionality (most notably, Jump Sustain).

[quote="fieari":9oem79gh]You can work around it by making an event to tell your platformer to jump when YOUR jump button is pushed, and then set the default jump button to something out of the way.[/quote:9oem79gh]

Actually, no... for the reason mentioned above. You'd lose the Jump Sustain ability. This might not affect some games, but Mario definitely has Jump Sustain.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 30, 2009 1:51 am

[quote="thomasmahler":18774655]Also, how do I recreate the 'momentum steps'? Say, you're running and you suddenly do a full stop - in the NES game, mario still takes a couple more steps from the built-up momentum. How do I recreate this?

Also, if you're running and you suddenly switch directions, there should be a new sprite animation where Mario already looks into the changed direction while the momentum still moves him into the previous direction for a couple of milliseconds - is there an attr to set this in the platformer behavior?[/quote:18774655]

You can do this with events. Set your animation based on the X component of Platform motion, rather than key presses.

Set the direction based on key presses, though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 30, 2009 1:53 am

[quote="deadeye":jzrrg9r8]Odd, though, that you can still move left/right if you rename "Move Left" and "Move Right."[/quote:jzrrg9r8]
If a control does not exist (as in, it was deleted or renamed to something else), the behavior reverts to the default controls. This is so even if you delete all the controls you can still use the default controls. If you rename "Move Left" to "My Control", it reverts to the default control, so if you change which key "My Control" is, it won't affect the behavior.

Basically on startup plugins ask Construct what a key is by its control name, and if it's not found, it'll use a default.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Fri Jan 30, 2009 2:00 am

By that logic, shouldn't you still be able to jump if you rename the Jump control? Or, like in the bug report I posted, be able to press down and jump to fall through a platform even if you renamed "Move Down?"

I guess what I'm trying to say is, if renaming "Move Left" and "Move Right" still allows you to move left and right, why can't you jump if you rename "Jump?" It's inconsistent, which makes it a little confusing.

Edit:
Er, never mind, I just realized that you can still jump in the posted example by using Shift, which does make sense... even so, renaming "Move Down" shouldn't have any effect, as long as you're still using the same key.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 30, 2009 11:03 am

could anyone explain what jump sustain does?? (hope you dont mind me asking in your thread thomasmahler)
B
2
S
2
G
3
Posts: 193
Reputation: 1,636

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests