Since GML is still a dynamic language, if you know that there is a variable of kind on an instance, you can read it from anywhere via direct. However, YoYo Games had made a fairly reasonable decision of not writing a GML->JavaScript compiler (or interpreter) in JS itself, which meant that the interpreter-related functions had to go, variable_ functions included.Īnd so it would have seemed like this functionality is now gone for good. Search for jobs related to Jmeter save responses to a file not working or hire on the worlds largest freelancing marketplace with 22m+ jobs. GM:S brought nearly countless additions to GameMaker, including compilation to JS for making HTML5 games with the program. Older versions of GameMaker only ran in interpreted mode on Windows and had a set of variable_local_ and variable_global_ functions, which could be used to variously work with local (instance) and global variables accordingly. Obviously, there are also valid use cases, which is why this post was written. or reconsider if and why do you need to do that at all. If you intend to make "a reference" to a variable, you could either wrap it into a 1-element array. names input by user), you might want ot use ds_maps instead. ![]() ![]() If you intend to add/manipulate entirely arbitrary variables (e.g. If your variables of interest end in numbers ( v1, v2. This is an average-length post covering the aspects of reading/writing variables by their name (as string) in each version of GameMaker.īefore we start, consider the following: do you really need to access variables by names? Since the entire concept is part of reflection, it isn't the fastest, and neither something that you should do often.
0 Comments
Leave a Reply. |