Help - Search - Members - Calendar
Full Version: Make Random Events
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
YamadaTaro
Can someone please teach me how to make a random events?

ex. when I talk to an NPC , he would say "He like blue color"
but' when i reload the game he might say "He like green color"
which will be select randomly when I talk to him,
Thanks in advance
Sizux
It is really easy to do. Make a variable, call it "RNG", then set it to a random number between 1 and x, with x being based on how probable something should occur. Then, make a conditional branch that checks if the variable "RNG" equals 1, 2, 3, ect. Under each of those cases, have the random thing occur. Using your example, it would look something like this:

CODE
Control Variables: [0001: RNG] = Random No. 1...3
     Conditional Branch: Variable [0001: RNG] == 1
        Text: I like blue
     Else
     Conditional Branch: Variable [0001: RNG] == 2
        Text: I like green
     Else
        Text: I like red
Branch End
Branch End


Hope that helps.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.