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,473
Reaction score
10,894
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,597
Reaction score
13,392
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 Profile Posts

imgur sure is getting weird, one day I lose gradually all my images, the other I get them back randomly and then again they disappear again.
Despite OPT2 praise it still has some strange stories in it. Lady Mikka is trying to work herself to death because of guilt. Guilt over what? ¯\_(ツ)_/¯ So instead of finding a NPC to have a heart to heart with her they decide the cure is a new kimono. So when she drops dead she'll at least be well dressed. I haven't even got to the strange part yet.
Did so much work on the game today. I wish I could post it all in this status update but there is a character limit of course haha. I thought about making a topic for updates, though... maybe.
The most recent sign that I am old. I have done martial arts for over 4 decades. Never HAD to stretch out. Good, of course, but never required. Was doing some kicks in the kitchen because, why not, and I felt a pop in the back of my thigh. Now I am limping around. Gotta love getting old.
One of the biggest perks of being fluent in English is how many new and interesting recipes I am able to find and try out that I would have hardly come across if I just spoke my mothertounge :3

Forum statistics

Threads
131,683
Messages
1,222,229
Members
173,435
Latest member
TheAmplifier
Top