Intro problems

Started by Mr_Threepwood, Tue 18/07/2006 22:05:30

Previous topic - Next topic

Mr_Threepwood

I am making a simple intro and I have run into a few problems that I need some insights with.

The intro will consist of my character not being on the screen, and using SayAt to make his text be on the screen.  I dont want the keys to be able to skip the text (so I set it to mouse only in the game options), but at the same time I want the game script to continue while my character talks so that if I hit a certain key the save/load gui comes up.  The problem right now is what when I use SayAt it pauses the game script I think so it stops listening for keyboard input.  I also need the keyboard input so the ESC key will work and allow the player to skip past the intro to the start of the game (I'll use a global int to set whether or not the game is in the intro, so it knows to take them to the right room).
I am a mighty pirate

Khris

Try putting IsKeyPressed() checks in the repeatedly_execute_always of the room. (You'll probably have to create the function first.)

Mr_Threepwood

Well thanks for that tip I've made some progress but am stuck again with it.

I can get the gui to pop up and be not disabled (by setting it so in the game options), however clicking the actual buttons does nothing since I think that using SayAt is using blocking and thus not allowing any other script functions to run.

Is there any way I can either make the SayAt not block, or even better would be a way to override the blocking and make the GUI be the new blocker so that the game waits until the user has selected a gui option.

Any insights in this would be helpful.
I am a mighty pirate

Alynn

#3
Try SayBackground, it doesn't block at all although you lose some of the SayAt functionality.

It would be possible to have an invisible character (no sprite)with the same speech color and using SayBackground, although I don't think you can specify the width.

Another thought is a GUI with a text box (transparent background) that displays what you want to say.

strazer

Quote from: Alynn on Thu 20/07/2006 06:44:46Try SayBackground, it doesn't block at all although you lose some of the SayAt functionality.

I think the function returns a pointer, so you should be able to position the speech text directly afterwards:

Code: ags

  Overlay *thespeechtext = player.SayBackground("Once upon a time...");
  thespeechtext.X = 10;
  thespeechtext.Y = 10;


Or you could create the text as an Overlay as done in this recent thread.

Btw, instead of using the on_key_press function to listen for the ESC key, you could simply wrap the intro code in StartCutscene/EndCutscene commands.

SMF spam blocked by CleanTalk