HexMozart88

The Master of Random Garbage
Veteran
Joined
May 15, 2016
Messages
2,531
Reaction score
4,822
First Language
English
Primarily Uses
RMVXA
Sorry if the title isn't super helpful, there are a couple of questions I have, but they're in the same vein, so I'm using the same post. I'm trying to event an ABS, but at the moment, I'm stuck on the input handling. I've seen a few other people make these systems with events by checking if the player is pressing Space, otherwise, take damage. However, I noticed a huge flaw with that. You can just hold space for the entire battle and not get hit. That's not quite what I have in mind for an engaging and challenging battle system, LOL. I've considered using Input.trigger?, but that would make it much too hard now, because you have to be touching the enemy and pressing the button in the exact same frame, which is too precise for most players. So what I'd like to do is make a bigger window of time for the input to register. What I mean by this is, press the button, and if you're within say 90 frames of the button being pressed and you're touching the enemy, attack them. After that, you have to re-press the action button for the attack to register, so that we can eliminate the problem of the player holding Space for the entire battle and winning.

Sorry for the wall of text, I was trying to make sure I really explained what I wanted.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,289
Reaction score
9,703
First Language
German
Primarily Uses
RMMV
you can do this by basically splitting the action from the trigger - but that is tricky because of timing problems and a few other things.

basically you need two different things:
one parallel that checks which button is pressed and when. and then sets switches based on those button presses. basically if the attack button is pressed, a switch is turned on and a variable times a number of frames until the attack switch is turned off and so on.
you'll need several switches and timer variables to get everything right

and then the enemies are activated on touch but check the switches for the current timing before deciding on the results.

you might also want to look for a keyboard script so that you can assign other keys to the different functions you need.
 

Ratatattat

Veteran
Veteran
Joined
Mar 22, 2020
Messages
221
Reaction score
218
First Language
English
Primarily Uses
RMMV
This seems reminiscent of the issue I ran into eventing my stamina/dashing system for my ABS. When stamina runs out dashing is disabled, and when there's enough to dash again, it's re-enabled.

Lots of little things came up that I ended up addressing, but one of the things was that if the player is consistently holding the dash button, they'd end up in a cycle of rapidly flipping between dash-walk-dash-walk-dash-walk, and effectively achieve a sort of jittery, medium half-speed as the stamina drains-regens-drains-regens-drains-regens. This was because they'd automatically start dashing again the moment it became possible again, every time it became re-enabled as long as they were still holding the button down.

So I made a condition that they must not be pressing the shift key in order for dashing to be enabled again - so they must lift their finger and press again - to prevent the almost cheaty, and choppy-looking "jogging"-like state.

I'm not sure how much of this can be precisely translated to your specific situation, but in case it helps to provide a starting-point, here's my stamina event page:

This system works like a charm, by the way :)

picture1.png
picture2.png

I think it's basically a version of what Andar described; just instead of using a switch and timer, I'm using a button-input check and a variable-comparison check.
 

Latest Threads

Latest Posts

Latest Profile Posts

Nearly done with the topmost deck of the SS Astrale Symphonie (she's got a name at last!). Still needs a lot of work but at least now it is vaguely recognizable as a ship deck. Working at a snail's pace but it's coming together. :kaopride:
Screenshot-2022-06-30-104933.png
Letting people know I'm debating leaving RM, and thus this forum. I'll continue to keep in touch with any friends I've made here, but between Unity being better suited to my needs and people on here getting increasingly horrible, I think switching my games to Unity might be better for my mental health.
Lord Vectra wrote on lianderson's profile.
*poke* Hello. Not suprised to see you here, but I didn't know you was here.

Forum statistics

Threads
123,198
Messages
1,154,782
Members
161,568
Latest member
DP-404
Top