Converting global variables to stamps!

I'm creating a custom interface screen for my RPG using stamps, and I need to display numbers. So I need an event system that will take a global variable and some coordinates and spit out a series of stamps to form that number. Does anyone know how to do this? The mathematical principle will suffice, since I'll need to adapt whatever system I come up with to the specific requirements of this interface. I know Cosmic Memory does this, but it's very difficult to figure out how. In addition, I have a whole slew of numbers to display via stamps, while cosmic memory just had one or two scores.

Anyway, I'm stumped for the moment.

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

(This message has been edited by LoneIgadzra (edited 02-27-2003).)

scratch

(This message has been edited by ellrx (edited 02-27-2003).)

well..; I ve got a solution... maybe not the most efficient and a bit annoying to "code" but it sure will do... create an NPC per number, I mean the NPC "0", the NPC "1"... and so on to NPC "9"..; if you need text, do the same for letters, which give you 10+26 NPCs... for each NPC, give them the corresponding graphic... you ve guessed I think: make a picture of a 9 and give it to the "9" NPC... when you want to draw the number 598, use an event in which you call an NPC control that put in the map the NPCs "5","9" and "8"... you'll have to know the coordinates... and I recommend you use 32*32 pictures for the NPCs pictures cause you place NPCs in movement tiles... so the minimum distance between 2 NPCs is 1 tiles... since you sure would like your writings to be contigous, you have to make them the right size... and you'll have to always know the coordinates at which you must "summon" your NPCs...
this might not be the best solution and I might think to other, better ones in the futur, but that's the best I can do "on the fly" right now 🙂

------------------
God is real... unless declared integer...
Watashi wa Iori Yagami no gakuse-desu
My RPG's homepage: (url="http://"http://darkrising.free.fr/")http://darkrising.free.fr/(/url)

The problem is not making the number graphics show up. The problem is taking a number stored in a global variable and making an event system which take that GB and make the right number graphics appear.

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

I haven't looked at the way Cosmic Memory does it (which would seem like the best place to start), but here's an idea off the top of my head, utterly untested in Coldstone.

You'll want two separate events; let's call them "DisplayNumber" and "DisplayDigit". DisplayNumber will be the event that you call directly. You'll also want variables: Number (containing the number you want to display), NumberTemp, Digit, XPosition, and YPosition.

(This is all based upon my recollection that Coldstone uses only integers in its globals, and truncates (rounds down) all decimals. If that's wrong, well, the whole thing falls apart. 🙂 )

DisplayNumber:
Set NumberTemp to (Number)
Set YPosition to (whatever you want)

Set XPosition to (position of the leftmost digit you want to display)
Set Digit to (NumberTemp/10000)
Call DisplayDigit

Add (width of one digit) to XPosition
Subtract (Digit*10000) from NumberTemp
Set Digit to (NumberTemp/1000)
Call DisplayDigit

Add (width of one digit) to XPosition
Subtract (Digit * 1000) from NumberTemp
Set Digit to (NumberTemp/100)
Call DisplayDigit
...etc...

DisplayDigit
If (Digit == 1) then place stamp "1" at (XPosition, YPosition)
Else if (Digit == 2) then place stamp "2" at (XPosition, YPosition))
Else if (Digit == 3) then....
...etc...

Again, this is completely untested, but I think it might work.

------------------
I don't know what I'm talking about.
Oh no, here comes another learning experience.
Oderint dum metuant?

Yes Glenn that wiil work and is the basic idea behind Cosmic Memory score display.

I added a funtion to determine how many digits the number has before you break it down allow infinite numbers

for this i created two events one called temp_score.cet

{that sets

gb_temp_score = gb_score

then checks if

gb_temp_score > 9?

if true calls a event called get_digits.cet

if false dose nothing

then sets

adds 1 to gb_digits}

the second event

{checks if

gb_temp_score <= 9

if true calls end event

if false dose nothing

then

gb_temp_score / 10

then

add 1 to gb_digits

then

call event get_digits}

so basically we can still divide the temp by ten it counts a digit if not it calls the end event the last digit is counted as we drop back to the first event.

Any questions?

namaste

stray

------------------
Cooldstone_Dev Resource: (url="http://"http://homepage.mac.com/straytoaster/")Coldstone_Dev Resource(/url)

See Coldstone_Tips at: (url="http://"http://coldroom.150m.com/CGE_Stuff/CGE_Tips.html")CGE_Tips(/url)

Thanks a lot! I'm not in any great need for flexibility in the quantity of digits (since I can simply cap stats at 999 or something rediculous like that and be done with it), but all that is surely going to be saved into a text file and printed!

(So Coldstone truncates decimals huh? Now Cosmic Memory makes sense.)

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

Sorry to resurrect this old topic, but I would like to complain that yet again a perfectly good event system has been broken by Coldstone for no obvious reason. I have checked and rechecked my number display events. Everything should be working fine. I set up two events to display a 3-digit number via stamps. I set up several other events that set the number coordinates and value to whatever is needed call the "number refresher". These events are, in turn, called by the main even that teleports the player to this interface.

However, all I get for two of my three stamp numbers is "00" and nothing for the other.

My number refresher is mathematically sound. None of my global actions are screwed up. All my coordinates are right. All my images are 16-bit picts. It's all right, but it's not. I don't get it.

Edit: Here's a screenshot of my "number refresher" action:
Posted Image

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

(This message has been edited by LoneIgadzra (edited 03-14-2003).)

I'm looking at your labels for the various Change Global actions, and wondering if that's the problem... how are you doing, say, both a multiplication and a subtraction (for instance, numbertemp - (digit*10)) in a single action?

------------------
I don't know what I'm talking about.
Oh no, here comes another learning experience.
Oderint dum metuant?

I'm not any more. And it still doesn't fix the problem. (I was so tired when I set it up at first that I just couldn't think how to deal with Coldstone's operational limitations and put in those instructions word for word.)

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

(This message has been edited by LoneIgadzra (edited 03-30-2003).)

So it's still broken? Can I see your current action list?

------------------
I don't know what I'm talking about.
Oh no, here comes another learning experience.
Oderint dum metuant?

Certainly:

Posted Image

I double-checked all the actions, and they all do what their labels say.

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.

(This message has been edited by LoneIgadzra (edited 03-30-2003).)

Well, that looks right... Here are a couple of thoughts.

  1. Are you sure that your "display digit" event works correctly? If you create an event that just sets X and numbertemp to arbitrary numbers, then calls "display digit", does the digit display correctly?

  2. Use dialogs for troubleshooting. After each action that changes your globals, call up a dialog that says, "numbertemp is &&gb;_numbertemp and digit is &&gb;_digit", or whatever the appropriate syntax is. Where does the problem arise?

------------------
I don't know what I'm talking about.
Oh no, here comes another learning experience.
Oderint dum metuant?

Hmm, thanks for the Coldstone troubleshooting tips. I'll post with whatever my results are. I'm pretty sure I've quadruple-checked every possible event by now, but never thought to do a little logical zeroing-ing. :redface:

------------------
The autotrophic organisms are decidedly more verdent when located on an adjacent surface.