Nightblade50

Veteran
Veteran
Joined
Nov 10, 2016
Messages
2,174
Reaction score
4,282
First Language
English, French
Primarily Uses
RMVXA
I am wanting to add a system to my RPG Maker XP game in which, whenever the player is traveling on the road and enters a new area, then a random event will possibly spawn on the road. The events will vary greatly (e.g., bandits trying to get money from you, a traveling merchant, etc.) I am not sure if this will need a script or if it can just be done by some complex common events. Anybody know how to do this?

EDIT: I don't know if it matters, but if it needs a script, it will have to be compatible with my other scripts: Ccoa's Universal Message System, Mobius Quest Journal, Zer0 Advanced Weather, CCTS, and Lycan ABS
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,269
Reaction score
14,274
First Language
English
Primarily Uses
RMMV
What is "a new area"? A new map? Different areas on the same map? How are you defining the areas?

It's likely that it can just be done using events, but we need to know the above first.

Will all the different areas have the same random events, or will they change from one area to the next?
 

Nightblade50

Veteran
Veteran
Joined
Nov 10, 2016
Messages
2,174
Reaction score
4,282
First Language
English, French
Primarily Uses
RMVXA
What is "a new area"? A new map? Different areas on the same map? How are you defining the areas?

It's likely that it can just be done using events, but we need to know the above first.

Will all the different areas have the same random events, or will they change from one area to the next?
I mean a new map. Sorry for not making that clear.

Certain areas might have different random events than others. Some areas will have none at all.
 

orochi2k

Just another RMXP user lost in Time.
Veteran
Joined
Jan 2, 2021
Messages
44
Reaction score
38
First Language
Chinese
Primarily Uses
RMXP
You don't need a script.
You can use an event that auto starts each time player get into the map, throw a random number to a variable and decide which one of the random events it's going to play, and then set up some other variable and switch accordingly.

For example, there may be 2 possible NPCs to appear in an area.
First, we set both NPC events up with each of them having a switch to control if they appear.
Then, we set up an auto-start event, throw a random number to a variable, if the variable is equal to 1, then we turn on the switch to let 1st NPC appear(but also turn off the other switch to make 2nd NPC not appear), if the variable is equal to 2, then we turn on the switch to let 2nd NPC to appear(and also turn off the first switch to let 1st NPC not appear.) At the end of the auto-start event, you just need to make it be erased. (So that it will reappear to do the randomization next time the player get into the map).

If you use more switches and variables you can make more complicated randomization.

The script is just there to make it easier to control. The logical flow is basically the same.
Unless you want to do some crazy things like I did to dynamically generate NPC with their own little AI to simulate what happens.
 

Latest Threads

Latest Profile Posts

Do you like to practice level design? I do hahahaha! It's not from a specific game, it's just some tests...Fase 1.png
I really need a better indicator of where you can jump up and down though I feel... otherwise I like how this turned out for the first part of the first dungeon of the game.
@Shaz needs to make a website for his plugins. (it can be done easily for free with google sites.) I can't find a database of them anywhere!
Dion2.jpg

testing #2

Forum statistics

Threads
109,128
Messages
1,042,382
Members
141,630
Latest member
Ocarina654
Top