"Rock-Paper-Scissor" Attack Command

Okay, bear with me here, I am trying to implement a change to the over all design of the battle system. What I am trying to do is replace the attack function for both NPCs and PCs to three or four options that act in a rock paper scissors like style. So for example let us say the menu lists three functions for attacking when you click "attack". These would be "rock", "paper", and "scissors", following similar rules of the hand-game the character would gain some sort of advantage by choosing the function that beats the targets.


I am trying to work this into a CBT system and I am using most of Yanfly's plugs.


Now my question would be: A) Is it possible (which i think it is), B ) Has it been done, and C) any idea on how?


I know i can replace the attack command and then add a list of "skills" to replace it using some HIME plugs, but then the NPCs would still be using the Attack command.


Any thoughts?


EDIT: should clarify, I am doing this myself in rpgmaker MV.
A. Absolutely, in fact, you only need to change a couple of things in either the scene battle or battle command window to "link" it to a skill.


B. It has been done :3 (Shameless self advertising here), entirely through eventing and state-checking.


C. Eventing, as I had done, or some plugins would work as well.
actually you can change the abilities the enemies can use......... just change the attack skill out for the three skills your talking about in the enemies tab under action patterns... and you can make some enemies more likely to use certain ones of the three..... 
Ah thank you 😀


EDIT:

A. Absolutely, in fact, you only need to change a couple of things in either the scene battle or battle command window to "link" it to a skill.


B. It has been done :3 (Shameless self advertising here), entirely through eventing and state-checking.


C. Eventing, as I had done, or some plugins would work as well.



So yeah that is, essentially, the concept i am going for (albeit with multiple enemies and four choices..). I see what you did..but do you have to event each encounter?
No, I made a single common event that had the basic rock-paper-scissors logic and just named each enemy differently. Their parameters were set up via variables, and their names as well. The entire thing is done with about 12 variables or so in various conditional branches, and I just have a page on the troop events on turn 0 to initialize these variables for each separate enemy.
I've moved this thread to RGSSx Script Support (assuming you're trying to do this yourself and not actually asking for someone to do it for you). Please be sure to post your threads in the correct forum next time. Thank you.
I've moved this thread to RGSSx Script Support (assuming you're trying to do this yourself and not actually asking for someone to do it for you). Please be sure to post your threads in the correct forum next time. Thank you.

Okay... But this is a question for MV.... I think i was in the right spot before....


EDIT: not to double post....

No, I made a single common event that had the basic rock-paper-scissors logic and just named each enemy differently. Their parameters were set up via variables, and their names as well. The entire thing is done with about 12 variables or so in various conditional branches, and I just have a page on the troop events on turn 0 to initialize these variables for each separate enemy.


I see, I think i get it, but I learn better by example. If it is okay with you could i get a copy or an example project?


Because if I get you right then i would need to set a variable for each individual. But that seems wasteful. Couldn't I just set a variable for each member of the troop but not specific enemies (so for example both bat A and Toad A share the A variable in different battles but when together as a troop they do not share and are var A and var 😎.
Sorry - I thought you were using Ace - are you sure you didn't post this in the Ace Support forum?  I know for sure it was in one of the Support forums and not one of the Script forums.  I'll move it to JS Plugin Support.
Sorry - I thought you were using Ace - are you sure you didn't post this in the Ace Support forum?  I know for sure it was in one of the Support forums and not one of the Script forums.  I'll move it to JS Plugin Support.

Yeah i posted it in the MV support because i am looking for event help essentially. It is kind of on the border of events and scripts.
@Baerthe, ah, no, I had "enemy mhp" "enemy hp" enemy attack value" "enemy regeneration per turn" "enemy name" "current enemy 'stance'" "enemy tie damage", and that was it. I initialized these variables in troop events. I'll see if I can send you a copy of my project, later, but here's an example:


Slime troop page, condition is turn 0


"Enemy mhp", variable ID 5, is set to 10.


"Regen per turn" variable ID 6, is set to 2.


Bat troop page, condition is turn 0


"Enemy mhp", variable ID 5, is set to 20.


"Regen per turn", variable ID 6, is set to 0.


So basically the same "variable", but each "variable" gets reset every new battle, while some other variables, notably player variables, stay the same. For example, variable ID 1 might be the player's Regen, which I don't want to reset to 0 every battle so I don't change its value in the troop events.
@mjshi


hmmm I think i get it. but I am still confused a bit, not sure where at thought lol. I'll try some stuff, I think you got me in the right direction. Thanks 😀


All I need to do is figure out how to do it with many opponents, two on the player's team and up to ten on the enemies; most likely going to have to write a script.


EDIT: So here is what i am going to try.


I am going to disable and remove the Attack command and guard command using a script, then i am going to add into the combat menu A B C and D


These will be skills masked as "attacks" A beats B, B beats C, etc. it will be based on the target, so once they pick the event does not finish until the target picks then it is resolved


I will write a common event that is a logic circuit to figure out how that all works, then i will have this event run when the skills are used; Enemies will be edited to pick, kind of randomly, which of the four to use.


I'll have it resolve into subtracting the real HP of the target but only if in a win condition. the text part "so and so picks A against so and so's B" will be posted to the general battle text log...


In essence what i want to try to do is create like different sword stances (Strike, Parry, Dash, and Dive) and resolve them like rock paper scissors.

Original thread: https://forums.rpgmakerweb.com/threads/rock-paper-scissor-attack-command.56785/