The game I'm working on is going along pretty well. I was wondering, though, does anyone know how to have a text box appear and not be affected by the user pressing the [Enter] key -- it closes after a set amount of time and I don't want the user to compromise this time setting by prematurely closing the text box manually.|
Also, I would like to continue an animation of the person talking in the background while the text box is up (like the watch/communicator thing in SQ2). Right now the animation stops when the box comes up and I'm hoping I can get some advice on how to override this. Does anyone know how to do this? Please respond if you do.
As far as I know, you can't have animation while a text box is open. You can however use the "display" command to show text at any time.|
As far as overriding the <Enter> key during the display of a print(); check the help files that came with AGIStudio, as I'm sure that issue is discussed in the print section.
Perhaps I'm mistaken, but I was positive I remembered the boss guy talking to Roger Wilco on the watch/communicator in Space Quest 2 and the text box appeared at the bottom of the screen while the animation of the boss talking on the watch face continued.|
Does anyone else remember this?
|Eigen||There's also a possibility to use show.obj(number); comand. Write dialog as description. That should work.|
|Eigen||Never mind! I tried and it didn't work. Sorry :-|
Try to figure out the code of that scene of SQ2. I'll try to make some time free to do the same, but can't promise anything (got exams starting this week, so that's prior to AGI)|
|jelleghys||In which room does it happen?|
Hmm, you're right. I have that game, too. I opened it up in AGIStudio, but without a src folder, it looks like a pig's breakfast of unnamed variables and flags. The good news for you is that they are using a normal print.at statement.|
EDIT: I tried to attach a text file of the offending code :), because it is rather large to quote. It didn't work. If someone can point out what I need to do, I'll post it.
Use set(f15); to see animations with textbox.
set(f15); // You'll need it to use animations.
v21 = 10; // displays the text for a while.
I can't say I've ever done it, but it sounds like Robin's got the right idea, based on the AGI Studio help file.|
Set f15 (windows_remain), and when you want to close the window, issue the close.window command.
Thank you all for responding so quickly.|
I will give that a try tonight.
Hey, what do you know...it works. I did notice that any animated views that continue to play and are behind the textbox will "cut into" the textbox appearing in front of it. Although it was a little unexpected at first, it makes sense that it would do that since the textbox is drawn once and the anim continues to be redrawn.|
A little creative positioning and everything looks fine.
Thank again. I'm looking forward to completing this project.
|richunabletologin||yes, Robin's values are correct. you must set f15 and then use v21 to set how long it should be open for. This will allow the animations to go while the window is open. However, if the animations are anywhere near the box, they will go into it and it will look funny. I avoid this by using a print.at command so i can put the box safely out of the area of animation. Also, something else I noticed, if you want to have several text boxes appear one after the other with this feature you need to set f15 each time. It seems to reset after each window box that is opened.|