display status variables in the game text
marilynzelha
28 May 2011, 20:07I am sure this can be done and I'm sure it's really simple but I've been banging my head against it way to long.
I have some status variables that are working just exactly the way I want them to but there are several points in the game where I want to display them inside regular text. I can see how to do that with other variables like the ones I've set for objects, but I can't seem to figure out how to do that with my status variables. I'm sure I'm being dense.
I have some status variables that are working just exactly the way I want them to but there are several points in the game where I want to display them inside regular text. I can see how to do that with other variables like the ones I've set for objects, but I can't seem to figure out how to do that with my status variables. I'm sure I'm being dense.
Alex
29 May 2011, 09:08You can display them in the same way as ordinary variables.
So for a numeric variable called "health", you can type "%health%".
For a string variable called "playername", you can type "#playername#".
So for a numeric variable called "health", you can type "%health%".
For a string variable called "playername", you can type "#playername#".
marilynzelha
29 May 2011, 16:14Thank you very much. I do realize this is silly and I know I'm missing something simple. I can get the numeric ones to work just fine but when I do that with a text string I just get !
I named my variables with a colon. Could that be causing the problem? #name:#
This actually isn't crucial to the plot of my game or anything. It just irritates me that I know I'm missing something that's obvious.
Again thank you for your answers and also for your work on this software. This is really great stuff.
I named my variables with a colon. Could that be causing the problem? #name:#
This actually isn't crucial to the plot of my game or anything. It just irritates me that I know I'm missing something that's obvious.
Again thank you for your answers and also for your work on this software. This is really great stuff.
Alex
29 May 2011, 17:28Yes, the colon will be causing the problem.
That's because it's getting mixed up with the special syntax for reading object properties, which is #object:property#. If you have an object called "man" and you want to get his "age" property, you can use "#man:age#".
In your case, using #name:# will confuse Quest, because it will try to look for an object called "name" and find a mysterious property with no name... so the best thing to do is to remove the colon.
That's because it's getting mixed up with the special syntax for reading object properties, which is #object:property#. If you have an object called "man" and you want to get his "age" property, you can use "#man:age#".
In your case, using #name:# will confuse Quest, because it will try to look for an object called "name" and find a mysterious property with no name... so the best thing to do is to remove the colon.
marilynzelha
29 May 2011, 23:29Thank you! Changing the colon would mean going in and recoding everything, which I might do but since the numbers are way more important and seem to be working fine, I might just chalk this one up to having learned not to do that next time. At least now I know why it was doing that.

Pertex
30 May 2011, 12:49Couldn't you open your asl with an texteditor and search and replace "name:" ?
marilynzelha
31 May 2011, 16:29Yes! Thank you.