Random enemy encounters?

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hello!

I am fairly new to RPGMAKER Mv and I had a question that google didnt seem to be able to answer for me. Any information you can provide is extremely appreciated as it currently has me stuck until I get past it. My question is:

I have created 100 "troops" each consisting of one enemy to fight. I want to make it ask you if you would like to fight, then if you respond yes it will start a fight. This fight needs to be one of the 100 created troops however I want it to be completely random which one you end up fighting. I currently know how to set up everything and cause it to open a fight however it only opens the same enemy each time. So basically you fight 1 random boss from that pool of 100 each time you go and accept the fight. is this possible?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Only with scripting I'm afraid, as you will need to change how the battle start command works to have it randomly select from your troops.

Though, if you don't mind redoing your setup a little, I think there might be a plug-in which lets you specify one enemy as a placeholder for other enemy types. I used a script like that when I wanted random undead for a zone in my game in ACE, and I'm sure there is a similar one for MV.

I've moved this thread to Plug_in Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
@xTrentx @bgillisp Actually you wouldn't need a plugin for this. Make a variable that will pick a random number from, let's just say, 1-100. Then have the battle processing pick the troop from that variable and what ever number it picked will be the troop ID that you will battle.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
That's false though if they are using random battles, as there's no way to call a save to variable command the same time the random battle is called. You might be able to get cute with parallel process to have a variable change every 60 frames or so, and then use that, but that's about the only way.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
Only with scripting I'm afraid, as you will need to change how the battle start command works to have it randomly select from your troops.

Though, if you don't mind redoing your setup a little, I think there might be a plug-in which lets you specify one enemy as a placeholder for other enemy types. I used a script like that when I wanted random undead for a zone in my game in ACE, and I'm sure there is a similar one for MV.

[move]Plug_in Requests[/move]
Thank you for the help! Any idea what plugin ill need? Im relatively new so im still figuring things out
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
@xTrentx
It might not need a plugin at all, but that depends on the difference discussed above:

Do you want a randomly started fight that then chooses a random enemy (note the two times random here), or do you want to start a fight at a specific moment and just have the enemy selected at random? Because you mention selecting a boss...

if it's the first case (you don't know when the fight will happen) then you'll need a plugin, if it is the second one (you start the fight at a specific moment) you can use the evented solution described above.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
@xTrentx
It might not need a plugin at all, but that depends on the difference discussed above:

Do you want a randomly started fight that then chooses a random enemy (note the two times random here), or do you want to start a fight at a specific moment and just have the enemy selected at random? Because you mention selecting a boss...

if it's the first case (you don't know when the fight will happen) then you'll need a plugin, if it is the second one (you start the fight at a specific moment) you can use the evented solution described above.
@Andar
My goal is to basically create a button on the screen then when you hit it, it will say "yes, or no" Once you select yes, I want a random fight to begin.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,933
Reaction score
1,326
First Language
English
Primarily Uses
RMMV
@xTrentx But is this happening on the map when interacting with an event or is this in battle?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
My goal is to basically create a button on the screen then when you hit it, it will say "yes, or no" Once you select yes, I want a random fight to begin.
Then this is not a random encounter. Random encounters are ones that are set up on map properties and are not related to events on the map. You want a fixed encounter, but a random troop.

@Uzuki has given the correct instructions - set a variable to a random number between 1 and 100, then use Battle Processing and use that variable to determine the troop.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
Then this is not a random encounter. Random encounters are ones that are set up on map properties and are not related to events on the map. You want a fixed encounter, but a random troop.

@Uzuki has given the correct instructions - set a variable to a random number between 1 and 100, then use Battle Processing and use that variable to determine the troop.
@Shaz exactly. How exactly do I do that though?
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
@xTrentx @bgillisp Actually you wouldn't need a plugin for this. Make a variable that will pick a random number from, let's just say, 1-100. Then have the battle processing pick the troop from that variable and what ever number it picked will be the troop ID that you will battle.
@Uzuki how would I go about that exactly? Sorry im still new and coding isnt something im very familiar with.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
Two people have now given you the instructions.

Use Control Variables to set a variable to a random number between 1 and 100.
Use Battle Processing and choose the Variable option rather than the specific troop option, and enter the variable that you just set to a random number.

