Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | GoGirlGaming |
For my game, I have functionality that whenever I want to instance something through the dialogue I write curly brackets at the beginning of the dialogue in the format of:
var dialogue = ["{scene_to_instance,argruments(including the variable_to_assign)}"]
The variable to assign to after the instance has been deleted is passed as a string and I was trying to map the string to a variable using a dictionary:
var variable_dic = {"global.dogName" : global.dogName}
But the problem is that global.dogName is passed as the value of global.dogName rather than the actual variable, so instead when I try to assign a value to that variable, it assigns the value to “global.dogName” in the dictionary.
This is a little confusing because it’s kind of hard to explain but basically I want to be able to assign a value to a variable stored in a dictionary but I don’t know how I’d go about doing that.
I’m having a hard tim figureing out what your poblem is;
In your example
var variable_dic = {“global.dogName” : global.dogName}
varible_dic[“global.dogName”] should contain the value of the varible global.dogName, does it not?
The other example:
var dialogue = ["{scene_to_instance,argruments(including the variable_to_assign)}"]
Would be a string (because it’s in quotes)
guppy42 | 2018-11-05 07:29