Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: dshad44 on August 22, 2017, 06:52:22 PM

Title: Randomize Answers, excluding the correct answer.
Post by: dshad44 on August 22, 2017, 06:52:22 PM
I'm trying to make a multiple choice game. You have three objects to choose from, and one of them is correct. The way you choose is that each object has an image texture assigned. You must choose based on the image being presented by the three objects.

Ultimately, there are many images in my Assets directory that I want to draw from and assign to the objects. I think the way I can randomize the images assigned is to use Send Random Event, and have multiple states in which a different material or texture can be assigned.

I can use Set Material or Set Material Texture for the object with the "right answer" directly, and then use Send Random Event to get randomized options for the "incorrect answers".

However, this doesn't keep me from being able to accidentally select the "right answer" and assign it if I use Send Random Event.  I would have to manually make sure that only the "incorrect answers" are part of my Send Random Event tree. But if I have to do that for each question, that's a ton of work!

Is there a better way to approach this?
Thanks in advance!
Title: Re: Randomize Answers, excluding the correct answer.
Post by: djaydino on August 22, 2017, 08:59:59 PM
Hi,
I think you want to look into arrays / array maker.

You can find several tutorials on the user tutorial wiki page (https://hutonggames.fogbugz.com/default.asp?W548)

or DataMaker and use xml/json
or a combination of the 2.

Depending on your game setup.

Title: Re: Randomize Answers, excluding the correct answer.
Post by: dshad44 on August 23, 2017, 03:32:32 AM
Ok, I'll start looking at some of these videos. Thanks again!