How to perform battle actions with button input in VX Ace?

Egerunt

Villager
Member
Joined
Jan 5, 2019
Messages
29
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I'm wondering if there is a way to have my characters perform their actions, such as attack or guard by pressing a specific button on the keyboard, instead of having to go through the menu and just press z.
For example, for someone to use attack in battle they press "Z" but to guard they press another button such as "D" and to open their skill list they would press "S" which then they could scroll through the numerous skills and select which skill they want to use by pressing "Z" to confirm the skill.

I would really like it to be transferable onto a controller, for example a Playstation controller so that pressing the cross would be attack (which originally would be "Z" on the keyboard); pressing square would be guard (which originally would be "D" on the keyboard); pressing triangle would open the skill list (which originally would be "S" on the keyboard) then pressing the cross would select the chosen skill and pressing circle would be cancel (which originally would be "X" on the keyboard) such as closing the skill list and going backwards in the commands.

I feel that this would make performing actions in a turn based battle a little quicker as it would allow the player to guard in the press of a specific button instead of having to scroll down on the list first, same goes for opening the skill list.

I would really appreciate the help, thank you in advance.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,186
Reaction score
1,162
First Language
Spanish
Primarily Uses
RMVXA
possible, but it requires a rewrite of the status window and the targetting window.
and possibly of the base window, because all selectable windows are inherited from it.
as a test version, I suggest trying plain battle eventing and seeing how it responds.... if you can achieve it with plain eventing, you can sure make it with code.

maybe set a battle event to run before turn 0, disable all windows, and then disable itself, and another event that'd pick up the button presses.
that's to give you an idea of how to send out the calls to the different windows.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,008
First Language
Tagalog
Primarily Uses
RMVXA
its actually just a matter of catching button triggers in Window_ActorCommand aside from OK, Cancel and Arrow keys. Its simple enough if you know how the command/selectable window works, and the flow/methods of the battle system.

