Is there a way to randomize things in RPG maker games?

Joined
Dec 2, 2022
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
I'm basically asking a couple things.

Is there a way to randomize moves that are performed what you choose an ability in battle? (Basically one ability a character has can have a few different things that can happen.)

Is there a way to randomize whether a move does damage to an enemy or does damage to you? (Move has a chance to damage you instead of an enemy.)

Randomize items in chests?

Randomize items on maps? (Collectable items needed for progression.)

Thank you!
 

ThreeSixNine

Veteran
Veteran
Joined
Jan 22, 2019
Messages
541
Reaction score
455
First Language
English
Primarily Uses
RMMV
Here is one way to randomize items in a chest:
1680397554581.png

This is a common event that awards a random item between items 1912 - 1930 in the database.

-EDIT-
I failed to notice that this question is for VXAce, but as Andar stated below, it is definitely possible.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,487
Reaction score
10,906
First Language
German
Primarily Uses
RMMV
yes, either control variable: random number and then checking the result with conditional branch
or using ruby script
 
Joined
Jul 12, 2020
Messages
583
Reaction score
322
First Language
English
Primarily Uses
RMMV
Hello! I will try to address everything you asked for in 1 post.

But essentially, you will always be using the case of Control Variable with Conditional Branches in your Event Commands, and going to "Random" at the near bottom of that variable box.


1)Battles:

For a skill that allows something random to happen, create a Skill that appears in your fighter's choices in the battle menu. (The name of the random-based Skill). Once you make that skill you're going to Link that skill to a Common Event. You have the option to do that in your little Traits Box at the very end on the right side.

What you're really going to do is make several other Skills. (Consider these what "could" happen).
Now, use your linked Common Event, and Control a Variable in such a manner that if the Variable is a random number, then it will perform the skills based on the conditional branches of those Variable Values. I can go into more explanation for this if you want, but that is the general idea.



2+3) Randomized Items:

Just like before, you are going to use Control Variable and Conditional Branches. Simply event those events to where if the player interacts with them, a controlled variable randomizes, and picks a random value. Then set those values as needed using Conditional Branches to give you the items that are randomized under those branches.


Hope that helps!
 
Joined
Dec 2, 2022
Messages
50
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Hello! I will try to address everything you asked for in 1 post.

But essentially, you will always be using the case of Control Variable with Conditional Branches in your Event Commands, and going to "Random" at the near bottom of that variable box.


1)Battles:

For a skill that allows something random to happen, create a Skill that appears in your fighter's choices in the battle menu. (The name of the random-based Skill). Once you make that skill you're going to Link that skill to a Common Event. You have the option to do that in your little Traits Box at the very end on the right side.

What you're really going to do is make several other Skills. (Consider these what "could" happen).
Now, use your linked Common Event, and Control a Variable in such a manner that if the Variable is a random number, then it will perform the skills based on the conditional branches of those Variable Values. I can go into more explanation for this if you want, but that is the general idea.



2+3) Randomized Items:

Just like before, you are going to use Control Variable and Conditional Branches. Simply event those events to where if the player interacts with them, a controlled variable randomizes, and picks a random value. Then set those values as needed using Conditional Branches to give you the items that are randomized under those branches.


Hope that helps!
Thank you! This is going to be super helpful!!

Could you go into more detail on the battle randomizer though? I'm not sure how to link skills to common events. :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
23,600
Reaction score
13,396
First Language
English
Primarily Uses
RMMZ
Connecting skill to common event.

Make your common event, or at least name it, so that you can link to it.
Select a skill slot on the skill tab in the data base.
Click on the Effects box on the right hand side.
Select tab 4
At the bottom select Common Event
Select your common event from the list which then shows.
 
Joined
Jul 12, 2020
Messages
583
Reaction score
322
First Language
English
Primarily Uses
RMMV
Thank you! This is going to be super helpful!!

Could you go into more detail on the battle randomizer though? I'm not sure how to link skills to common events. :)

Sure, I will show you with pictures because I like pictures!
Skill setup.png
Here is how you would make that battle skill.
Go to your "Skills" tab under the main settings in your RPG Maker engine. (It is the wheel cog icon).

Click on "Effects" and go to "Other" like I show in the picture. Go to Common Event, and select it. You just linked the common event to this skill.
What's going to happen is that when this Skill is used during battle, it's going to run that Common Event's code.

In order to play with that, go to your Common Event that you just linked under the "Common Events" tab in the main settings, and use that linked Common Event to look something like this:

variable setup.png


[You will be using a Variable under Control Variables, and pick Random...then set your range. In this example, the variable is going to randomly select between the values 0,1,2,3, and 4....notice that is a total of 5 choices.


setup.png

As you can see, the game will run this code when you use your Randomness Skill, and based on what the random value of the variable is, you can Force Action a Skill onto a target, or anything really. Notice it will only do 1 skill because the skill can only be 1 value, and my conditional branches are setup to where it only does 1 skill under the branches.


Hope that helped!
 

Latest Threads

Latest Posts

Latest Profile Posts

Hamburger!? Yeeah.
I love it when the approval queue is 80% spammers. Makes it so fast to power through!
I found some inspiration and have started work on a Point and Click style exploration game in a dead mall. I am hopefully going to push MZ in some unexpected directions. I always love seeing the engine do things that folks might not expect. Its good to have found some direction. Thanks for the support a few weeks back when the writers blog was hitting heavy.
Don't you want your heroes or monsters to lose some of their MAXHP or MAXMP? Don't you?
Really, why wouldn't you? :p
Yeah, it's gonna get worse after every hit they take, but so what?
Aren't they courageous fighters? Or stupidly brute mobsters?

Forum statistics

Threads
131,730
Messages
1,222,706
Members
173,475
Latest member
georgino15
Top