I have the following code in the global script.
lblHealth.Text = String.AsInt(heroHP);
lblMonsterHealth.Text = String.AsInt(enemyHP);
Unfortunately, I get the following compilation error:
In: 'Global script'
Error (line 14): must have an instance of the struct to access a non-static member
How do I fix this? I cannot find any documentation about this.
String.AsInt is for converting a string to an int, e.g.:
String a="333";
int b = a.AsInt; // no brackets, too, btw
You'll want:
lblHealth.Text = String.Format("%d", heroHP);
There is a pretty recent thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=30729.0) explaining this, too.
Silly me.
Thanx