 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
J_Taylor The Self-Proclaimed King of Ketchup

Joined: 02 Dec 2009 Posts: 188 Location: Western NY
|
Posted: Wed Mar 17, 2010 3:36 pm Post subject: Blinking text boxes |
|
|
Okay, so I'm working on yet ANOTHER game, and this one requires a text box thingie.
One text box will say (for example)
And the next text box will say
Quote: | I will die. In eternal pain, and ketchup... |
In-game, the box will 'blink' going from the first to the second. How do I fix this? Can I? _________________ Elemental: .75%
Heart of Darkness: 0% (crash)
The Mansion: .05%
Shattered Alliance: .05%
See a pattern forming? I do, dammit. |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Wed Mar 17, 2010 6:00 pm Post subject: |
|
|
I'd just use strings :/
I'm not sure if they're placed on top of text-boxes though.
If they do, you can just show an empty text-box and put strings on top of it.
If you're not sure how they work, there's a useful article here to get started.
You'll probably just want a single string per line and tack more onto the string after each each tick or so. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Mar 18, 2010 2:38 am Post subject: |
|
|
Unfortunately you can't change the way textboxes display - this is something definitely want to see added - but you can script your own textboxes without terribly much hassle.
TwinHamster wrote: | I'm not sure if they're placed on top of text-boxes though. |
See 'Layers'. Old-style 'plot'strings are drawn on top of textboxes, but by default slices are not. (Plotstrings have been obsoleted by text slices, but they are sometimes easier to use. However, text slices wrap text automatically.) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Mar 18, 2010 7:35 am Post subject: |
|
|
First show a blank text box, then try this:
Code: |
variable(text)
text := lookup slice(sl:textbox text)
$0="This is the text that will go into your text box"
set slice text(text, 0)
|
|
|
Back to top |
|
 |
J_Taylor The Self-Proclaimed King of Ketchup

Joined: 02 Dec 2009 Posts: 188 Location: Western NY
|
Posted: Thu Mar 25, 2010 3:48 pm Post subject: |
|
|
Hm. Interesting ideas. 'Specially James's. I'll try it when I get home. Does it work for multiple? I'll probably try to bungle my way through to find out, but im asking anyways.
Also wondering if there's a way to have a script check to make sure certain NPCs are in certain places. I'm making a puzzle where the hero pushes blocks around to form an image. I want the game to check to make sure the image is correct. If this isn't clear enough, I'll put up more info. _________________ Elemental: .75%
Heart of Darkness: 0% (crash)
The Mansion: .05%
Shattered Alliance: .05%
See a pattern forming? I do, dammit. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Mar 27, 2010 7:08 pm Post subject: |
|
|
J_Taylor wrote: | Hm. Interesting ideas. 'Specially James's. I'll try it when I get home. Does it work for multiple? I'll probably try to bungle my way through to find out, but im asking anyways. |
Multiple what? Lines of text? Yes, text slices wrap their contents.
J_Taylor wrote: | Also wondering if there's a way to have a script check to make sure certain NPCs are in certain places. I'm making a puzzle where the hero pushes blocks around to form an image. I want the game to check to make sure the image is correct. If this isn't clear enough, I'll put up more info. |
If you have the NPC reference number of a specific NPC instance (eg, stored in npcref is at a specific tile (eg 13, 14), you write
Code: | if (npc X(npcref) == 13 && npc Y(npcref) == 14) then (...) |
(If there is only one NPC on the map with a given ID number, then you use the ID number instead of an NPC reference)
If you want to check whether any NPC of a certain type (eg NPC ID 3) is at a certain spot, use npcatspot:
Code: | if (npc at spot(13, 14) == 3) then (...) |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
G-Wreck OHRRPGCE Game Designer

Joined: 28 Feb 2010 Posts: 32 Location: Oklahoma
|
Posted: Sun Mar 28, 2010 9:00 am Post subject: |
|
|
I'm trying to do something very similar to J_Taylor, but instead of displaying extra text in a textbox, I want to display numbers next to menu items.
Basically, I'm making a character creation screen, and I want to be able to increase/decrease the value of the numbers next to the menu items when the player presses the right or left keys, respectively.
The menu items will represent each of the player's stats that they are editing, and the numbers will represent the value of those stats.
Right now, I'm trying to use strings to do this, but I don't think I quite understand how they work yet. From what you've said so far, though, maybe I should be using slices instead.
Here's what I've done so far:
Code: | #This script was tied to a previous menu so that it would open the stat-editing menu, and then show the strings next to their appropriate stat.
plotscript,edit_stats,begin
open menu (16) #The stat-editing menu
show string (1,x,y) #Strength
show string (2,x,y) #Accuracy
show string (3,x,y) #Dodge
show string (4,x,y) #Magic
show string (5,x,y) #Will
show string (6,x,y) #Speed
show string (7,x,y) #MP %
show string (8,x,y) #Hits
end
#This script will be tied to the 'strength' menu item so that it begins working when the player selects it. Each stat and respective menu item will have a similar script.
plostcript,strength_edit,begin
if (key is pressed (75)) then (
#decrease string value next to strength
)
if (key is pressed (77)) then (
#increase string value next to strength
)
if (key is pressed (01)) then (
exit script #Just for clarification, I'm trying to make the script stop working when the player presses esc.
)
end |
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Mar 29, 2010 3:27 am Post subject: |
|
|
showstring doesn't do what you think. It display a string (only one at a time) in the bottom left hand corner of the screen, like the old showvalue command. Anyway, you're thinking of showstringat (or centerstringat).
However, there's a much easier solution than messing around with plotstrings or text slices. Just embed a global variable in the text of each item in the menu, eg:
Code: | global variable (5, strength value) |
Menu item caption: "Strength: ${V5}"
Checking whether Esc is pressed won't do anything, since the script will exit immediately anyway. Assuming that your menu is set to close when esc is pressed, you won't need to check for esc anywhere.
One more hint: instead of writing "key is pressed(75)", if you include 'scancode.hsi' you can use the constant key:left, etc, eg: "key is pressed(key:left)" _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|