Links to Rock Paper Scissors battle system tutorials - 2023

I've done some Googling myself but come up with nothing I've wrapped my hear around, yet. I also haven't wrapped my head yet conceptually around how Fire Emblem or Fate/Extra handle this on a dumbed down level.

I've played a couple games with variants of RPS (jan-ken-pon) systems and wanted to emulate this on an extremely basic level for a game where combat is not a focus.

Our esrtwhile creative director wants me to look into coding this system for light combat usage in our game.

I just began digging into and understanding damage formulas or applying states. According to some google searches there is a conversation almost every year since 2016 on this, and was an old RPGMaker MV tutorial on the concept, but the coding was only discussed at the theoretical level.

I'm using the Visustella plugins but I shouldn't even need to touch the Battle_Core to do this (where this could otherwise have been partly handled by Weapons Unleashed it appears)

At a basic level I'm trying to understand where to begin writing the following process

1) At the beginning of every turn, a variable is chosen, hidden from the player
2) The player inputs their command for Rock, Paper or Scissors. ,< ---- From my understanding this can be resolved entirely with element rates on the applied state for each of the three types.
3) Only once the player's attack command resolves, the state icons are applied to the enemies right before the attacks resolve.
4) From there each enemy type can either choose an attack off a variable or have multiple copies of each skill weighted to the appropriate attack types.
5) Optional: Some games let the protagonist comment a one-liner to guide the player to what they should pick if they want to intentionally win or lose. I think a common event can be called to handle this with the VZ plugins for battle events by just checking the variable generated in 1 before the player picks an attack.

This seems like it should take ten minutes for an experienced RPGMaker coder, but after setting the randomized variable I haven't the faintest idea on how to begin writing to ensure the common event seizes control from how battle turns are normally processed to ensure a hidden state is applied to the enemy actor before attacks resolve.

We can simplify this by assuming the player goes first and only change that up for more difficult fights. I've also seen games that were able to remove/add skills that increase damage or provide other benefits by equipping items that change the rock-paper-scissors attacks but limit the player to only upgrading one or two of these attacks. I assume more difficult enemies can have skills or other randomized states or variables that could on occasion negate an otherwise successful attack, then just scale the stats to where between 1 and 10 successful attacks win a player a given battle, oneshot cheat codes etc.

I didn't yet find any RPGMaker projects like the Variables Guide that are unencrypted to look at the code for this, but it's possible I didn't look hard enough. Can someone point me in the right direction? The Variables guide helped me successfully implement a fishing mini-game for our game, and I was hoping to see something at that college-textbook level of detail rather than having someone write the entire thing with screenshots out here.
I also haven't wrapped my head yet conceptually around how Fire Emblem or Fate/Extra handle this on a dumbed down level.
I have no idea how what you describe has anything to do with Fire Emblem.

The weapon triangle system in Fire Emblem is done super straightforwardly with weapon types having their own element and actors/enemies having the appropriate element rates set. The whole stuff with the player choosing R/P/S and applying states before skills and everything has no representation in any Fire Emblem game I've played.

Unless there's a Rock, Paper, Scissors mini-game in one of them before they hit the DS.

I'm using the Visustella plugins but I shouldn't even need to touch the Battle_Core to do this
Why do you say this? I can't think of any way to do what you're describing without plugins (unless you completely depart from the default battle system and event the entire thing).

3) Only once the player's attack command resolves, the state icons are applied to the enemies right before the attacks resolve.
To have something happen before the attack resolves, you'd need to use the VisuStella Battle Core notetag JS Pre-Start Action.

4) From there each enemy type can either choose an attack off a variable or have multiple copies of each skill weighted to the appropriate attack types.
You would need to use a plugin that completely re-codes how enemy action selection is done. Enemy actions are determined at the beginning of the turn, just like your selections for actors are.

Technically, they are done after the actors sequentially, so it's possible to make them take into account what actions you queued up for the actors, but there's no way they can react to anything like states that get applied once you get as far as an actor's turn actually starting.

Unless I'm misunderstanding what you're meaning...I really don't know what your intent is with the state that the actor is putting onto the enemy, nor what "choose an attack off a variable" even means.

