Pick random object and show it as text ..

Hi

Newbie here again.
So, how to do that kind of thing, that game pick random object, show it as text like “Pick up object X” And then player should select right object.

Moi!

You can do it with variables.
Begin of the scene ----> Do= Random (10) to Variable Objects
When Variable Objects is =Max (0,1), Trigger once -----> Do=“Pick up Object X” To the text of TEXT
When Variable Objects is =Max (1,2), Trigger once -----> Do=“Pick up Object Y” To the text of TEXT
When Variable Objects is =Max (2,3), Trigger once -----> Do=“Pick up Object Z” To the text of TEXT
Etc…

And if variable is= Max(0,1) and player click X object ------> Do=“You picked right object!” To the text of Text.
Etc…

I think that can be done different ways but I think that works too :slight_smile:

Thank you, have to try that!

Sorry, but one question, how I add that “Random (10) to Variable Objects”. I didn´t find any random etc?

Markus

You can find the Random function in the expression editor under math functions.
When you create a variable action there is a button at the right side of the input field.

There is “Other functions” when you click Expression sign. You find Random there, but you can write it like that “Random (write here number of the objects what player have to pick in your game, example 10) to variable Objects” It give you a random number between 0-10.

Thank you alot! :slight_smile: It worked!

Basic tutorial was easy. Variables is more tough to learning, when I suck on programming. But maybe step by step. :slight_smile: