Scripting in Dialogue options. Any more commands allowed than in HELP file?

Started by MCF, Sat 20/12/2003 02:32:05

Previous topic - Next topic

MCF

I'm probably getting ahead of myself with what I want and what I can do.... but...

I'm doing the LucasArt style dialogue.  List of options, character picks, etc.

I'd like to change my characters' views throughout the dialogue in response to different options.  Is it possible?  

How can I have some action cues by a dialogue pick?  Do I need to set a variable equal to some value, and then check in the room code if said value has been acheived?

Ideas on best methods are appreciated.

Wolfgang Abenteuer

You can do virtually anything you want within a dialogue option.  Just use the run script command for the option and put everything in the dialog_request section of the global script.  Like:

@S
return
@1
run script 1

//global script

function dialog_request(int dialog) {
 if (dialog == 1) {
   DisplaySpeech(CHARID, "Greetings!");
   Wait(40);
   ChangeCharacterView(CHARID,1);
   DisplaySpeech(CHARID, "You're not from around here, are you?");
 }
}

That would make him say something, then change the view to another pose, then say something else, etc.  This can be done using any number of dialogue options, really.  It's all up to you!

~Wolfgang

MCF

I've not done any work with the global script, just room specific -- so this may take me some time.

How would the above explanation work with the multiple dialogue option situation, since what you wrote would be a non-interactive back and forth.


Wolfgang Abenteuer

Just take it a step further, then.  Make more than one dialogue topic, (not option, but topic), and have one run the next.  Say, you have the two dialogue topics set up as such:

Topic 1:

@S
return
@1 //Hello
run-script 1
@2 //Goodbye
charid: See ya 'round!
stop

Then topic 2 would look like this:

@S
return
@1 //Yes
charid: Well, you sure don't look like it.
stop
@2 //No
run-script 2

You could even make a third topic:

@S
return
@1 //New York
charid: Go Yanks!
stop
@2 //Boston
charid: Go Sox!
stop
@3 //Minnesota
charid: Go Twins!
stop

In the global script (which you're going to have to dig into eventually to get this to work right ;) ), add on to what I posted above with something like this:

function dialog_request(int dialog) {
 if (dialog == 1) { //say Hello
   DisplaySpeech(CHARID, "Greetings!");
   Wait(40);
   ChangeCharacterView(CHARID,1);
   DisplaySpeech(CHARID, "You're not from around here, are you?");
   RunDialog(2);
 }
 if (dialog == 2) { //say No
   DisplaySpeech(CHARID, "Didn't think so.  So where are you from?");
   RunDialog(3);
 }
}

Sorry if that's a bit confusing, but once you get the hang of it it's a piece of cake!  Basically, if you ever want to do any "normal" functions in a dialogue, just use dialog_request and type it out like you would any normal script.  The RunDialog(#) will run the topic number specified, so in this case, if the player clicked "No" when the guy asks if you're from around here, it would display the speech listed, then run the next dialogue (dialogue topic 3 in this example).  This can be carried out as far as you want, just using RunDialog to bring up the next topic.

Edit:  Of course, if you're not planning on adding any other sort of things in between two given dialogue topics, such as character view changes or other complex things, you can just use the dialogue script command goto-dialog x, where X is the number of the dialogue topic you want to go to.  In my example above, the "run-script 2" could have just been replaced with:

charid: Didn't think so.  So where are you from?
goto-dialog 3

but you probably already know that much.  Just didn't want to make it seem like I was over-complicating it for you! ;)

~Wolfgang

MCF


SMF spam blocked by CleanTalk