Game Maker - use of global variable and array in draw_text
<p>In Game Maker, drawing the value of a variable using draw_text is something like this:</p>

<pre><code>draw_text(xCoordinate, yCoordinate, string(global.variable))
</code></pre>

<p>Providing the variable in use is global, now with an array that stores the name of all the variables we would like, this problem occurs:</p>

<pre><code>draw_text(xCoordinate, yCoordinate, string("global.") + string(arrayName[0]))
</code></pre>

<p>Instead of showing the same value as in the first draw_text, it now literally shows: global.variableName instead of variable value.</p>

<p>An example of this would be:</p>

<p>Input:</p>

<pre><code>draw_text(10, 10, string("global.") + string(enemyName[0]));
</code></pre>

<p>Output:</p>

<pre><code>global.Orc
</code></pre>

<p>When instead, say it would be health, it should say:</p>

<p>Output wished for:</p>

<pre><code>10
</code></pre>

<p>Is there a way to do this without it being painful? I believe old Game Maker had these functions to play with:</p>

<pre><code>variable_local_get
variable_local_array_get
</code></pre>

<p>But unfortunately they no longer exist.</p>