Bascially, what I want to do is that at random times (ex. when youre grinding for exp and whatnot) an event plays which just shows some textboxes of characters speaking, and stops the conversation from ever being seen again but don't know how to do this without making a copy of each event in the map and making a switch for each conversation, I just want a way to do this without cluttering up the amount of switches I have and the autorun events in each map.
How do I do random conversations?
RPG Maker VXAce Supportthat usually has a converted quest system or some other trigger/handler system working behind the scenes to achieve that.
nothing is "random" and "in context" at the same time.... anything "in context" exists because the system was waiting for it to happen.
in the Pokemon series for example, the "random" calls from NPCs you get are all preloaded to play in order depending on many X objectives, such as lose X times, win X times, meet X many NPCs, have X many pokemon, etc.
those are counters always keeping tabs on your actions, and they can only trigger once, since the story only goes forward.
can be achieved without a plugin by clever use of labels and return calls in a common event, but it won't look pretty..... and you can get lost debugging it if you haven't mapped it out, AKA written it down in advance.
I had this rig set up for years now.
this highlighted part is the core logic: "call Go To Label with parameter [whatever is stored in variable], follow the code, return, and exit."
the parameter is usually the name of the actor speaking.
and this is one entry of the many subroutines that start with "This is label X", and end with "Return to sender"
this particular one handles any interactions with NPC guards to say random greetings.
this handles the "how to random?".
the "when to?" should be worked into the battle system, or with a parallel event (usually that modified quest system I mention)
when you figure out the "when?", you just set up the parameter in advance, and call the common event to do it.
nothing is "random" and "in context" at the same time.... anything "in context" exists because the system was waiting for it to happen.
in the Pokemon series for example, the "random" calls from NPCs you get are all preloaded to play in order depending on many X objectives, such as lose X times, win X times, meet X many NPCs, have X many pokemon, etc.
those are counters always keeping tabs on your actions, and they can only trigger once, since the story only goes forward.
can be achieved without a plugin by clever use of labels and return calls in a common event, but it won't look pretty..... and you can get lost debugging it if you haven't mapped it out, AKA written it down in advance.
I had this rig set up for years now.
this highlighted part is the core logic: "call Go To Label with parameter [whatever is stored in variable], follow the code, return, and exit."
the parameter is usually the name of the actor speaking.
this particular one handles any interactions with NPC guards to say random greetings.
this handles the "how to random?".
the "when to?" should be worked into the battle system, or with a parallel event (usually that modified quest system I mention)
when you figure out the "when?", you just set up the parameter in advance, and call the common event to do it.
Hey! Just read through this, what exactly does this do? I'm still extremely new to vx ace and I don't know what these do even with your explanations.
Adding another question, are these for in-battle text messages or roaming ones? Cause the ones I'm trying to add just pop up while you walk around the map.

