RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[request] Making Random Q & A?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
I'm trying to figure out how to make a list of questions with answers, but randomize it.

right now I can ask questions like '2+2'..'4', with right/wrong answers, and can even set up a series of questions, like who wants to be a millionaire style where you only see the next question if you get the previous question right,

but how can I make a bundle of questions, like five, ten, or twenty questions, and randomize which one is asked?

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
You'd need to set up a system of variables and condition statements.

Have each question represent a number. In your event, have the event commands begin with creating a random number in a variable between 0 and X where X is the number of questions you have minus 1. (this is because 0 is the first number and not 1.)

So then after that, just have a series of conditional branches. IF 0 -> then ask this question ELSE -> IF 1 -> then ask this question ELSE -> If 2 -> etc...

Until you cover all questions.

If you have a ton of questions the game might lag a little bit at the time of picking which question if the number the variable chose is big because it has to check through each conditional to get to the right one. So if you have 30 questions and the variable picks 29, it has 29 different conditionals to check if the statements are true and false before it gets to the right one, likewise if you have that many and the variable that is picked is 3, then there's only 3 conditionals it has to run through which might process instantly and you'll notice no lag.

***
Rep:
Level 83
Kidfox70. It happens.
I think to add to the awesome reply by Grafikal, I would also show you a little something about how you should use your Conditional Branchs. What I'm going to show you is very useful and should always be used when dealing with more than one Conditional Branch. It's in the spoiler.

Spoiler for:
Conditional: Varbile Question: = 1
What is you're Mama's name?

Else

End

Contional: Variable Question: = 2
What is the color of you're Eye's?

Else

End

INSTEAD OF DOING THAT! You should do this:


Conditional: Variable Question: = 1
What is you're Mama's name?

Else
Contional: Variable Question: = 2
What is the color of you're Eye's?

Else

End

End

THIS WAY IS BETTER! It saves alot of work for the Game. Watch it though, for this only works certin ways. That is just an example for you, cause it's how you'd do it for you're random question thing. If the First Variabel isn't equal to one, then it has to be Equal to something else...which is where the game will check ( in the ELSE portion of the first conditional Branch). I hope I helped and was clear and good luck! :)
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Yeah, the way that Kidfox wrote out those conditionals is the way you should write it, however you have to watch then how many you make since each conditional will be indented a little more than the one before it. If you have a ton of conditionals, you're not going to be able to read any of them since the window of the event editor is only so large. I've had that problem before. It sucks.

***
Rep:
Level 82
We learn by living...
for large numbers of similar questions I was thinking of putting them in bundles inside common events and calling them as need be. I haven't tested that technique yet, but I have tested what you guys showed me and it's working like a charm, although the randomness implies the same questions can be asked indefinitely. It drove my play tester batty.  ;D

***
Rep:
Level 83
Kidfox70. It happens.
To fix that, you could use an other Variable to as a holder. To check to see what Question was asked last. Like the Variable hits a random number (Say 4). Then that number is stored inot the Holder Variable. The Conditional Branches read until they find 4, the question with in the 4 Conditional Branch is read. Next Question, Random Number hits (say 4...again...) The Conditional Branch reads until it finds 4. (Have an other Conditional Branch reading for the Holder variable) If it reads 4, then it randomizes again for a new number. If that made any sense...haha, then it would only fix the Event from reading a different question from the last one. Hm. Hm. Hm.

Maybe do it like this. For every question they get, give an Item. Question one gets a Potion, questiion two get's a Letter. Now while during this event, the player won't be able to use the Menu, so they can't chekc to see if they have an Item, also they won't know it's been given to them during the Event System, because no message comes up saying they have just recevied the Item, so the Player would never know. This way you'd be able to keep track of what question they've been given. It has to be an item that they wouldn't already have, other wise you'd have to take it all from them and then give them thier items back after the game, which could be done perfectly, but is a bit much (not really) to do for a simple random question system. If THAT made sense...haha, it would work perfectly and take care of everything. If you want to go that route I'll help. I'm not around RMXP right now so I can't play around and find a better way to sovle you're promblem sorry man. ^-^
I don't say bless you when people sneeze, cause i'm not God. Blessing people is his job. Lolo?