Can we separate trigger and hold

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
170
Reaction score
27
First Language
thai
Primarily Uses
RMMV
I want to separate trigger button and hold button to do separate thing
Is this possible
I check on some other plugin(mog)
He still can’t separate it
(It and attck and charge attack in abs but it still go attack one time before it realized we holding the button)
So I wonder is it possible
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,335
Reaction score
328
First Language
German
Primarily Uses
RMMV
Yes this is possible, how well this plays out ingame, is another one.

So you dont want:
Press X = Slash
Continue holding X = It starts to Charge Up.
In Past Zelda Games they did it like this, if i remember correctly.

You want:
Press X = you got up to 20 frames to release x button to execute a slash, if you keep holding it longer,
than it goes over in charge mode, when you release x in charge mode before its fully loaded, you execute no slash, when its full you would do special attack. player can move around while charging up. is this correct so far?

It could feel strange if the slash isn't executed with button press, but with button release, atleast for normal slashes. But a Testbuild will tell us for sure.

Instead of binding slash attack to a button, you should call it manualy with a plugin call or script call eventcommand if possible.
Than we could help you with the conditional branch logic for this.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,444
Reaction score
932
First Language
EN
Primarily Uses
RMMV
A button can be in one of two states: up (default) or down. From there we get several secondary states, which in RMMV are named as follows (cf the Input object defined in rpg_core.js):
  • Pressed - button is down (this can be checked via Conditional Branch command).
  • Triggered - button is down and has only been down since this frame ("repeat time" is zero).
  • Long Pressed - button is down and has been down for at least 24 frames ("repeat wait" time).
  • Repeated - returns true once every 6 frames ("repeat interval") while long pressed.
Using switches/variables, you can mimic all of these checks with pure eventing, e.g.
Code:
◆Control Variables:#0020 Time = 1
◆Loop
  ◆If:Button [OK] is pressed down
    ◆Control Variables:#0020 Time += 1
    ◆Wait:1 frame
    ◆
  :Else
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above
◆Text:None, Window, Bottom
:    :Button held down for \v[20] frames!
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
170
Reaction score
27
First Language
thai
Primarily Uses
RMMV
A button can be in one of two states: up (default) or down. From there we get several secondary states, which in RMMV are named as follows (cf the Input object defined in rpg_core.js):
  • Pressed - button is down (this can be checked via Conditional Branch command).
  • Triggered - button is down and has only been down since this frame ("repeat time" is zero).
  • Long Pressed - button is down and has been down for at least 24 frames ("repeat wait" time).
  • Repeated - returns true once every 6 frames ("repeat interval") while long pressed.
Using switches/variables, you can mimic all of these checks with pure eventing, e.g.
Code:
◆Control Variables:#0020 Time = 1
◆Loop
  ◆If:Button [OK] is pressed down
    ◆Control Variables:#0020 Time += 1
    ◆Wait:1 frame
    ◆
  :Else
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above
◆Text:None, Window, Bottom
:    :Button held down for \v[20] frames!
the problem is it always execute the trigger one time before press or long press
I already do this in script

Yes this is possible, how well this plays out ingame, is another one.

So you dont want:
Press X = Slash
Continue holding X = It starts to Charge Up.
In Past Zelda Games they did it like this, if i remember correctly.

You want:
Press X = you got up to 20 frames to release x button to execute a slash, if you keep holding it longer,
than it goes over in charge mode, when you release x in charge mode before its fully loaded, you execute no slash, when its full you would do special attack. player can move around while charging up. is this correct so far?

It could feel strange if the slash isn't executed with button press, but with button release, atleast for normal slashes. But a Testbuild will tell us for sure.

Instead of binding slash attack to a button, you should call it manualy with a plugin call or script call eventcommand if possible.
Than we could help you with the conditional branch logic for this.
there are no release for input in rpg_core
and it weird because touch input have...
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
170
Reaction score
27
First Language
thai
Primarily Uses
RMMV
not sure if I already solve
Input._onKeyUp
I found this and experimenting on it
it work fine now but there maybe some bug That I'm not deiscover it yet
thank you
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,444
Reaction score
932
First Language
EN
Primarily Uses
RMMV
Yes, I was just about to post that, haha. That should run when a key is released. :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

There a thread out there that tells us the best way to open an RPG that isn't 'the protag gets out of bed'?
Updated my state Stacker Script on itch.io, github is down for some reason (probs just me).
Wife watching Locke and Key. This show is so bad!! You can't just acclimate to discovering magic or magical worlds in less than 60 seconds.
I think I still prefer RPG Maker over Dreams. Been playing around with it, and the controls are really the biggest flaw for me.

Forum statistics

Threads
94,332
Messages
919,996
Members
124,087
Latest member
OrdinaryOne
Top