Post new topic    
Skullduggery Studios journal 
 PostTue Dec 27, 2011 4:18 pm
Send private message Reply with quote
I know I've tried this before, but I shall try again.

New game, less expansive than the last project I tried to do. Still will attempt to finish Shattered Alliance eventually, but *baby steps*...

New game has no name yet, but I am already in production. I have the first map done slightly past placeholders and am now putting in the HUD. My question is this: how do I make a variable number show up in a SPECIFIC PLACE on the screen? [show value] doesn't work, as it puts the number in the far lower left. I want to specify where the number gets put. Help?
Liquid Metal Slime
Send private message
 
 PostTue Dec 27, 2011 6:59 pm
Send private message Reply with quote
I believe you want the "show string at" function. Consult the plotscript dictionary's Strings section for further information.
Place Obligatory Signature Here
 
 PostTue Dec 27, 2011 7:24 pm
Send private message Reply with quote
I'm pouring through the strings section, and it seems to say it's all ASCII-focused. Which would explain why it's not working.
Metal King Slime
Send private message
 
 PostWed Dec 28, 2011 8:56 am
Send private message Reply with quote
Use the 'append number' command to 'print' a number into a string. Example:

Code:
$0 = ""
append number (0, 1234)
show string at (0, 100, 100)
 
 PostWed Dec 28, 2011 2:21 pm
Send private message Reply with quote
Thanks! But... now that I got the base number where I want it, how do I have the script change the number?

This is a counter for money. The character walks onto an coin (NPC) and that triggers a script that adds X amount to the money total. Re-telling the script to append the number just adds the number to the end of the string, which was rather expected. Again, help?

EDIT: To clarify, I guess I should have asked for a non-static numerical value I can position on-screen to where I want it. I've tried a dozen ways with the strings, and none seem to be working.

I do have a fallback, in case this doesn't work.
Liquid Metal Slime
Send private message
 
 PostWed Dec 28, 2011 7:15 pm
Send private message Reply with quote
Well, you do need to remember to "clear string (string ID)" every time you call the script if you want the number to avoid stacking on itself. Make sure you call it before you append the number.

Are you looking for real-time updates of the numbers? If so, you could launch a timer that constantly reports the present value of the money display. Again, just make sure the script that's attached to the timer resets the timer if you expect it to constantly update.

If you want the player to manually input numbers as values, you can use "number from string." That command is used as a condition if memory serves correctly.

That should be enough to get you on your way.
Place Obligatory Signature Here
 
 PostWed Dec 28, 2011 10:17 pm
Send private message Reply with quote
This should be enough to help. That was the command I was looking for, but couldn't find. Thanks!
Metal King Slime
Send private message
 
 PostThu Dec 29, 2011 7:16 am
Send private message Reply with quote
That's what the
Code:
$0 = ""
was for.
Display posts from previous: