RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RM2K/3] Rock/Paper/Scissors

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 84
puking up frothing vitriolic sarcastic spittle
This tutorial will allow you to create a Rock/Paper/Scissors minigame. This should work in all the RPGMakers, but I will set this up for RM2K3 because I know it works there.

First, make a variable and call it "Opponent Choice". We are going to assume that:

1 = Rock
2 = Paper
3 = Scissors

The basic idea is to set the "Opponent Choice" variable to a random number and then check it against the choice the player makes. To do that, we set up the event like this:

Code: [Select]
Variable [xxxx: Opponent Choice], Set Random (1-3)
Show Message: "What do you want to choose?"
Show Choice: "Rock", "Paper", "Scissors"
If Choice = "Rock" Then:
   If Variable [xxxx:Opponent Choice] = 1 Then
  Show Message "You chose Rock! The opponent chose Rock! The game is a tie!"
  <Whatever happens if you tie>
   End
   If Variable [xxxx:Opponent Choice] = 2 Then
  Show Message "You chose Rock! The opponent chose Paper! You lost the game!"
  <Whatever happens if you lost>
   End
   If Variable [xxxx:Opponent Choice] = 3 Then
  Show Message "You chose Rock! The opponent chose Scissors! You won the game!"
  <Whatever happens if you win>
   End
End
If Choice = "Paper" Then:
   If Variable [xxxx:Opponent Choice] = 1 Then
  Show Message "You chose Paper! The opponent chose Rock! You won the game!"
  <Whatever happens if you win>
   End
   If Variable [xxxx:Opponent Choice] = 2 Then
  Show Message "You chose Paper! The opponent chose Paper! The game is a tie!"
  <Whatever happens if you tie>
   End
   If Variable [xxxx:Opponent Choice] = 3 Then
  Show Message "You chose Paper! The opponent chose Scissors! You lost the game!"
  <Whatever happens if you lost>
   End
End
If Choice = "Scissors" Then:
   If Variable [xxxx:Opponent Choice] = 1 Then
  Show Message "You chose Scissors! The opponent chose Rock! You lost the game!"
  <Whatever happens if you lost>
   End
   If Variable [xxxx:Opponent Choice] = 2 Then
  Show Message "You chose Scissors! The opponent chose Paper! You won the game!"
  <Whatever happens if you win>
   End
   If Variable [xxxx:Opponent Choice] = 3 Then
  Show Message "You chose Scissors! The opponent chose Scissors! The game is a tie!"
  <Whatever happens if you tie>
   End
End

In order to make it more interesting than this random model is then you could always "weight" the random assignment to make an opponent prefer a particular choice over the others (i.e. add strategy to the game). For instance, you could make it so muscular types prefer Rock and so scholarly types prefer Paper, meaning that the player can make a good guess based on reading the characters personality. That, however, is outside the scope of this tutorial!