5) Optional: Some games let the protagonist comment a one-liner to guide the player to what they should pick if they want to intentionally win or lose. I think a common event can be called to handle this with the VZ plugins for battle events by just checking the variable generated in 1 before the player picks an attack.
You can try, I'm not sure there's a timing window in the game engine that can execute a common event after an action starts but before it resolves, unless again it's coded in.

I'm a little lost as to why this is something you want to implement in RPG Maker. It's the kind of exercise a student would typically do directly in code (e.g. I wrote a Rock, Paper, Scissors game in my C++ class), not something you'd try to yank parts out of an existing battle system to rewrite to.

I think it would be easier to accomplish this using either code or events than the battle system.
I have no idea how what you describe has anything to do with Fire Emblem.

The weapon triangle system in Fire Emblem is done super straightforwardly with weapon types having their own element and actors/enemies having the appropriate element rates set. The whole stuff with the player choosing R/P/S and applying states before skills and everything has no representation in any Fire Emblem game I've played.
The weapon triangle is based on RPS though. Where rock beats scissors, scissors beat paper, and paper beats rock, FE has swords beat axes, axes beat lances, and lances beat swords. That's what he meant with that specific part, I think.

The difference is, of course, that the player can know what the enemy will be wielding, or try to influence it should the enemy have multiple weapons on hand.




I'm a little lost as to why this is something you want to implement in RPG Maker. It's the kind of exercise a student would typically do directly in code (e.g. I wrote a Rock, Paper, Scissors game in my C++ class), not something you'd try to yank parts out of an existing battle system to rewrite to.
If this is meant to be an SRPG, there's a much better engine for this sort of thing.
The weapon triangle is based on RPS though. Where rock beats scissors, scissors beat paper, and paper beats rock, FE has swords beat axes, axes beat lances, and lances beat swords. That's what he meant with that specific part, I think.
Could be. But as I said, that's all really easily replicated using elements. All the other mechanical details given in the first post are not representative of how Fire Emblem works, so I was confused by the comparison.
That's fine.

If I need to move the thread to Plugin support for VS to learn how to use the Pre-Action JS tags, I'm okay with this and modifying the subject line accordingly.

I had gotten the impression this could be evented entirely, and I might be overcomplicating the attempt. I've seen one example of something where this was already done by a game released at the end of last year and messed with what appeared to be a short proof-of-concept game as well:


This led me to believe this could be evented in battle with a series of conditional branches. My first thought was to just randomly assign states to actors that would only let full damage go through if the appropriate state was applied to the enemy actor which is what Rock the World appears to have done. Obviously using that method means the entire first turn is an issue, as well as ensuring the enemy has a state applied that is hidden from the player before an attack resolves.

The other example I saw didn't use SV sprites at all, and then would have the protagonist comment to themselves what the enemy actor is about to do out loud before the player selects a move.

I have access to the VS8 waves plugins, so yes, battle core is present and usable to clean up the functionality of this if I can study the documentation of the battle core (there was just a lot all packaged into that plugin at once, so I knew it was there but was easy to miss)
After reading the documentation for the VS8 plugin, it does look like the <JS Pre-Start Turn> should do what I want along with the Base Troop Battlers command.

In other words the appropriate functionality might be buried in the action sequences, so Turan is right that a plugin would need to be used to change up the battle system even to ask it to apply a state randomly to every troop using a variable between 1 and 3.

A similar but not identical function appears to be listed here:


So, the answer seems to be if I want to dive into this it's vital for me to dive into the JavaScript tutorials for RPGMaker. Alright, I can leave it at this until I can ask a more specific question in the plugin support forum.
I downloaded the game you linked to above, and it does not appear to work the way you described in your first post.

Admittedly, it's all sped up horrendously (which I think is quite ugly), but the skill you select places a state on yourself, not the enemy, to indicate what you chose. The same is true for the enemy's skill.

I don't see any indication of that happening before the skill resolves, nor of the enemy reacting to it or giving you any kind of ability to change your selection.

This system is simply done using a common event on each skill which applies your chosen state to you.

