Nightblade50

Veteran
Veteran
Joined
Nov 10, 2016
Messages
2,175
Reaction score
4,286
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,940
Reaction score
14,562
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,286
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
82
Reaction score
107
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

It seems that I have to change the order with which I make the fantasy games on my bucket list, because the intended title is used as a story element in the first two games in the line, and somebody else might take the title for their own game because the term uses real words. I can't risk going over the apparent three year limit for registering trademark ahead of time.
I am interested in collaborations so if you like my art, hit up my messages! :wub
unknown.png

Making good progress with the second chapter. :)

Still work in progress.

(Real life, it is chronically the fourth chapter that I am making.)
constructionworkconcept.pngezgif-2-0acb620ecf8d.gifezgif-2-afeaf16ebb8d.gif "The Great Wall is great. But, most people can only be the slaves who built it, leaving their bones underneath that wall. They spent their whole life to build that wall and the empire, an empire that enslaves them." :kaoswt2: I'm just going to turn it into a modern-day sad tale.

Forum statistics

Threads
110,672
Messages
1,055,085
Members
143,795
Latest member
IrishEngineer13
Top