Dialog Problem

Started by -Jaz-, Sat 07/07/2007 16:21:12

Previous topic - Next topic

-Jaz-

Hey!

Im having a problem with the starting dialog repeating itself. Whent the script starts on topic 0 the character will greet the other character with "Hello". But when I am in another topic and use the "goto-dialog 0" command, the @S will repeat itself again with "Hello". How do I stop this from happening?

I have tried to use the option-off X with an 's', but it wont let me do it.

By the way, I have noticed that the 'say' check boxes next to the options dont work, so I have to use the option-off X  command in the script.

Cheers.

Khris

#1
1. Don't put anything after @S unless you really want it to be displayed every time.
Instead, use:
Code: ags
  player.Say("Hello.");
  dDialog.Start();


2. To set the initially available dialog choices, use the "Show" check box.
The "Say" check box sets whether the player character actually says the line after selecting it in-game.

Usually you keep "Say" checked so you don't have to copy the dialog line into the script.
But say the player selects mere topics like "himself" or "murder" then you'd uncheck it and put the actual line into the script.

timmle

I have a dialog proroblem, but i didnt want to make a new topic, as it would be a waste and this was more than enough to describe my problem as it is.

After reading the manual about extra options for dialog, after every option has been talked about i put a option-off x command to make sure it doesn't appear again, eventually after putting it on everything, as i dont want the player to have to go through things again if unnecessary, if you try to talk to the man again, script error occurs obviously because all the options have been turned off.

Is there anyway i can make it so that after the first conversation, when you click to talk to him again, it displays something such as - "I have nothing more to talk about with this person".

And out of curiosity is it a simple task so that when something triggers in the game, such as finding an object, it creates a new option to talk about in the dialog? - Does it have anything to do with the run-scriptx command as that looks a little complex.

Thankyou once again.

Makeout Patrol

Quote from: timmle on Mon 04/08/2008 23:44:19
Is there anyway i can make it so that after the first conversation, when you click to talk to him again, it displays something such as - "I have nothing more to talk about with this person".

To be frank, this is not a good thing to implement. What if the player leaves your game alone for a few weeks and returns to it, and doesn't remember what the character said? Unless there's a story reason why you won't be talking to this person again, it's always good to leave the option of talking to them again open.

If you MUST do this, you should probably set a variable to indicate whether or not you've already talked to them. Pick a global int that you haven't set yet; this global int now indicates whether or not you've talked to this dude. 0 means you haven't, 1 means you have. When you finish the first conversation, put in a command that says:

set-globalint X 1

Where X is the global int that you're using (if you haven't used any yet, just use 0). Now, go into the 'talk to character' script, and put this in:

if(GetGlobalInt(X) == 0){
  // run the dialog
} else {
  // Display("This man is an asshole and I will not converse with him any further.");
}

Quote
And out of curiosity is it a simple task so that when something triggers in the game, such as finding an object, it creates a new option to talk about in the dialog? - Does it have anything to do with the run-scriptx command as that looks a little complex.

Nope, this has nothing to do with run-script (although that is a very useful tool and not very difficult to use at all, I recommend that you figure it out). In this case, in the script where the player finds the object, if you wanted to activate option 2 in dialog dFellow, you would add this:

dFellow.SetOptionState(2, eOptionOn);

With the same method, you can also turn options off or turn the off forever. Look it up in the manual, it's your friend.

Khris

Or, check if all available options are not on.
Code: ags
function cDude_Talk() {
  int o = 1;
  bool do_talk = false;
  while (o <= 5) {    // check options 1-5
    if (dDude.GetOptionState(o) == eOptionOn) do_talk = true;
    o++;
  }
  if (do_talk) dDude.Start();
  else player.Say("I don't know what else to ask him.");
}


This way, you won't use GlobalInts (which is always good practice) and you don't have to run-script X to check if all options have been exhausted.

SMF spam blocked by CleanTalk