My 'Help Me' Thread

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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?

  • 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?

  • 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...

  • 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.

  • 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.

  • 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).

    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.

    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.

  • 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?

    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.

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

    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.

  • 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.

  • could anyone explain what jump sustain does?? (hope you dont mind me asking in your thread thomasmahler)

  • It allows you to jump higher the longer you hold the jump key.

  • 4) I'm trying to understand the resources tab now. Basically, that's where all the content is being stored if we're exporting to the .exe, right? So this is where I store sounds and stuff.

    I'm not sure I understand the structure though. Do I just add all the resources I need under 'Binary'? Would I add the sounds to Binary? I can't add a submenu there, which means that it'd be quite messy after a while.

    Also, if I rmb on the 'Font' Resource, nothing at all happens. Does that mean that I can't add my own fonts?

  • 5) Can't seem to find out how to do this:

    I want to have a global variable called 'Gold'. Whenever the player picks up a gold coin, I'll add +1 to this global variable - I can do that. Here's the tricky part:

    I want to display the Gold Global Variable on top of the screen, in the hud - so that the player always knows how much gold he has already collected.

    So how do I tell a text object to simply display the number in the gold variable?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Set the text to global('Gold').

    Resources bar: parts of it are not yet implemented. Hopefully it'll all be done by 1.0.

  • Awesome, thanks a lot!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)