There is no coding. It is all done with event commands.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
@xTrentx
I strongly suggest that you follow the link to the starting point in my signature and take a few weeks to work through the basic tutorials there, because you don't even have the basics of using the makers if you didn't understand the instructions so far.
Here is a more detailed solution:
1) make an event on the map, name it "arena" or "trainer" or whatever - your battle will start when you interact with that event.
2) make sure the priority is "same as" and the trigger is "action button" and give it whatever sprite you want to be able to find it on the map.
3) doubleclick on the content area, select control variable, give it the name "random 1-100" or so and set the command to give a random number between 1 and 100 in that variable
4) doubleclick again, go to the third page, select battle processing. Then select "by variable" and set the variable as the one you made in the previous command.
5) confirm everything with OK

Finished.
Whenever you go to that event on the map and trigger it with action button, it will start a fight with a randomly selected troop between the two limits you set as the ID.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
Although, if you want to ask the player first if they want to battle, and only battle if they say yes, you will want to add a Text command first, followed by a Show Choices command. Then put all the commands for the variable and the battle into the "yes" branch.

Your event will end up looking something like this:

Code:
Text: Do you want to fight?
Show Choices: Yes, No
  When [Yes]
    Control Variables [0001: Random Number] = Random Number 1 .. 100
    Battle Processing: Variable [0001: Random Number]
  When [No]
End
If you want the game to continue if the player battles and loses, in the Battle Processing command, check the Continue When Lose box (or something similar to that wording).
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
Two people have now given you the instructions.

Use Control Variables to set a variable to a random number between 1 and 100.
Use Battle Processing and choose the Variable option rather than the specific troop option, and enter the variable that you just set to a random number.

There is no coding. It is all done with event commands.
I misunderstood. My apologies.
Im going to try and incorporate it now.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
@xTrentx
I strongly suggest that you follow the link to the starting point in my signature and take a few weeks to work through the basic tutorials there, because you don't even have the basics of using the makers if you didn't understand the instructions so far.
Here is a more detailed solution:
1) make an event on the map, name it "arena" or "trainer" or whatever - your battle will start when you interact with that event.
2) make sure the priority is "same as" and the trigger is "action button" and give it whatever sprite you want to be able to find it on the map.
3) doubleclick on the content area, select control variable, give it the name "random 1-100" or so and set the command to give a random number between 1 and 100 in that variable
4) doubleclick again, go to the third page, select battle processing. Then select "by variable" and set the variable as the one you made in the previous command.
5) confirm everything with OK

Finished.
Whenever you go to that event on the map and trigger it with action button, it will start a fight with a randomly selected troop between the two limits you set as the ID.
Thank you for all the information. I will be completing those tutorials this morning. It should give me a better understanding of some of the programs features.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
I will be completing those tutorials this morning.
That brought a smile, because you obviously have no idea of how many and how expansive the tutorials I linked are.
NO ONE can learn the engine in one day. It would be a problem to just read those tutorials in a single days (most people would need several days to read through all of that), and you can't learn the engine by reading.
You need to work through those tutorials, recreating your own tutorial game while following their instructions step for step.
On average, most people (investing a few hours only each day because they need time for school or work) will need a month on average to work through all those tutorials...
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
@Andar 's right. I only skimmed them then attempted to make a game. 4 days later I started over, as what I had was grade A garbage. Though did I go back to them? Nope. I shoveled out something for the 2014 IGMC instead, then started THAT over again once the IGMC was done.

In the end I think I started my project over 4 times, the 5th time I got it finished. Took 8 months to get to that point though.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
That brought a smile, because you obviously have no idea of how many and how expansive the tutorials I linked are.
NO ONE can learn the engine in one day. It would be a problem to just read those tutorials in a single days (most people would need several days to read through all of that), and you can't learn the engine by reading.
You need to work through those tutorials, recreating your own tutorial game while following their instructions step for step.
On average, most people (investing a few hours only each day because they need time for school or work) will need a month on average to work through all those tutorials...
I understand. I didnt mean all in one day. I will be doing tutorials periodically as I have the free time. I appreciate the advice and tips so far.
 

xTrentx

Villager
Member
Joined
Oct 14, 2018
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
@Andar 's right. I only skimmed them then attempted to make a game. 4 days later I started over, as what I had was grade A garbage. Though did I go back to them? Nope. I shoveled out something for the 2014 IGMC instead, then started THAT over again once the IGMC was done.

In the end I think I started my project over 4 times, the 5th time I got it finished. Took 8 months to get to that point though.
wow, Yeah i certainly dont want to do that.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

"You can thank my later", "But you haven't done anything", "Well, that's why ..."
Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

Forum statistics

Threads
105,884
Messages
1,017,238
Members
137,608
Latest member
Arm9
Top