Name that note game (new to gdevelop)


#1

Hello! I’m new here, and have only been creating games for about six months. I started with Stencyl and got fed up with the constant error codes, so I’m trying to finish my series of games for my students here. I need to know how to make a random note (objects from a group) become visible, program the correct answer and hints related to that note, mark answers correct and incorrect, and then pull a new random note. I have 33 different notes that I want them to label twice each (going through all 33 before repeating), then give them a grade report to screenshot at the end.

My problem now is that I can’t figure out how to make random notes appear and disappear in the exact places I’ve put them. All of my searches are trying to convince me that random is only for numbers, and I know there is a way to write an expression for this. I even went through and renamed all of my note objects with numbers and still can’t make it work.

Once I have that figured out, I need to know how to compare an instance variable from whichever note object is randomly shown to an instance variable for the hints and only show the hint that corresponds to that note.

Any help is appreciated, and even more so if you can point me towards a resource that explains text expressions better than the wiki. :slight_smile:


#2

Hi!
Random is for numbers indeed, but you can apply the result of the “cast” to whatever you want.
If you named your “notes” with numbers, you can use “Create an object from its name” and call Random(32). If they’re named note_1, note_2, you should call: “note_” + Random(32).
Hope that’s clearer.

You will find instance variables in Common for all objects/Variables. You might need a “For each” event to compare all variables.


#3

Thanks for your response!

When I Create an object from its name, it asks for the name of the object, which I fill with Random(33) without quotes. It tells me “Cannot find an expression with the name: Random”. Is this an error to be ignored or is my syntax wrong?


#4

Well that red sure looks scary. :grin: No need to fear experimentation though… and if it doesn’t work, you know why.
You see the blue button is ABC, it means text is expected. Click on it and search “convert” to convert your numerical random value to an identical text string. The random mathematical function is available in the 123 button, to avoid any syntax issue.


#5

I went back to my original idea of doing different scenes and pulling them randomly, but now I have a whole new problem.

I need each scene to be produced no more than twice. When each scene has been used twice, it should no longer be pulled randomly. When all of the scenes have been used twice, then it should stop the random scene pull and go straight to the report scene.

Each scene has a variable for how many times it has been used. Each time a scene is pulled randomly, it adds one to that variable for that scene. My event tells it to pull a different scene if the one randomly pulled has a variable greater than 2. If all scenes have a variable greater than 2, change to “Report”. I don’t even know how to describe what that results in, but it’s definitely not working - it goes through a bunch of scenes really quickly and then shoots to the report. Obviously I’m missing something. Any help is appreciated!

Also, I wanted to upload my game file, but it says I can’t. I’d like you to be able to access it to help easier, but I’m not sure how.


#6

You can use this:


#7

Thanks! Hopefully this is the right file:
My Game


#8

Bumping this - does anyone have thoughts? Thanks!


#9

Link has expired, sorry.


#10

How is this:

https://drive.google.com/file/d/1_Vu8E6qKjC1E35hPdmgYAstdgY7aYZ_t/view?usp=sharing


#11

Hi,
I’m missing the graphics, but it seems to be working fine. I click on the graded button, it opens a random numbered scene and the timer starts counting.