I'm trying to create a app similar to BitLife with their random disease system, but I'm having complications getting a random disease from my nested dictionary, since I'm going to have other random disasters rather than diseases. Does anyone know how to get a random key form my dictionary?
I've not seen BitLife before, but from your description I suggest a different dictionary structure where the disaster name is the key (sickle cell anemia, auto accident, dog bite, ...) and you add an extra attribute to the disaster categorizing it as disease/accident/weather/... in addition to your Happiness and Health modifier values.
You can keep a separate dictionary mapping disaster categories into image file names.
i get this error when trying to run the procedure with the dictionary
You must be testing using iOS.
Let's see if AI2 supports dictionaries yet under iOS:
It looks like they are supported.
You might have some empty sockets in that procedure?
Show us.
I left some empty sockets in my sample dictionary of Disasters.
I hope you removed or filled them?
Here's debugging help:
Single step through your blocks using Do It, to trace all the data.
You might have to drop copies of procedure parameters into global debug variables to leave a trail for Do It.
thank you, fixed!