how to randomly pick a variable ?

Manco

Villager
Member
Joined
Feb 6, 2018
Messages
6
Reaction score
0
First Language
french
Primarily Uses
RMMV
Hello,

Excuse-me if I'm not posting on the right place.

So I'm a newbie and I'm trying to make a game to teach french language I want to do a mini game about preposition, but I'm stuck on variables

I did a common event that modify a variable. Then I have event 1 that launch this common event and when the player has contact with other events (2, and 3) this events must check if the variable is > 1. But my problem is if I modify a batch of variable, then it will modify all of them, when I want only one of them to be modified. I'm pretty sure it must be easyto do, but I can't see how to do it

So it looks like that
Common Event :

Modify variable (1..2) += Random 1...2
If Variable 1 = 1
I'm going ..... Paris
If variable 2 = 1
Are ..... happy ?

Event 1 :
Common event

Event 2 "to" :
if variable 1 > 1
Great !
Else No

Event 3 "you" :

if variable 2 >1
Great
Else No

Consequences --> When player touch event 2 and 3 he gots a good answher, when he should not
 

Bigkill321

Villager
Member
Joined
Jun 3, 2018
Messages
21
Reaction score
4
First Language
English
Primarily Uses
RMMV
I would use the single variable with the control variable in the common event and just modify both of them with random 1 to 2 (Only because I don't know if modifying a range changes all the variables to the same number or not). If you don't want the two variables to equal the same number I would than put an conditional branch in to make it so the numbers are re-rolled before finishing the common event. But a third option could be so the event 2 and event 3 work off the same variable so that for event 2 if variable 1 is 1 than great but if variable 1 is not 1 than bad, than have event 3 be if variable 1 is 1 than bad and if variable 1 is 2 than great.
Common Event:
Loop
Control Variables : #0001 Var 1 = Random 1..2
Control Variables : #0002 Var 2 = Random 1..2
If : Var 1 *= Var 2
Break Loop

End

Repeat Above

This will make it so you use two variables and make them not equal the same number.

Common Event:
Control Variables : #0001 Var 1 = Random 1..2

Event 2:
Select the Variable box on the left side and make it so its 1 and put the good stuff on that page of the event and than click new event page at the top of the event and check the Variable box on the left side and make is so it's 2 and put the bad stuff on that page of the even.

Event 3: Repeat event two but with the bad on the 1st page and good on the 2nd.

I feel like this one is a little easier to work with and is a little more organized.

But maybe I misunderstood your whole post but I think I got what you were asking
 

Manco

Villager
Member
Joined
Feb 6, 2018
Messages
6
Reaction score
0
First Language
french
Primarily Uses
RMMV
Thanks! with your help I find a way

What I want is when the player walks on an event ( "en", "à","sur" on the map).
If correct answer: Great + new question
If wrong answer: nothing
The NPC on the bottom of the map is only to launch and explain the game
Capture d’écran 2020-05-10 à 1.52.39 PM.png

I made a common Event to control the variables. Then I made a second common Event to insert the questions and various common events related to the regions to check if answers are correct (probably don't need to be common events).

I decided to use the YEP event region plugin, because when I was using normal events, the second common event was not automatically relaunching.

Common event 1 will control the variables
Modify variable 1 random
If V1 = 1

Modify v2 random

If V1 = 2

Modify v3 random

If V1 = 3

modify v4 random

Common event 2 will control the questions

Common event 1
If v1 =1
if v2 = 1
text 1
else if v2 = 2
text 2
if v1 = 2
if v3 = 1
text 3
else if v3 = 2
text 4

Common event 3, 4, 5 will be connected to the regions and relaunch the common event 2 it's "en", "à", "sur" on the map
Common event 3 is :
If V1 = 1
Great
Common event 2

Common event 4 is :
If V1 = 2
Great
Common event 2

Common event 5 is :
If V1 = 3
Great
Common event 2
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top