this is for managing recruitable NPCs in a guild, where no actual events exist in the map file.
everything is generated dynamically, by name... so, *upon* the interaction with any event, that event (all of them, since they're all copies) sends it's name to this manager and the dialogue plays like usual.
the last bit, I added after the fact to use this system (since I have it!) to handle guards from every city, since they don't say much. I have yet to tie this event back to the map where the actual interaction will happen, with an actual event (so, this, but 'the other way around')
for "walking around the map", you fall into what I said earlier: that "walking around" is usually a trigger event watching you take X many steps.
the handling of it would be irrelevant... you can use this system, or actual individual dialogues.
the problem is breaking the normal flow of the game that is structured, to play something off cue, "whenever" it may happen.
well... that "whenever" is never random, it's usually you making it to an objective you never knew about, usually watched by a parallel event, or a hidden quest system.
try getting that parallel event to work, with something like this:
set a variable (any variable, doesn't matter) to random number.
when that variable is over 60, a popup will trigger.
immediately after, reset that variable to 0.
everything in that structure can be changed for another operation depending on the effect you want... but that's the basics: set the target and wait for it... when it comes, something happens.
you can then redirect that to another common event, or within the same event back and forth with labels, like I showed you.
for the "never happens again" part, you can use another variable counting up.
when it goes from 0 to 1, you trigger, and set it to 2.
the main loop will keep ticking until a random time where it will put that 2 to 3.
the next trigger will see that 3, play, and set to 4.... every 2 notches, you trigger.
all of that can be put within the same event with conditionals wrapping each dialogue, one after another, since a variable can only ever be 1 value at a time.
everything is generated dynamically, by name... so, *upon* the interaction with any event, that event (all of them, since they're all copies) sends it's name to this manager and the dialogue plays like usual.
the last bit, I added after the fact to use this system (since I have it!) to handle guards from every city, since they don't say much. I have yet to tie this event back to the map where the actual interaction will happen, with an actual event (so, this, but 'the other way around')
for "walking around the map", you fall into what I said earlier: that "walking around" is usually a trigger event watching you take X many steps.
the handling of it would be irrelevant... you can use this system, or actual individual dialogues.
the problem is breaking the normal flow of the game that is structured, to play something off cue, "whenever" it may happen.
well... that "whenever" is never random, it's usually you making it to an objective you never knew about, usually watched by a parallel event, or a hidden quest system.
try getting that parallel event to work, with something like this:
set a variable (any variable, doesn't matter) to random number.
when that variable is over 60, a popup will trigger.
immediately after, reset that variable to 0.
everything in that structure can be changed for another operation depending on the effect you want... but that's the basics: set the target and wait for it... when it comes, something happens.
you can then redirect that to another common event, or within the same event back and forth with labels, like I showed you.
for the "never happens again" part, you can use another variable counting up.
when it goes from 0 to 1, you trigger, and set it to 2.
the main loop will keep ticking until a random time where it will put that 2 to 3.
the next trigger will see that 3, play, and set to 4.... every 2 notches, you trigger.
all of that can be put within the same event with conditionals wrapping each dialogue, one after another, since a variable can only ever be 1 value at a time.
I'd go about doing this by setting up the following.
Variable1:StepsCurrent, Variable2:StepsGoal, Variable3:Randomiser, Variable4: DebugCounter, Variable5:SwitchArray
Event1:GameStart, Event2: ParrallelProcess(per Map)
CommonEvent1:IdleChatter
So yeah,
I'd compress all the switches into a single variable using arrays.
- You can find array script calls here Script Call Collection for VXAce, ask away if you have any array related questions, i've become quite proficient at using them.
- Specifically you'd be using these script calls, (Push 0s per conversation later Set to 1 when used)
The first event would run once at the start of the game, then I'd have a single ParrallelProcess event on every map conversations can occur that checks for the player's step count.
- Im sure there's a script that would call a common event when step count reaches X, but this is the only way I know, otherwise I'd have to ask around for it. Either way, my test doesn't seem to have any lag related problems from constantly running this step count checker
Also, @gstv87 using (Random No. n...n) in conjunction with step count you can produce a random result, if you're going to say that even this script call isn't random... then allow me to introduce you to a google seach of the true randomness of quantum mechanics. Apologies, I read "nothing is random" and went on a rant before reading "and in context"...
Variable1:StepsCurrent, Variable2:StepsGoal, Variable3:Randomiser, Variable4: DebugCounter, Variable5:SwitchArray
Event1:GameStart, Event2: ParrallelProcess(per Map)
CommonEvent1:IdleChatter
So yeah,
I'd compress all the switches into a single variable using arrays.
- You can find array script calls here Script Call Collection for VXAce, ask away if you have any array related questions, i've become quite proficient at using them.
- Specifically you'd be using these script calls, (Push 0s per conversation later Set to 1 when used)
Code:
# Script Calls
$game_variables[ID] = []
$game_variables[ID].push(Value)
$game_variables[ID][index] = Value
# Conditional Branch Script Call
$game_variables[ID][index] == Value
# Note: Index starts from 0,1,2,...
The first event would run once at the start of the game, then I'd have a single ParrallelProcess event on every map conversations can occur that checks for the player's step count.
- Im sure there's a script that would call a common event when step count reaches X, but this is the only way I know, otherwise I'd have to ask around for it. Either way, my test doesn't seem to have any lag related problems from constantly running this step count checker
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-do-random-conversations.170995/