For example, this short script I attached disables the default arrow key and OK handling of the actor command window (so you cannot choose commands via the normal arrow keys + Z trigger) while allowing you to use attack via the Z and guard using S. Adding shortcuts for other menu options is simply a matter of knowing the handler that they use and choosing which button you want (in terms of the engine's button codes, not keyboard assignments)

One thing though, the default system separates each skill type into its own command button/menu, if your game uses a a lot of skill types, you might run out of button for the shortcuts..

As for transfer/usability of it to a PS controller, that depends on the input type of the controller. Afaik, VX Ace only supports some input types and without a custom script/DLL that can catch the input type of the controller in question, then you cant catch those button presses.
 

Attachments

Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,186
Reaction score
1,162
First Language
Spanish
Primarily Uses
RMVXA
its actually just a matter of catching button triggers in Window_ActorCommand aside from OK, Cancel and Arrow keys
it's much easier to just ditch the actor command window and go directly to the actions.
the actor command window is there to decide between fighting and running (by default), but if you transfer the flee option to the actions, you don't need that window, it'll always default to "fight", and "flee" will be a fighting command, not an option other than "fighting".
that'd take a layer off the whole problem.
 

Egerunt

Villager
Member
Joined
Jan 5, 2019
Messages
29
Reaction score
0
First Language
English
Primarily Uses
RMVXA
its actually just a matter of catching button triggers in Window_ActorCommand aside from OK, Cancel and Arrow keys. Its simple enough if you know how the command/selectable window works, and the flow/methods of the battle system.

For example, this short script I attached disables the default arrow key and OK handling of the actor command window (so you cannot choose commands via the normal arrow keys + Z trigger) while allowing you to use attack via the Z and guard using S. Adding shortcuts for other menu options is simply a matter of knowing the handler that they use and choosing which button you want (in terms of the engine's button codes, not keyboard assignments)

One thing though, the default system separates each skill type into its own command button/menu, if your game uses a a lot of skill types, you might run out of button for the shortcuts..

As for transfer/usability of it to a PS controller, that depends on the input type of the controller. Afaik, VX Ace only supports some input types and without a custom script/DLL that can catch the input type of the controller in question, then you cant catch those button presses.
it's much easier to just ditch the actor command window and go directly to the actions.
the actor command window is there to decide between fighting and running (by default), but if you transfer the flee option to the actions, you don't need that window, it'll always default to "fight", and "flee" will be a fighting command, not an option other than "fighting".
that'd take a layer off the whole problem.
Thank you for your replies. Knowing that it's possible makes me very happy. I'm also able to make my PS4 controller work with VX Ace in terms of using the left analog for movement, the right side symbol keys for input, and the 2 L and 2 R keys, however I'm unable to make the arrow keys usable.

Either way I'm considering only using one skill type "Special" for every character to make the button input the same for every character and to ensure that there are enough buttons for everything.

Considering everything you both have told me, I feel that it would be a good idea to remove the initial actor command window of fight and flee and instead implement for the "X" key or circle on the PS4 remote to open an option box asking whether you wish to flee from battle which would be confirmed by clicking "Z" or the cross and it would be cancelled by pressing the "X" or circle buttons again, however if the "special" skills list would be open it would instead close that skill list and then you'd have to input circle or "X" again to then have the option box for fleeing appear.

I understand that I may be making it confusing and if any elaboration is needed just ask and I will try to explain what I mean more clearly.

However, to be brutally honest, I do lack scripting knowledge and would probably require hand-holding to help me implement all the scripting that is required to make the battle system work. As long as I can make it work on the keyboard with the use of about 7-8 keys at most, I should be able to at least make it function on the PS4 remote, so the most important part is making the script actually work for normal keyboard game-play at first.

Thank you again for your contributions, I really appreciate them.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,008
First Language
Tagalog
Primarily Uses
RMVXA
it's much easier to just ditch the actor command window and go directly to the actions.
the actor command window is there to decide between fighting and running (by default), but if you transfer the flee option to the actions, you don't need that window, it'll always default to "fight", and "flee" will be a fighting command, not an option other than "fighting".
that'd take a layer off the whole problem.
Uhm no, what youre describing (the one with fight and flee) is the Party Command Window.. The Actor command window is the one where you choose "Attack, Guard, skills, items etc".

The sample I posted, in case you missed it, already proves that its simple enough (just a few lines) without removing the flee/fight window. Its actually simpler if you dont remove it since that needs additional code.

If youre suggesting of replacing the actual actor command window (or action window whatever you wanna call it) with our own input system and window, that will just put more chances of incompatibilities since it will need a modification of the flow of the system while the method I presented and made an example of still uses the default flow of things, minimizing the possibility of incompatibilities. Hijacking the Window_ActorCommand as I did is way simpler and safer. Its also easy for example to extend that window to show all 8 commands that he wants instead of the default which is 4 I think.

Anyway, the script I posted is practically already a working base for this (you can try it, its just a few lines), you just need to add the other shortcut buttons. If you need/want to ditch the party command window, it will need some more edit to the battle flow. I can probably edit it for you in a few hours as Im at work right now. Alternatively, I think yabflys battle engine gives you that option of skipping that window.

As for the PS controller, if its working for you, then the script should work fine with it because the internal input calls that RM makes is the same for both keyboard and controller, unless maybe you have an input script that modifies that behavior
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,186
Reaction score
1,162
First Language
Spanish
Primarily Uses
RMVXA
Uhm no, what youre describing (the one with fight and flee) is the Party Command Window.
yeah, I mean *that* window.
still... same thing: take it out of the equation and transfer those commands to the actor window, it's one layer you cut out of the solution.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,008
First Language
Tagalog
Primarily Uses
RMVXA
Yeah, but that can simply be added as a next step or as fine-tuning, its not required for the base solution (the original question was only for the actual actor command selection) which, as I've demonstrated in the sample script (screenshot attached on my first reply in case you did miss it), can be done via solely modifying the Window_ActorCommand class.
 
Last edited:

Egerunt

Villager
Member
Joined
Jan 5, 2019
Messages
29
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Yeah, but that can simply be added as a next step or as fine-tuning, its not required for the base solution (the original question was only for the actual actor command selection) which, as I've demonstrated in the sample script (screenshot attached on my first reply in case you did miss it), can be done via solely modifying the Window_ActorCommand class.
I've tried inputting the script that you attached, however the photograph cuts off the end of line 9 and I can't figure out what I need to put in.
That causes the game to crash for me during battle as soon as I press z on the fight option at the start of battle. If you could just tell me what's being cut off in the photograph I'll write it in and see how everything works. Once again I'm grateful for the active help that's being provided.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Quexp wrote on Shaz's profile.
I absolutely love your profile/pic! :kaoluv:
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
I made a battle results screen for my minigame.. any feedback? :)
Things I thought would never happen but just did: I needed to use my snow shovel. In August. In the Northern Hemisphere.
So I finished Cupcake, now I need to figure out my next project!
Do I pick up one of my incomplete games?
Do I start something entirely new???
The possibilities are endless!

Forum statistics

Threads
100,682
Messages
978,383
Members
132,307
Latest member
secasus
Top