Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: fly on Mon 11/08/2008 21:05:53

Title: Dialog...beginner...help
Post by: fly on Mon 11/08/2008 21:05:53
Hi, I've searched the forum, manual and tutorial and i haven't found the answer..or I haven't been searching for the right tag.. Anyway I'm beginner in this and I have problem with making dialog in version 3.0.2......I don't know how to set that dDialog1 start when I click to talk with a cChar1 character. And how to set what he'll respond.  sorry but I'm a total beginner.. Hope someone will help  ???
Title: Re: Dialog...beginner...help
Post by: TwinMoon on Mon 11/08/2008 22:44:45
I could explain it here, but the manual does it far better:

AGS Help file > Contents > Tutorial > Starting off > Conversations

Almost at the bottom, above the line More on conversations it clearly explains how to make the dialog start.
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 00:46:00
I don't know where should I put that script, if you could show me like step by step screenshots?  And where do I write what should cChar1 answer? I made this:
(http://img501.imageshack.us/img501/3492/dialogpr6.jpg)
Title: Re: Dialog...beginner...help
Post by: Makeout Patrol on Tue 12/08/2008 00:57:26
The manual really does do an excellent job of explaining this and you should really take a look in there, but I'll take pity and give you a step-by-step.

To make the dialog start:

1. Open up the cChar1 window in the editor by double-clicking on it in the node tree on the right.
2. Look for the lightning bolt icon on the right side of the screen, beneath the pull-down menu, and click on it.
3. Below the icon you can see the list of interactions: it will probably have a list that says "any click on character" and "Interact character" and so on depending on what cursors you have in your game. Learn how this screen works; it is identical to editing interactions with hotspots, inventory items, objects, GUI controls, and so on.
4. Assuming you want the conversation to start when the player clicks on the character while the mouse is in "talk to" mode, click in the blank field to the right of "Talk to character" and click on the "..." button. This will automatically create a function in your global script called cChar1.Talk(), and this function will open in the editor.
5. In this function, type the script that you want to execute when the player makes this interaction. In this case, you want the game to start dialog 1, so put in the line that says dDialog1.Start(); here.

I really don't see how I can explain editing dialog any more simply than it already appears in the manual, but I'll try: if, for example, you want the character to respond "Hi" when the player clicks on option 1, you would write "char1: Hi!" in the line below "@1," and any further lines would be placed below in the same manner. (You don't put the lowercase c before the characters' names in the dialog editor - cEgo would be written as Ego here.) Place the conversation when the player clicks option 2 below @2, and so forth.
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 01:09:03
Oh, it's so simple, thank you very much! Now I'm seeing some other problems..when talking, under text there is the same text with Font 2 and it makes this unreadable, how to fix this? how can I change text color? And one off topic question: cChar1 character is smaller than cEgo1 character so it looks stupid. how can I fix this?
thanx for help!
Title: Re: Dialog...beginner...help
Post by: Gilbert on Tue 12/08/2008 01:43:41
It's probably because the OutlineStyle option for Font 1 is set to "Use outline font" and the outline font number is set to 2 (which is default for the default AGS fonts). Just change the OutlineStyle to "none" or "Automatic".

For text colour, if you are referring to the speech colours of the characters, there is a "SpeechColour" setting for each character so you can set their default speech colours. (These can also be changed ingame by modifying the Character.SpeechColor property if required.)

If you didn't draw the characters at the correct size, either reimport character graphics of corect sizes, or mess with the area scaling so that the player matches the NPC (if the NPC is a standing character and is set to ignore scaling), or, in a more complicated way, change the scaling of the characters ingame via scripting.
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 02:13:30
The text is now OK. How can I set conversation to go automatically, I mean..that I don't have choices to say, so that options are going one after other automatically? I made cChar1 by editing cEgo1 bmp files, so they are exact same size, but on game it's different ?!  Scaling is turned off, but when it's on, nothing changes.. Oh, one more thing..when I pick up one inventory item, it doesn't dissapear, but other one does. What can I do to make the first item to dissapear? Script of this item is:

function avionj_Interact()
{
character[0].Walk(313, 209);

player.AddInventory(inventory[4]);
object[0].Visible = false;
DisplayMessage(0);
}
function avionj_Look()
{
DisplayMessage(1);
}
Title: Re: Dialog...beginner...help
Post by: Makeout Patrol on Tue 12/08/2008 08:53:19
Quote from: fly on Tue 12/08/2008 02:13:30
The text is now OK. How can I set conversation to go automatically, I mean..that I don't have choices to say, so that options are going one after other automatically? I made cChar1 by editing cEgo1 bmp files, so they are exact same size, but on game it's different ?!  Scaling is turned off, but when it's on, nothing changes.. Oh, one more thing..when I pick up one inventory item, it doesn't dissapear, but other one does. What can I do to make the first item to dissapear? Script of this item is:

function avionj_Interact()
{
character[0].Walk(313, 209);

player.AddInventory(inventory[4]);
object[0].Visible = false;
DisplayMessage(0);
}
function avionj_Look()
{
DisplayMessage(1);
}


If you just want a conversation to happen when you TALK TO the character, there's no reason to use a dialog - in the cChar1_Talk() function, just put in a bunch of Character.Say() functions. For example:


cChar1_Talk(){
  cEgo.Say("Hello!");
  cChar1.Say("Hi there!");
}


Dialogs are there for when you want to give the player a choice of what to say; Character.Say() is there for when there's only one thing to be said.

I'm not sure what the deal is with your other two problems. For your object problem, what is "the other one?" What is disappearing, and what do you want to disappear? For your character graphics, show us a screenshot of what you mean, I frankly have no idea why that would be happening.
Title: Re: Dialog...beginner...help
Post by: Khris on Tue 12/08/2008 09:32:15
Instead of object[0].Visible = false; try avionj.Visible = false;
You don't have to use all that numbers, you can use the scriptname in most cases.
Title: Re: Dialog...beginner...help
Post by: Matti on Tue 12/08/2008 11:44:05
Quote from: fly on Tue 12/08/2008 02:13:30
I made cChar1 by editing cEgo1 bmp files, so they are exact same size, but on game it's different ?! 

In case you just edited the .bmp files you still have to import these new sprites (and replace the old ones).

All images are saved within AGS, so the editor doesn't open image files when running/editing a game.
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 12:36:10
Quote from: matti on Tue 12/08/2008 11:44:05
Quote from: fly on Tue 12/08/2008 02:13:30
I made cChar1 by editing cEgo1 bmp files, so they are exact same size, but on game it's different ?! 

In case you just edited the .bmp files you still have to import these new sprites (and replace the old ones).

All images are saved within AGS, so the editor doesn't open image files when running/editing a game.
I know that.
Item dissapears now, when I replaced "object[0]" with "avionj".
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 13:21:18
Oh, I forgot..here's the screenshot of the characters

(http://img227.imageshack.us/img227/8895/screenshotcr3.th.jpg) (http://img227.imageshack.us/my.php?image=screenshotcr3.jpg)
Title: Re: Dialog...beginner...help
Post by: fly on Tue 12/08/2008 22:41:28
Scaling problem fixed, thanx to Ishmael's help on MSN...