I want to make it so when I talk to a certain character, he has 10 possible responses. I know one way to do this is to set a random number variable and have a random response generated with a conditional branch series, but this may lead to the same response consecutively (if the same random number is chosen consecutively). What is the easiest way to setup an event so that when I talk to a character his response is always 1 out of the 10, and always something that hasn't been said before, provided the 10 haven't all been seen before? I want the conversation to always seem fresh. I could do it with self switches provided there were enough. Hard to explain....sorry
Easiest way to make "conversational event"
RPG Maker VXAce SupportTheoretical it would be possible to do with variables or general switches, but practically you would run out of switches fast even there.
The only way around this is scripts - you'll need a way to store which response was given before with scripted values.
There are several possible solutions to this, depending on what exactly you want to do.
1) there are several scripts that store text lines in external files, and I know of one that offers a random selection between those lines - sorry, I don't know which one that is.
2) you can use PK8's self data suite to store either more self-switches, or use self-variables or self-strings.
One more option, especially if you're using PK8's self-string storage to store the text messages:
You don't need to check the random line at the moment the player asks - you can alternatively randomize the entire sequence on first contact, then only count up the messages 1 to 10 on each contact, and trigger a re-randomization only when the count reaches 11.
That might save you a lot of switches and turn them into a single variable if you can store the text sequences in some order (like possible with the self-strings from the self-data-suite)
The only way around this is scripts - you'll need a way to store which response was given before with scripted values.
There are several possible solutions to this, depending on what exactly you want to do.
1) there are several scripts that store text lines in external files, and I know of one that offers a random selection between those lines - sorry, I don't know which one that is.
2) you can use PK8's self data suite to store either more self-switches, or use self-variables or self-strings.
One more option, especially if you're using PK8's self-string storage to store the text messages:
You don't need to check the random line at the moment the player asks - you can alternatively randomize the entire sequence on first contact, then only count up the messages 1 to 10 on each contact, and trigger a re-randomization only when the count reaches 11.
That might save you a lot of switches and turn them into a single variable if you can store the text sequences in some order (like possible with the self-strings from the self-data-suite)
that'll work perfectly i think, thanks
One way to do this is to make a module in the script section then create an array in that to hold your messages. Like this:
module MESSAGES ARRAY = ["message one", "message two", "etc"]endThen in the event you would do something like this:
Script: $game_variables[n] = MESSAGES::ARRAY[ARRAY.size].sampleText: :\v[n]You would have to do some additional conditional checking to see if a response is the same then choose a new response.
module MESSAGES ARRAY = ["message one", "message two", "etc"]endThen in the event you would do something like this:
Script: $game_variables[n] = MESSAGES::ARRAY[ARRAY.size].sampleText: :\v[n]You would have to do some additional conditional checking to see if a response is the same then choose a new response.
So I wouldn't need the above script? This seems easier.. sorry, can you just explain where the variable part comes in? I'm weak @ ruby...
All the variable parts comes in on an event page.
The $game_variables[n] is the variable that your message gets stored to where 'n' is the id of the variable you want your message stored in (equivalent to using the control variables command and using the set script and writing a string in there) . Then the text command gets the information stored in that variable (with \v[n] again the variable id you stored your message in) and displays it in the message window.
The part that says MESSAGES::ARRAY[ARRAY.size].sample will get a random element out of your array which then gets stored in the variable.
Hopefully this answers your question.
I have used a similar method in the game I am working on where I have a guy who has over 20 different responses he can use.
The $game_variables[n] is the variable that your message gets stored to where 'n' is the id of the variable you want your message stored in (equivalent to using the control variables command and using the set script and writing a string in there) . Then the text command gets the information stored in that variable (with \v[n] again the variable id you stored your message in) and displays it in the message window.
The part that says MESSAGES::ARRAY[ARRAY.size].sample will get a random element out of your array which then gets stored in the variable.
Hopefully this answers your question.
I have used a similar method in the game I am working on where I have a guy who has over 20 different responses he can use.
Original thread: https://forums.rpgmakerweb.com/threads/easiest-way-to-make-conversational-event.41301/