Nightblade50

Veteran
Veteran
Joined
Nov 10, 2016
Messages
2,175
Reaction score
4,285
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,879
Reaction score
14,525
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,175
Reaction score
4,285
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

The Mad King of Neolithic
Veteran
Joined
Jan 2, 2021
Messages
80
Reaction score
81
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 Posts

Latest Profile Posts


Swag collecting in the new randomly generated area. Now the mini map also shows the randomly generated features... And even illustrates the whole "bubble" system" that I made to manage memory... Though that part's inadvertent. We'll just call that "the fog of war"... Yes, that's what we'll do. Nobody will be the wiser! :kaopride:
not me being not lazy for 5 seconds and drawing another char portrait (her name is hazel)
its_hazel.png
Been a while since the last time I made a song remix. Had a blast making this
One thing those jp developer still get wrong about boob physic is that... men's muscly hard pecs can jiggle too.
Definitely glad I haven't released a few of my plugins that are technically done. As I learn more, I find ways to make my code more efficient, and in one case so far, discovered an existing function that did EXACTLY what I created my own function to do.

Forum statistics

Threads
110,452
Messages
1,053,424
Members
143,541
Latest member
Neikoku
Top