Getting a text from an object variable

Hey, I don’t mean like getting a text using the ToString function, to display the variable as as text object.

It’s more like,

If an objects variable “type” = 4 (out of like 10), then I can get the text to display that it’s a “creature.”

The alternative is to just do this manually for each type, but I was wondering if there’s an easier way to do this that I’m missing.

thanks so much guys!!!

Use a structure variable to store the number as the key and it’s text equivalent as the value. Then use VariableString(structureName[VariableString(type)]) (where type is the variable you mentioned in your post).

How do you create structure variables?

Declare it as a variable (I’ve done a global one here, but it’s the same for a scene or instance variable):


Access it this way:

image

Thanks, sorry I fell asleep.

So I played around with this and still can’t get it to work with an object’s variables.

For example a monster type will have a type variable, than sub variables as structure variables, but still can’t get the text to callback to the specific type.

Still have the CreatureType as a global structure. But instead of Variable(type), use monster.Variable(type),

Or is that not the problem?