switchblade327's Recent Forum Activity

  • (sorry for the "test"; I'm having login issues that erase my posts!)

    Thanks for the quick reply and sorry for the slow one on my end. Your suggestion worked perfectly. I have an IsAccelerating and IsDecelerating variable that are set by a PreviousTickSpeed variable and it all works :)

    Also, that's great to hear that drawing is 90% of the resources. I've made a lot of game-spec art so I'm not worried about that but I don't know much about optimizing routines and such. Good to know it's more forgiving.

  • What would be the best way to monitor if a player is accelerating or decelerating? Basically, something equivalent to the "is jumping/is falling" events but horizontally (for walking & running)?

    I know there is the "compare speed" Platform event. Would I just set that to run globally every tick and compare to the last tick? Seems like that would work but probably not be the most processing-efficient way to do it.

    Thanks in advance for any help.

  • I posted last week about on key pressed/down/released here and got quick and helpful answers, but in the end I wasn't able to solve the real problem I was trying to solve.

    I am trying to build a state machine for a 2d platformer animation set, based on the Platform behavior but elaborated with transition animations between states. I had made a descent bit of progress with the Default keyboard controls, posted here:

    Default controls.capx

    I was testing the behavior with a simple stand-to-run/turn-to-run/run-turn-to-run depending on current state and facing (mirrored or not) and the above example works exactly as I intended.

    But when I switched to non-default controls for WASD/Gamepad, I ran into problems. Now turning-while-running is broken while going left-to-right as is stand (facing right) to run-left. The newer, broken capx is here:

    Non-default, broken controls.capx

    The problem still seems to be in detecting when something is pressed/down/released but I'm certainly still missing something.

    Any help would be much appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome, thanks so much!

  • Hi,

    I've been stumped searching for an answer and it's been hard to even phrase the question but I think I've got it now.

    I am trying to setup a state machine based on GlobalNumbers. It's easy enough to tell it when to switch from one to another but I'm wondering if there's a way to monitor not only when it's on and off but whenit switches on and off.

    The best example is in the way Construct 2 monitors a keyboard. That I can watch for when it is first pressed, when it's on and when it's released:

    <img src="https://dl.dropboxusercontent.com/u/1587144/Scirra/Keyboard.JPG" border="0" />

    I'd like to set up this same behavior but with a variable, like below:

    <img src="https://dl.dropboxusercontent.com/u/1587144/Scirra/Spacebar.JPG" border="0" />

    I want to watch for when the Spacebar variable switches from 0 to 1, when it's on 1 (can do this already) and when it switches from 1 to 0.

    Is this possible and if so, how?

    Thanks in advance for any help.

  • Aha! That makes sense, especially since I want to add ledge-climbing. I hadn't thought of that. Thanks!

  • I'm working on my 2d platformer state machine setup and hit another roadblock, this time related to ladders and specifically, how to dismount them.

    I've looked over the examples but they either allow for Y movement on the ladder(I want the character locked to the center of the ladder on Y while climbing) or they require a separate key binding to dismount.

    What I want is to have the player exit the climb state when they reach the ground (I have this working) or when they press left or right when they are within a few pixels of a platform adjacent to the ladder (not yet working).

    I want pressing right arrow to dismount onto the platform to the right.

    <img src="http://i45.tinypic.com/fjiagj.png" border="0" />

    I assume I need to find a way to compare the playerCapsule and Tile's Y position but I'm not having much luck doing it. I'm still unclear on how to have it compare the nearest tile value, or how to set a small range of pixels that will allow the dismount. I suspect the solution lies with allowing the Player to continue to climb when there is Collision with a tile but to dismount when their Y origins line up with an offset.

    The .capx is here:

    dl.dropbox.com/u/1587144/2D_StateTesting_03a.capx

    The climbing "code" are in events 17-22.

    Thanks in advance for any help.

  • Yes, that not only made sense; it worked like a charm! I added the IsSliding variable and defined it's action as "Set PlayerState to 6" and it works exactly as intended. Thank you very much!

  • Thanks for the quick replies! I guess wait isn't actually what I need. Here is the state machine so far:

    The states:

    <img src="http://i1068.photobucket.com/albums/u442/AnimationMerc/StateMachine_01.png" border="0" />

    The conditions:

    <img src="http://i1068.photobucket.com/albums/u442/AnimationMerc/StateMachine_02.png" border="0" />

    The problem is this:

    I am trying to get State 6 (sliding) to lock in until velocity = 0, (hence the "start ignoring Platform user input" action.

    All of this works and the slide completes as desired before restoring player control, but if I release the Down arrow during the slide it returns to State 1 (Running), even as it slides to a stop. I am hoping to lock the state machine into state 6 (sliding) until it reaches zero velocity.

  • I am returning to Construct 2 after some months away, busy with work. Getting back into it is easy and a testament to how user friendly it is. I even fixed a problem I'd gotten stuck on six months ago! Then I got stuck again.

    I recall seeing a tutorial about an Action to "hold" (or pause or wait or some similar verbiage) an Event as active until a certain condition or conditions are met (X amount of time passed, velocity == 0 etc).

    Can anyone steer me towards that functionality? Either a tutorial, example or manual entry?

  • Thanks for the quick reply and the explanation! That makes sense. I wondered about the Reset Global Variables thing but it seemed to be working for the other stuff.

    I was using the global numbers on and off because I'd seen other people's example projects do it that way. But I understand why it should be a single variable to define them all. I'll start digging in that direction.

    Thanks again!

  • Sorry to bug again so soon but I'm stumped.

    I am trying to set up a simple state machine with Construct 2 for a 2d platformer. I am trying to use states in hopes of simplifying transition animations later on but I'm having a problem with sliding.

    Basically, I want the down key to be the crouched state, down and move to be crawl state but pressing down while running to be slide state. But pressing down while running just triggers crawl.

    Can I not use one state (global variable) to determine when another should be entered or have I just not got this set up right? I tried down arrow is down' and 'down arrow is pressed' but neither worked.

    Here's the .capx if it helps:

    dl.dropbox.com/u/1587144/2D_StateTesting_02.capx

    Thanks in advance.

switchblade327's avatar

switchblade327

Member since 17 Jun, 2012

None one is following switchblade327 yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies