Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Blitzerland on Sat 09/07/2005 02:49:55

Title: Scripted events in the background?
Post by: Blitzerland on Sat 09/07/2005 02:49:55
I want a character to talk in the background.

Simple example (AKA not the exact speech):

character[A].SayBackground("Yabba yabba?");
wait(80);
character[A].SayBackground("Moots!");
wait(80);
character[A].SayBackground("Blah blah!");

Sadly, the wait command pauses the entire game while he talks.

If I do this:

character[A].SayBackground("Yabba yabba?");
character[A].SayBackground("Moots!");
character[A].SayBackground("Blah blah!");

It skips straight to "Blah blah."

How do I get him to say these three lines of text, in the background, without pausing the game?
Title: Re: Scripted events in the background?
Post by: strazer on Sat 09/07/2005 03:46:45
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=11868.0

Edit:

It's also possible using my CharacterControl script module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20608). Set up your text as, for example, global messages 512, 513 and 514, then do:
  CharacterControl.CreateChain(1, "SAYMSG:512; SAYMSG:513; SAYMSG:514;");
  CharacterControl.StartExecuting(cA, 1);

Or you could script it yourself using repeatedly_execute and timers and/or variables. I'm too lazy to code something right now.
Title: Re: Scripted events in the background?
Post by: Blitzerland on Sat 09/07/2005 18:23:54
Brilliant module. I've got it working now, but for some reason, when it displays the messages, the talking view doesn't play. Is this a known bug, or did I goober something up?

In my global script, under gamestart:

CharacterControl.CreateChain(1, "SAYMSG:0; SAYMSG:1; SAYMSG:2; SAYMSG:3; SAYMSG:4;");

This is ran after the player hits a certain region:

CharacterControl.StartExecuting(cMonitor, 1);

Now, it prints the messages correctly and all that, but the talking view doesn't run as it normally does.

Title: Re: Scripted events in the background?
Post by: monkey0506 on Sat 09/07/2005 22:59:08
Thanks for that link Strazer...I haven't had a chance to look at your SM (I've thought about it, I just haven't gotten around to reading that one yet...), but that first link looks like it could come in very useful.
Title: Re: Scripted events in the background?
Post by: strazer on Mon 11/07/2005 14:35:56
QuoteBrilliant module. I've got it working now, but for some reason, when it displays the messages, the talking view doesn't play. Is this a known bug, or did I goober something up?

Yeah, it works exactly like SayBackground in that it just displays the text and doesn't play the talking animation. I might add this to the module at a later time.

Edit:

Version 0.81 now available.