Then there's a troop event that runs at the end of each turn and has a ton of conditionals to figure out which combination of states are on the actor and enemy, and displays the results accordingly.
Thanks for your time and attention on the matter, I appreciate it even if my questions are a pain in the ass sometimes.

I was given the below code to maybe kludge into the Pre-Turn Start note tag (this was given to me just now bereft of context for RPGMaker MZ or VS8 and might be better served redone in chatgpt with more context and basic Javascript tutorials):

– while(true) { //Infinity loop to play over and over const player_1_value = Math.floor(Math.random() * 3) + 1; //Random number 1 - 3 const player_2_value= Math.floor(Math.random() * 3) + 1; //Random number 1 - 3 console.log(player_1_value); console.log(player_2_value); if (player_1_value === player_2_value) { console.log( "It's a tie!") } else if (player_1_value > player_2_value) { console.log( "Player 1 win") } else { console.log( "Player 2 win") } const repeat = prompt("Put STOP to stop game, any other character to play again"); //to stop game put "STOP" if(repeat === "N"){ break; } }

Given the above and the linked game, what would be your opinion for me to learn the best method to accomplish this as simply as possible? It would be entertaining but not strictly necessary to hint to the player how to win in advance of picking their stance and resolving attacks.

Again, want to reiterate I learn a lot each time you answer a thread and am pretty grateful for peeking at the example.
Any time you post code, you should use the CODE tags (the </> in the edit bar) to preserve indentation and brackets.

I mean...the code above is:
A - so divorced from RPG Maker that it doesn't make any sense in context. There's zero reason to even consider putting that into a notetag, it's just playing it out in the console.

B - not correct logic for Rock, Paper, Scissors. The way that's written, Scissors beats both Rock and Paper, and Rock doesn't beat anything.

I feel like this was previously asked above, but can you offer a bit more specificity on exactly what you're trying to accomplish?

If you're just learning JavaScript and implementing Rock, Paper, Scissors is a goal exercise of yours, then that doesn't (and shouldn't) have anything to do with RPG Maker.

If you are specifically trying to create a Rock, Paper, Scissors mini-game in RPG Maker, the above is not a good start to achieving it.

If you're trying to create a battle system with an advantage/disadvantage circle (you mentioned Fire Emblem in your first post), none of this has anything to do with that.

People are willing to help you, but I don't think anyone understands what you're trying to accomplish.
If you are specifically trying to create a Rock, Paper, Scissors mini-game in RPG Maker, the above is not a good start to achieving it.
No problem.

The above is what I would be trying to accomplish, I was asked to change the battle mechanics to this and I know there's multiple ways of doing it, but embellishment truly isn't necessary here so I was seeking the most straightforward way to accomplish it.

The event flow would at it's simplest still be:

1. Before the start of any given turn, determine the enemy resistances. Also disable normal attacks permanently to have this function solely through skills.
2. Optional: Hint to the player what the enemy weakness is during their turn (paper, rock, scissors)
3. Have the player pick 'paper' 'rock' 'scissors' skills. If the player's attack connects or ties, cancel the enemy attack. Otherwise resolve the enemy's attack.
4. Return to step 1 for the next turn.

It appears this can be accomplished without plugins through conditional branch spam, or with plugins quite elegantly to allow for extra functionality. But that's about as far as I got with my research. I do know the above can and often is spiced up with equipment that modifies each type of skill to do more damage or have some sort of utility.
The above is what I would be trying to accomplish, I was asked to change the battle mechanics to this
Okay - so have you done what I described pretty step by step above? When I said what that game you linked to was doing?

You should be able to replicate that without plugins or code.

1. Before the start of any given turn, determine the enemy resistances.
I'm not sure why this has to be done at this time, or why it's necessary. But it makes life harder.

2. Optional: Hint to the player what the enemy weakness is during their turn (paper, rock, scissors)
This would...need plugins to be done efficiently, and with or without them it makes the whole thing more complex.

Original thread: https://forums.rpgmakerweb.com/threads/links-to-rock-paper-scissors-battle-system-tutorials-2023.161266/