print global to location possible?

I got into developing a game and ran across this problem: I wanted the date of the game progress reported to a pict location picture (not a map because most of the game uses location links) but I couldn't see a way of reporting the gb_GameDate to coordinates on the screen. Then I realized that a lot of the game info needed to be displayed on the screen from global variables but not on a dialog screen. Anyone know of a way? If not, I'll have to scrap this game.

------------------

Quote

Originally posted by jackg4:
**I got into developing a game and ran across this problem: I wanted the date of the game progress reported to a pict location picture (not a map because most of the game uses location links) but I couldn't see a way of reporting the gb_GameDate to coordinates on the screen. Then I realized that a lot of the game info needed to be displayed on the screen from global variables but not on a dialog screen. Anyone know of a way? If not, I'll have to scrap this game.

**

It can be done, but it's painful. I use this to put a three-digit build number on the startup screen. Basically, it entails the following:

1. Create small graphic "stamps" of your digits, 0-9, in the font/size/etc you want.
2. Create global variables for X and Y cursor position.
3. Write an event to "print" one digit at the cursor X and Y positions, and increment the X cursor position by the width of the digit stamp. (Increment Y too when necessary, if you really want to be macho - I don't bother with this.) Note that this step is currently impossible because of the bug in 1.0.0 that prevents entering globals in the X and Y coordinates field of the stamp dialog. What you can do if you're really desperate is enter a long floating-point value, which will be converted to a 12-digit floating point notation, and then open the event file with a hex editor and VERY CAREFULLY replace the floating point number with the name of the global variable, which must be exactly 12 characters as well INCLUDING the "&" signifier. If you botch any of this, the event will probably be invalid and will likely either just fail, or crash the game. (This is supposed to be fixed in 1.0.1, which is due to appear Any Second Now™, although it's been there for a long time now). The print-digit event needs a ten-stage conditional: if 0 then print 0, if 1 then print 1, if 2 then print 2... with linked events.
4. Create an event to print the string, calling the print-digit event in sequence. For a number, you'll have to do some complex dividing, multiplying, and subtracting to get at the digits one at a time, and this will need to be hard-wired to the length of the number. Look at the Cosmic Memory source on the CD for how they print the scores, it's all there.
5. Initialize the string at startup and hook the event in wherever you want it to show.

There's no "substring" function in ColdStone that I know of, so if you want to do an XX/YY/ZZZZ date function, you're probably going to need to store the elements separately as numbers, and handle the "/" with some other method.

- TM

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)