Random event Variables??

Sick-_-boys

Warper
Member
Joined
Jul 18, 2018
Messages
3
Reaction score
0
First Language
english
Primarily Uses
Other
Alright so I don't know much about variables, but I want to add a random event so if I interact with an event/object a number of times, let's say one out of 50 times I can get a secret item. I would say the best example of this is in Yume Nikki, if you turn the lights off and on a number of times you would summon Uboa. something like that... if that makes sense.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
554
Reaction score
229
First Language
english
Primarily Uses
RMMV
if u want a 2% chance you'd make the event like:
control variable: x "Percent" random 0 ~ 99
if variable is < 2
do special thing
else
do normal thing

if you want a set 50th interaction you make the event:
if variable = 49
do special thing
variable control: add 1 (or reset to 0 if you want this to be repeatable)
else
variable control: add 1
do normal thing

you can make as many "if" statements as you want, just make sure to turn on the "Else" branch for all of them
example could be:
control variable: x random 0~99
if variable < 40
give tin ore
else
if variable <70
give copper ore
else
if variable < 90
give iron ore
else
"nothing but dirt"
(and finish if off with) control switch: x = On

now that same percentile variable is also used for a different event to give 40% chance at tin, 30% being copper, 20% iron, and 10% chance at nothing
and can have all mining switches be turned Off from a different event like the event to leave the dungeon or a common event that runs when you sleep at an inn so it respawns
 
Last edited:

Sick-_-boys

Warper
Member
Joined
Jul 18, 2018
Messages
3
Reaction score
0
First Language
english
Primarily Uses
Other
if u want a 2% chance you'd make the event like:
control variable: x "Percent" random 0 ~ 99
if variable is < 2
do special thing
else
do normal thing

if you want a set 50th interaction you make the event:
if variable = 49
do special thing
variable control: add 1 (or reset to 0 if you want this to be repeatable)
else
variable control: add 1
do normal thing

you can make as many "if" statements as you want, just make sure to turn on the "Else" branch for all of them
example could be:
control variable: x random 0~99
if variable < 40
give tin ore
else
if variable <70
give copper ore
else
if variable < 90
give iron ore
else
"nothing but dirt"
(and finish if off with) control switch: x = On

now that same percentile variable is also used for a different event to give 40% chance at tin, 30% being copper, 20% iron, and 10% chance at nothing
and can have all mining switches be turned Off from a different event like the event to leave the dungeon or a common event that runs when you sleep at an inn so it respawns
thanks my dude!!!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top