View previous topic :: View next topic |
Author |
Message |
Mr B
Joined: 20 Mar 2003 Posts: 382
|
Posted: Tue Feb 24, 2004 10:43 am Post subject: Problem With Textboxes |
|
|
Hey folks,
Okay, here's the deal. I have a script that plays some music. At the end of the script, I want the main map music to play again. I made an empty (no text) textbox that has the "Restore Map Music" bitset (or whatever it's called) on, and put it in the script, like so:
Code: | show text box (tb#)
advance text box |
Unfortunately, the "advance text box" command doesn't seem to be working. From my understanding of plotscripting, these two commands should show the textbox, then immediately advance it without the player pressing "enter." However that doesn't work.
So I tried this:
Code: | suspend text box advance
show text box (tb#)
advance text box
resume text box advance |
But that still didn't work -- the player still has to press "enter."
(I don't have the code in front of me, so I'm probably not using the exactly syntactically-correct plotscript commands...but you know which ones I am refering to)
Does anyone have any suggestions as to what I'm doing wrong?
Thanks!
-B |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Tue Feb 24, 2004 12:53 pm Post subject: |
|
|
Try this...
Code: | show textbox (#)
wait (1)
advance textbox |
My theory is that the script isn't getting enough time to know about the textbox before it disappears, so a "wait (1)" would give it the time it needs.
Let me know if this helps. |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Wed Feb 25, 2004 2:08 am Post subject: |
|
|
don't you want to use "wait for textbox" instead...
i mean you don't want the player having 1 tick to read what's on the textbox. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Feb 25, 2004 3:29 am Post subject: |
|
|
Flamer, there will not be anything on the text box. He is simply trying to restore the map's music. Personally, I don't know why he doesn't use "stop song" and "play song", but I suppose that's beside the point. The only purpose of the text box is to change the music, not to allow the player to actually read anything; that's why he is only waiting one tick and not "wait for text box".
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Mr B
Joined: 20 Mar 2003 Posts: 382
|
Posted: Wed Feb 25, 2004 10:48 am Post subject: |
|
|
Hmm... Okay. I shall have to try the "wait(1)" idea. Perhaps it will work.
However, won't that introduce a bit of a 'catch' in the game (say, if the hero is walking)? Though that short of a wait is pretty negligable...
The reason that I am not using "stop/play song" is because this script can be triggered on multiple maps, each playing a different map song. There simply is no plotscripting command that restores the default map song, so I'm trying to use the textbox method.
Thank you for your ideas, folks. This may solve the problem. |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Wed Feb 25, 2004 12:16 pm Post subject: |
|
|
I highly doubt the "wait" command will cause the game to slow down at all. I mean, it only waits around 1/15th of a second, so it shouldn't be a big deal. If it is, however, you could through in some if statements to check what map the hero is on. If you have a lot of mapts, that would not be the best way, but if you are only dealing with 2-3 maps, you could do that.
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Feb 25, 2004 11:44 pm Post subject: |
|
|
A player would notice a one cycle pause in the game. However, they would probably ignore it. It is noticable. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Mr B
Joined: 20 Mar 2003 Posts: 382
|
Posted: Fri Feb 27, 2004 1:38 pm Post subject: |
|
|
Well, thanks for the help, guys.
I'll probably go for the "If...then" stuff, if anything, but I will definately test the "wait(1)" idea also. We shall see how it turns out... |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Mon Mar 01, 2004 6:12 am Post subject: |
|
|
You must use "wait for text box", as your current script basically is skipping the text box. This is actually useful if you want to plotscript textbox trees without having to mess with them in CUSTOM.EXE, but since that's not you want to do:
Code: | showtextbox(#)
wait for text box
advance text box |
That being said, you would probably be better off using the music plotscript commands instead of this funky textbox method. _________________
 |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Mar 01, 2004 12:53 pm Post subject: |
|
|
He is trying to skip the textbox. (While still having the effects of the textbox take place) _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Mon Mar 01, 2004 1:59 pm Post subject: |
|
|
The Mad Cacti wrote: | He is trying to skip the textbox. (While still having the effects of the textbox take place) |
Yeah. What I meant by skipping is that it never loads up the textbox in the first place. It's the way James had GAME.EXE's HSpeak interpreter work, I'm sure he could step in and explain it better than I could why it does that. _________________
 |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Mar 02, 2004 2:22 am Post subject: |
|
|
I believe the reason it does that is because as the HS interpreter reads through scripts, it writes down the things that need to be done, eg moving npcs, hero, displaying backdrops, textboxs. These things aren't actually done until the end of the interpreter cycle, when a wait is encountered. So if you display a textbox, and then advance it, the advance command tells the text box ... do-er... to advance (in this case close) the textbox before it even initiates enacting the textbox.
I deduced all this from HS files and logic. (I wonder how close I am? : o)
We already solved this by putting in a wait(1). _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|