Closed iKNIFEu closed 4 years ago
Duplicate of #5
If you want to change this yourself, this is where you would need to look All inputs are routed through the VPad object. It keeps track of what buttons you are pressing with a 1 meaning the button is pressed, and a 0 meaning that it is not pressed. It also keeps track of what buttons you were pressing on the previous frame. This allows the detection of new button presses instead of button holds by checking if the current value is greater than the previous value. If you want to allow continuous input, you would replace this condition with one that only checks the current value.
There are 4 different checks for jumping, 1 for each gravity direction.
Sorry I am confused about what you were saying.
What are you confused about? What have you tried so far?
"you would replace this condition with one that only checks the current value." I didn't know what was that, I tried many conditions especially the "loops" category in the condition list for system, But.. it didn't work.
You do not need to add a loop to make this change. Why do you think you need a loop?
Well it is hard to understand what were you saying.. Can you please make it clearer?
because I don't know what the "one that only checks the current value." Can you please tell me what is that?
My explanation about how my inputs were structured wasn't there for nothing. Think about it for a moment. The VPad object keeps track of the pressed state of each input, both for the current frame, and for the previous frame. The variable names should make it obvious which is which. Both sets of info are used together to detect button presses and button releases, allowing me to restrict the jump action to button presses instead of button holds. If you are only interested in button holds, then you only need to consider the current pressed state, and not the previous pressed state.
Now I understand what VPad is, but all I need to know is to what to do, what to replace and add.
The message I keep hearing from you is "I don't want to learn how to do this, just tell me the exact steps to follow". That's telling me that you don't want to put in any effort, and putting in effort is part of my stipulation for continuing to help you. If you think this interpretation of your words is wrong, then prove it by sharing the details of what you tried and why you thought it would work. If you can't do this, I won't help you.
I suggest you start reading some materials on basic programming. Construct 2 events (read thoroughly, including links to other pages) C++ relational and comparison operators (read only linked section)
Those links + everything I have mentioned here should be enough to figure this out.
Alright, sorry for replying late. I just found out that automatic jump isn't possible in construct 2. I've seen that on other construct games, even construct 3 games. So, I'm sorry for wasting your time and all, thank you for trying to help. I was literally not knowing what the hell I was doing. So, I'm sorry.
@Jcw87 Hold on, now I understand!
I understand what you meant by "Continuos input (sorry for misspeling i'm just lazy to fix)" I just need to add a condition that checks.. hmm.. I see. I'll try it out now. I'll inform you if it works or not. (My mind was dumb 4 months ago xD)
@Jcw87 I tried what you meant, it was successful, but there is just one bug from it. No matter how many milliseconds I press the jump button, it jumps to the highest it could. No, I didn't delete the "Set VPad.LastUp/Down/Left/Right to VPad.Up/Down/Left/Right", I made special vpad conditions for the player soul (You are so smart to add them btw). I tried everything possible with the palyer soul thing, and it was working! (Because I pressed the highest jump possible to test the auto-jump). The LastLeft/Right/Down/etc. is what makes it not having auto-jump. can you please help me?
Regarding autojump 'not being possible' in Construct 2, I disagree. While the default platforming behavior has a check to stop autojumping in the simplest use case (if user holds button, then jump), you can still make it autojump if that is what you want. This project doesn't use the default platforming behavior however, so nothing about that applies here.
Regarding what you tried, I want to see a screenshot of what you changed. That will allow me to give you more appropriate hints.
Alright, please wait. I'm going to load it up.
I do understand that "LastDown/etc." does the problem. and this is the only problem. I do not know how I can make the jump at a high rate. second picture:
Third picture:
Fourth One:
Here are all the pictures for the PlayerVPad
Ok, you are waaaaay over-thinking this. You don't need to create separate player direction variables. You don't even need to change anything outside the jumping events.
Starting from my codebase without any of your changes, you only need to change 1 condition for each direction. Just one. If you feel the need to do more, you are over-thinking it still.
I see. Do you mean the "Playerdown > LastPlayerDown"? OK. Sorry for replying late. Do I need to change this? I really think I should.
Yes
Ok, I'll tell you what will happen when I do this. OK?
You meant this: If yes, please tell.
I'll wait for your answer in this one, I'll take "VPad.Down/VPad.LastDown" as an example. What will I do?
Let's think about all of the possible scenarios here.
Now ask yourself. "What can I change about this condition to make the player always jump when pressing or holding the button?"
Hm, good idea.
but it's complicated lol
There's nothing complicated about this.
The current condition is VPad.Down > VPad.LastDown
. This condition will only be true for scenario 2. You are looking for a condition that will be true in scenario 2 and 3, and false in scenario 1 and 4. What would allow you to check for scenarios 2 and 3, but not 1 and 4?
If you are still struggling, recall what I said before: "If you are only interested in button holds, then you only need to consider the current pressed state, and not the previous pressed state."
Alright. I'll go try my best now. Brb
i made it @iKNIFEu . try this;
i made it @iKNIFEu . try this;
Thank you so much! @Jcw87 There you go. Thanks to him. He helped me, too. As a reward for you Jcw87, I'll make something for your bad time simulator. This might take days so yeah 😅
i made it @iKNIFEu . try this;
Great, you just gave him an answer. Now he won't learn anything. But it seems you have a couple things to learn. Those keyboard conditions are completely unnecessary, and just break jumping for gamepad and touch controls. The whole point of the VPad object is to abstract all of the input so that you never have to think about things like the input device and button mappings in the game logic. Trying to handle all of these input sources in the game logic is a recipe for strange behaviors and difficult to find bugs.
While this answer technically works, these answers make more sense for readability: VPad.Up > 0 VPad.Up = 1
It really was that simple. Not complicated at all. Either one of those would work.
i made it @iKNIFEu . try this;
Great, you just gave him an answer. Now he won't learn anything. But it seems you have a couple things to learn. Those keyboard conditions are completely unnecessary, and just break jumping for gamepad and touch controls. The whole point of the VPad object is to abstract all of the input so that you never have to think about things like the input device and button mappings in the game logic. Trying to handle all of these input sources in the game logic is a recipe for strange behaviors and difficult to find bugs.
While this answer technically works, these answers make more sense for readability: VPad.Up > 0 VPad.Up = 1
It really was that simple. Not complicated at all. Either one of those would work.
You are right. And actually, thanks to your explanations, ALL of them. I understood how the VPad works. When I was overthinking. I literally am trying hard to add auto-jump. But when you told me I was overthinking, I stopped. And thought. Right now, I know that you weren't giving me an answer just so I can learn what VPad is actually used for. Thank you. Thank you really. and by the way, thanks for reminding me that touch and gamepad controls exist :/ Again, thank you. Have a good day! Edit: Or night..
Now this issue is fully closed, thank you Jcw87.
I have lots of issues in my custom attack because there is no autojump, why not adding it? I tried looking for it in construct 2, but failed.