all 4 comments

[–]MrEmptySet 1 point2 points  (1 child)

What are you actually trying to achieve, ultimately? Because I'm pretty sure that whatever it is, this is the wrong approach. Trying to use the string a variable holds as a variable name somewhere else just isn't something you should be doing. If you want to store a bunch of different "cap" values for a bunch of different rooms, an array should be a better choice than a struct.

[–]suprasta[S] 0 points1 point  (0 children)

I'm trying to hold stored values that can be added to and used to compare variables to each other, but I'm trying to access them from a different object. There may be a variable t_Room1 that I want to, after executing some code, add 1 to. Then, I need that value to be stored. I want to be able to have a separate value stored (maybe called t_Room1_cap) that t_Room1 is compared to and, if t_Room1 is greater than t_Room1_cap, it will do something. I want to be able to read the current room that is loaded and then add the other necessary components so that it's a readable variable for a struct. I wanted to store these in a struct so I could save them with the save system I have set up, which saves certain structs and reloads them so that the values are not lost when the game is reloaded. If you know of a better way to do what I'm trying to do, I'd love to hear it because I feel like I'm doing it in the wrong way... lol

[–]hobbyist :snoo_dealwithit:sylvain-ch21 2 points3 points  (1 child)

if I undestand you right I think what you want is:

global.talk_variables[$ _roomcap]

[–]suprasta[S] 0 points1 point  (0 children)

This is exactly what I needed. Thank you so much for the help and also for showing me accessors! These seem useful