Dialog in Speech Bubbles (SOLVED)

Started by Trademark, Mon 11/10/2010 08:48:02

Previous topic - Next topic

Trademark

I've recently used the Hypertext module to give my characters speech bubbles to ensure that they can be read properly (even if the font still has some of the transparency color around it, looks a little bad, but readable...)

Anyway, after converting some of my Say stuff to the appropriate counterpart, I suddenly realized that my dialogs couldn't be converted this way. Do I really have to start exporting all the dialog using run-script so I can apply Hypertext.Say or is there a module or something like that that will do it for me? I looked around and couldn't seem to find a solution other than that.

Knox

What reason are you using the hypertext module for? If its to create a speech bubble, you can do it with a normal text window gui...Im not sure if this can help but you can modify the bottom left-hand or the bottom-right-hand textwindow's sprite to be the bubble's "arrow" depending on what side the character's portrait image is...so if the speech portrait pops up on the right you modify the bottom right-hand sprite of the textwindow so the "arrow" of the bubble points to the character's portrait... wait...are you using the Sierra speech style?
--All that is necessary for evil to triumph is for good men to do nothing.

Trademark

Using Lucasarts right now since Hypertext says I should, but I used Sierra initially. Changing to Lucasarts before seemed to not change anything when I tried it. So, you can make speech bubbles natively in AGS using Lucasarts? Sorry if that sounds dumb, but I find the documentation and the wiki for the game very confusing and hard to navigate...

mode7

I'm having exactly the same problem. I wonder if it's possible to draw dialog options on the speech bubble overlay of the hypertext module. I can't use a textwindow because I need to draw a gui over it.

Trademark

After a bit more digging I made a text window box, but those seem to only apply to text that uses Display, not Say, nor does it take effect on dialog. Using Lucasarts like I said before. How do I make it apply to text that uses Say to display as well?

Trademark

Sorry for the double post, but I'm on a deadline for this project of mine and I need this solved quickly. I really need to know if I can apply text window boxes to Say and dialog without resorting to Hypertext or another module.  I don't see an option for it in General Settings, only for display and thinking from what I see. If not, what module can be used? Regular Say/dialog without text boxes / speech bubbles is something I cannot do, as my hands are tied.

Going further in my project right now would cause me problems if this isn't solved, so I hope someone will be able to shed some light on this matter.

Baron

Quote from: Trademark on Tue 19/10/2010 16:13:19
After a bit more digging I made a text window box, but those seem to only apply to text that uses Display, not Say, nor does it take effect on dialog. Using Lucasarts like I said before. How do I make it apply to text that uses Say to display as well?

You will probably have to create a custom function to replace Say.  This sounds hard, but once you've written the function it will be just as easy to implement as Say.

I have sort of the same thing in one of my projects.  I have Sierra speech, but I wanted this frog character to speak Lucas-Arts style, so I had to do the speech manually.  I wrote this function in my global script, exported it, and imported it to all other scripts through the .ash script header:

Code: ags
function frogtalk (String frogsays){ //the String frogsays replaces the string in Char.Say ("...")
 short frogwords = frogsays.Length; // a variable that records the length, in characters, of what the frog will say
 short textposition; //where will the text be on the screen (y value)?
 short text_x; //how far the box should migrate to stay close to the talking frog
 short textwidth; //how wide will the box be?
     if (frogsays.Length < 40) { //i.e. it's a short statement less than 40 characters long
              textposition =280;  //the height, above the character
              textwidth =frogsays.Length *10;  //multiply number of characters  by 10 (10 pixels per letter -seems to work) to get adquate text box width
              text_x = 400 - textwidth;  //moves the box over by a an amount dependent on how long the speech is, so that it stays next to the character's head.
      }
    else {  //if what the frog says is more than 40 characters long...
              textwidth =400; // effectively the maximum textbox width
              text_x =0; // the box doesn't have to move sideways (in my game), but it's still at 200 (see below)
              textposition = 280 - (frogsays.Length/4); //a formula for determining how far up to move it above frog's head.
      }
 cFrog.LockView (5); 
 cFrog.Animate (0, 0, eRepeat, eNoBlock); //a talking animation, without the talking
 cFrog.SayAt (200 + text_x, textposition, textwidth,  frogsays); //get string length +20...? //moves the INVISIBLE speaking portrait (remember Sierra style!) to next to visible character on screen.
 cFrog.UnlockView (); //stops frog from animating mouth after speech is over
}


Now I just write frogtalk ("I talk like a frog!");  and it looks just like the frog character is talking in place.

Now I'm no expert coder so this is just to give you ideas.  Obviously if you wanted to implement a multi-character text-box style talking bubble system you'd have to make this code more flexible (another variable at the top that relates character name or number and then reference it throughout the code so different characters can be called).  You'll need to dynamically change the textbox corners into speech arrows.  Also, moving characters would have to be taken into account with coordinates relative to character's positions (cFrog.x -150 instead of the absolute coordinates I could get away with), and you'll probably have to have several different scenarios depending on the speaking characters' locations on the screen (i.e. if they are too high on the screen you'll need to put the bubble below them, or if they are too far to the right the bubble will have to go the left, etc.).  But once you get that all into the function it will work much as char.Say when you need to call it from your scripts.

Trademark

Thanks for the help, but my primary concern is placing speech bubbles or text boxes in dialog.  I've been using hypertext to replace Say for the text boxes but this does not apply to dialog, short of exporting all speech in the dialog via run-script so I can use Say.

If there is a method that can apply text boxes / speech bubbles to dialog without resorting to the above, it would certainly make my life much easier.

Baron

I'm pretty sure you can use script commands in dialogs in more recent versions of AGS, but you are correct that it will take some fiddling.

Trademark

#9
From what I see, I can only use the run-script option, which will make it quite tedious to have to export every single line of text from dialog so I can apply boxes to them...from the looks of it, I am assuming there is no native way that dialog can be written inside textboxes, and I will have to use run-script to export the displaying of text so I can apply the textboxes.

It will be very tedious, but I guess it's the only way. When I wrote the first post I was hoping that there was a way around this, but I guess not.

abstauber

#10
You don't need run-script for each line of dialog. Since AGS 3.1 you can directly paste code into the dialog editor. The only difference is that you need to indent the lines with two spaces.

e.g.
ego: Blabla

turns into
  cEgo.Say("Blabla");

By the way, this module from the french AGSers is awesome for speech bubbles ;)

http://translate.google.de/translate?js=n&prev=_t&hl=de&ie=UTF-8&layout=2&eotf=1&sl=frl=en&u=http%3A%2F%2Fadventuregamestudio.fr-bb.com%2Fles-modules-f23%2Fles-modules-f23.htm&act=url

Trademark

Didn't know about the indenting thing, much thanks! That is what was missing from my attempts.

SMF spam blocked by CleanTalk