What I'm asking is how could I go about setting up a skill(like guard) to be performed only when a certain key is pressed on an actor's turn(and not happen until it's time to take their action)? It wouldn't appear on the command list, but when say 'A' is pressed, it'd take a turn for that character, and have them guard, or wait, or something. I know that through a conditional branch, it'd run something if a key is pressed, like what I'm asking for, but is there a way to have the effect run for the specific actor that uses it? 🤔
(Ah, and I'm using VX Ace.)
The simplest way to do this would be by scripting, as we cannot detect a player's turn selection just with eventing. (It is different if you made a full battle system using just eventing, but....)
This is one example.
class Scene_Battle < Scene_Base alias :create_actor_command_window_shiftguard :create_actor_command_window def create_actor_command_window create_actor_command_window_shiftguard @actor_command_window.set_handler🙂SHIFT, method🙂command_guard)) end endThis will set the Shift key to make the current actor assign guard as action.
I just tested this(as well as in a new project), and..it doesn't work. I mean, it doesn't result in a character guarding, or anything happening actually. I changed the key as well, but still nothing happened(unless I'm doing something wrong o-o).
I would reccomend adding this
class Window_ActorCommand < Window_Command def process_handling return unless open? && active Window_ActorCommand return call_handler🙂guard) if handle?🙂guard) && Input.trigger?🙂X) endendYou can repeat this line :
return call_handler🙂guard) if handle?🙂guard) && Input.trigger?🙂X)Changing the "X" depending on the input key you need
Ah, okay(didn't know I had to use both snippets..I'm oblivious like that sometimes..). Thanks Shadow, this time it works just fine. 🙂
This can be closed now. 😉
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.