Creating a multiple choice question game with arrays and UMG?

I need to make a multiple choice question game where the player presses the start button and is taken to a level where the question is displayed and below it are four buttons arranged 2x2 with four answers, one on each button. When the player presses the button with the right answer a correct graphic will display and then the next question will appear. If they press the button with the wrong answer, an “Incorrect” graphic will appear before moving on to the next question. I know I need to use arrays to store the questions and answers to get them to appear on the screen and buttons, but I don’t really know how to go about doing it and I also have no idea how to get it to differentiate between correct and incorrect answers. I have seen plenty of tutorials on how to do this using Unity and C#, but for this project, I have to use Unreal Engine 4.14. Any advice or instruction on how to set up the blueprints for the questions and answers would be greatly appreciated.

P.S.: I am quite new to blueprints, though I do understand some programming logic and the structure of blueprint classes.

I am interested in the same type of project. Any response to this inquiry?

Hello,

I have tried my hand at this. The first thing I did was to set up a question structure:

The next step is to setup a “design” in UMG designer:

At this point I made a variable for each post in the struct and call them Current + ‘StructVariableName’. I also made a Questions array which has the Question Struct as it variable type. All the text variable must be bound to its relevant text component in the designer. Here are both a list of the variables (left row) plus the first part of the blueprint:

Construct Event is used to set up some start values and other things. QuestionSetup is used to pick out the current question from the array and put it into the relevant text variables.

Here are the button events. When one of the buttons is clicked that buttons event node will fire, it sets the answer index and triggers the parse answer event:

Here is the last part, the ParseAnswer event. It will check the current answer and in this case just print some text to the log (corrent answer or wrong answer). Then it will trigger the next question setup (or quit if there are no more questions):

This is a quick and dirty example and hope it can at least give an idea how to develop this further. It is most probably not the best or fastest way to do this, but it gets the job done (so to speak).

Ask if there are any questions!!!

,

For your third picture, where you have QuestionSetup and Question List feeding into that GET block, what blueprint item are you using? I’ve attempted to find it with no success!

Thank you,

,

The QuestionList is an array. In the variables list click on the small icon next to the variable name.

Hey man,

On the 3rd image, COuld you shade any light on what that GET Node is, I Cant seem to replicate it, and its the only thing I have not been able to suss out :stuck_out_tongue:

Literally the only thing stopping me from completing this :slight_smile:

what that GET Node is

It’s a split struct - right click the Get node’s pin and Split

Perfect, Thank you. That was driving me nuts :stuck_out_tongue:

Hello, you can use my plugin to create choice based games. It doesnt require blueprint or c++ experience. You just need to create your sequencers and use the plugin to connect them each other with choices. Have a look at it from here;

https://forums.unrealengine.com/unreal-engine/marketplace/1564449-interactive-story-plugin

is there a video tutorial to follow to create this? im having trouble doing this

1 Like

I’m just going to say, I may have bought it, but I was pretty surprised to see a $30 price tag after follow the link🤦🏽

In future phrasing a sentence to potential buyers example:

“Hey everyone, I just finished developing a super cool plugin that takes the ease out having to learn a bunch of coding and other things, it’s located on the Unreal Engine Marketplace. I will say it’s $29.99, but that’s not so I can get rich, just so I can feed my pets and grab a coffee after spending a lot of time creating this to make life easier for the community. Lastly, I’d also like to let you know that there will be lots of tutorials, customer support is guaranteed, and I believe this plugin is not only going to help beginners, but save time for experienced users as well. :blush:

Mic drop…

1 Like

Thanks, I will keep that in mind :grin: