Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Help is required.  (Read 929 times)

0 Members and 1 Guest are viewing this topic.
Help is required.
« on: February 03, 2007, 02:25:32 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2890
Well, here comes the question. I have a script in my upcoming RPG, which takes care of textboxes. It writes one gradually, like in Zelda, and when the textbox is full, you can press Z to continue onto the next textbox, until the textbox is finished.
You can only have one textbox at a time.
The textboxes also have a little bit at the top showing the character speaking, as in Final Fantasy.
Now, here's my problem. When I call the script, here's what my code looks like:

Code: [Select]
draw_textbox("Hiya. Here's a little textbox sample. Of course, this isn't used in the game, it's just an example for Connection :P.",0.8,0,0,"cb43569#Human")
It works perfectly, and looks awesome in the game :D! But, if I want multiple characters to say lines, I'd want to write it like this:

Code: [Select]
draw_textbox("What about that particular one... Dragons' Wrath?",0.8,0,0,"Wulfr#Unknown")
draw_textbox("Dragons' Wrath? They think... that it was the masters of destruction, sir.",0.8,0,0,"Pent#Unknown")

But... obviously, they overlap... how can I make the second textbox ONLY appear when the first has disappeared? How can I make command #2 only occur after command #1?

I'm confused...


Dayjo: Set the message icon to GM6
« Last Edit: February 03, 2007, 03:47:07 pm by Dayjo »
Logged

Dayjo

shut the fuck up donny.
Re: Help is required.
« Reply #1 on: February 03, 2007, 03:46:04 pm »
  • hungry..
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3602
Surely you just do it when they've pressed Z?
Logged
  • My Blog
Re: Help is required.
« Reply #2 on: February 03, 2007, 06:23:48 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2890
Surely you just do it when they've pressed Z?

Ah, here's the problem. I've coded this thing so that messages that are too long are automatically split into multiple textboxes. I could make it wait for a certain amount of Z presses... but this game is going to be translated into mutliple languages, for the final version, so the amount of Z presses will change... :(.
Logged

mit

Re: Help is required.
« Reply #3 on: February 03, 2007, 06:32:08 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
Is it a realtime textbox, or does it freeze the game? If it freezes, then there shouldn't be a problem. If it's realtime, then there must be some object that's drawing it (however you've done it) and you need to make sure it isn't drawing one already. If it is, make it add them into a stack and only execute the next one when the current one is finished, and repeat till the stack is empty.
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Re: Help is required.
« Reply #4 on: February 03, 2007, 06:55:23 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 2890
It's realtime, it creates an object. How would I create this "stack"? Do you mean like a data structure, or something?
Logged

mit

Re: Help is required.
« Reply #5 on: February 03, 2007, 08:27:01 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
Well, I suppose if it creates an object for each textbox, it would be easiest to just only exectute the code in the object if the instance below isn't the same object.

That is, they're created in order. The ones that are created after need to be hidden, so they need to wait until the object that was created before them has destroyed itself.

Code: [Select]
if !instance_exists(id-1) or (id-1).object_index != object_index{
    //Do textbox code
}
You'd need to put that over all of the code in the object. Should work.

Edit: Sorry, inverted the code >_<
« Last Edit: February 03, 2007, 08:28:36 pm by mit »
Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.243 seconds with 49 queries.