I have an NPC whose lines will stay the same for the most part (shopping options). However, I would like the first line to be a quote that cycles, preferably randomly. Is there a way for me to do this with the only first line, or do I have to make a separate event page for each "iteration" of the conversation?
Randomizing the first line of NPC dailogue
RPG Maker MV Supportyeah, you can do this pretty straightforwardly
Math.random generates a random number between 0 and 1, we multiply that by two, then apply Math.ceil (which rounds everything up, so 0.02 becomes equal to 1, and 1.02 becomes equal to 2), and then select dialog based on that.
Math.random generates a random number between 0 and 1, we multiply that by two, then apply Math.ceil (which rounds everything up, so 0.02 becomes equal to 1, and 1.02 becomes equal to 2), and then select dialog based on that.
Wonderful, thank you. I hadn't used this feature before!
While Restart's method does work, you can simplify the randomizing of the variable by using the 'Random' operand and just set it from 1 to what ever number you want (depending on how many dialogue options you have).
Where do I make it set from 1-10 exactly? within the variable?
edit: redacted
edit2: screenshot. just make another "if variable = n" statement for each RNG possibility.
edit2: screenshot. just make another "if variable = n" statement for each RNG possibility.
you can do it under control variables -> random
but I personally prefer to just use a script
Original thread: https://forums.rpgmakerweb.com/threads/randomizing-the-first-line-of-npc-dailogue.115916/