I am looking for a way to index a list of comments that the npcs call into for what they say so they don't get boring. Something like
Npc call random paragon, check list, check location ( because each area has different topic ) , call random array element string
Diplsy string.
This is so that I can make a simple list of things to say that applys to all npcs so I don't have to do complex message lists for each one.
While this could be done by a script, a lot of people simply use common events for that.
It's basically a matter of scope - how many variance do you want and how many lines are there?
For up to let's say 20 different lines per "area" it's easier to use a common event - if it goes much higher it would probably be easier to move the lines into a text file that is read by a script.
However, in all cases you'll need to give more info, especially how the script should know which NPC and Area to select the line for.
the whole speech randomization would mostly work with the external file as the Npcs would have a group of checks with the main topics as categories in a pyramid being:
location-- town name ||
paragon-- excellent, great, good, bad, terrible ||
statements pick random=
put msg
[port town[good[isn't the view lovely]]]
[port town[excellent[ i am so happy you kept this town as beautiful as it is now]]]
[port town[terrible[why did you let the city fall when you could have done something to stop it?]]]
this is how the system would find each message and i would be making a large list so that the rand system has many choices and the chance of repeat msgs would be reduced and only dependent on the players pc (pc at any point the pc can say i like 5)
i would also like it to be in an array setup so the calling becomes easier and i can just append new phrases and on have to rewrite the formula
rand(0..ary.lenght)
Id use an event that is on a random number generator and then for a specific amount of numbers each number has a different set of text.
i had attempted to do it as a common event but then i realized I'll be working with way to many quotes and would like to know how to set it as a module and get the calls to work like
arry [t, r,e,w,qw,f,g,h,j,y]
x= rand[arry.length]
put arry[x]
Old post, but for once i can actually help, not only ask 🙂
I simply just declare a number of (10) string variables (in sequense), in the map i want to use, I initialise them with an event set on paralell. Then on the NPC i just have a random event (0-9) that is intended to control the last digits.
Finally i have a text event on the NPC, set two out of three digits and let the random event control the last one...
It looks like this: \v[12\v[140]] (It is actually \v[12n] variable 140 controls the last digit (0-9)
Done!
Now i have ten different responses when i approach a NPC, can be expanded to many more, or different one for different NPCs.