Jump to content

Dialogue Calls


Dahak

Recommended Posts

I'm trying to setup a quick animation where people X & Y walk up to you, kick off a conversation, and seek your opinion.

 

However, to complicate matters I need to distinguish between X & Y when ever the speaker changes. To do this I was hoping to control the name and picture. So the flow is as follows:

 

Cutscene

Begin Dialogue

X speaks. (State 1)

Y speaks. (State 2)

PC answers. (State 3)

If PC answer = A, Then show X responds, str 1-4, Else show Y response, str 5-8 (State 4)

If X responds (from state 4), nextstate = 5

If Y responds (from state 4), nextstate = 6

 

However, I cannot find calls to do this and I could swear it was possible. How can I achieve this switching while assuring the player is aware if X or Y speaking to them (dialogue pic and name)?

Link to comment
Share on other sites

Only the first node, eh? Bummer.

 

Hm.... Can you confirm something for me? Can I pass a message while in dialogue mode so that the second person speaks after receiving the message?

 

As follows:

Town Script

-Pass Message 1 (To X)

 

X Script

-Auto-Dialogue Begins (X)

-PC answers, Pass Message 2 (To Y)

-End Dialogue

 

Y Script

-Auto-Dialogue Begins (Y)

-PC answers, Pass Message 3 (To X)

-End Dialogue

 

X Script

-Auto-Dialogue Begins (X)

-PC answers, Pass Message 4 (To Y)

-End Dialogue

Link to comment
Share on other sites

Sure you can. However, I would recommend ignoring the 'messaging' system, not only do I think that they wouldn't work for this, but that it's generally rather useless. You should be able to store the needed information using SDF's, from the code section of the dialogue nodes.

 

The only tricky bit I can see would be avoiding a gap between sections of dialog, but that shouldn't be too bad.

Link to comment
Share on other sites

Originally Posted By: Ephesos
Okay, I just checked. If you put the set_char_dialogue_pic() call in the first dialogue node, it will trigger and the picture will appear. Anywhere else and it won't update properly.


Was this from initiating dialogue with a character or calling it from a town script?

Originally Posted By: Niemand
Sure you can. However, I would recommend ignoring the 'messaging' system, not only do I think that they wouldn't work for this, but that it's generally rather useless. You should be able to store the needed information using SDF's, from the code section of the dialogue nodes.

The only tricky bit I can see would be avoiding a gap between sections of dialog, but that shouldn't be too bad.

Yeah, but the whole point is control the name and picture displayed while in dialogue mode. BoA seems structured for 1 on 1 dialogue only.
Link to comment
Share on other sites

Okay, here's my idea.

 

You should have an invisible character somewhere, and he comes with the two, and starts the dialogue with the picture and the name of whichever is talking. (You wouldn't be able to switch pictures, but as Ephesos said, you could have two in the picture and just use set_name. But if set_pic or whatever doesn't work, then perhaps set_name won't, and so my idea won't.)

 

This would probably work with just one of the two characters, but this way there's no chance of the names getting switched at the end, if that would affect anything.

 

Sorry, but this is all I can contribute with my limited scripting knowledge, other than verification that this would, in fact, have to come from a creature script.

Link to comment
Share on other sites

@Dahak: I had forgotten that begin_talk_mode() behaves differently based on context. So yeah, it seems like you would want to put in the creature script, likely after having temporarily set both creature's scripts to run every turn. There would still likely be an awkward pause, but maybe it won't look too bad; I may have to do some testing. (I'm also intrigued by the documentation's tangential mention of using begin_talk_mode() from a terrain script. I'm curious if it really works and what, if anything, interesting could be accomplished by doing so, although it doesn't seem relevant to this problem.)

 

@Duck: I'm afraid that I don't see any reason to involve a third creature, as there's nothing it could do that the pre-existing two couldn't.

Link to comment
Share on other sites

Well, I can manage the next bit of dialogue to pop up from the creature scripts, but as implied the party has to execute a turn in order to kick off the next chunk. If only there was a way to force a turn to end.

 

Edit:

Or, the other way would be to somehow force a state in the creature script to execute. Once the dialogue begins the current creature script terminates.

Link to comment
Share on other sites

Experimentation has yielded some interesting behavior. If someone has a windows machine can confirm...?

 

First, the set_name and set_char_dialogue_pic calls only work when in the code block of the first node, but they also only work the dialogue is initiated. After that, even if you loop back to the first node, you cannot change the name or pic until you initiate the dialogue again.

 

Second, the call message_dialog will overwrite text strings 1-8 with with 2x 256 string pieces of text when called from the code block of a dialogue node.

 

Third, you can run begin_talk_mode from within a dialogue. However this kills the current dialog and treats it as if it had been called from a town script. No name or dialog pic will be displayed.

 

So, as far as I can find, I can't force this to work. The only thing left is to try messaging and see if receiving a message triggers a creature's script.

 

Edit:

Messaging won't work. The following two scripts which talk to each other behave oddly. The terrain script calls node 2, which message the terrain script to begin node 3. So, the player only sees node 3. Don't know how many times it ran that branch, but obviously the last node on the branch is what the player first sees.

 

Code:
beginterrainscript; variables;body;beginstate INIT_STATE;	set_script_mode(3);break;beginstate START_STATE;	if (get_flag (0,0) == 3)		message_dialog("Jill active.","");	if (get_flag(0,0) == 3) {		begin_talk_mode(3);	}	else		begin_talk_mode(2);break;

 

Code:
begintalkscript;variables;begintalknode 2;	state = -1;	nextstate = -1;	question = "Jack, where is Jill?";	text1 = "Done talking to Jack.";	code = 		set_name(6, "Jack");		set_char_dialogue_pic(6, 1945,0);		set_flag(0,0,3);		give_ter_script_message(0,2); // Go to Jill	break;begintalknode 3;	state = -1;	nextstate = -1;	question = "Jill, where is Jack?";	text1 = "Done talking to Jill";	code = 		set_name(6, "Jill");		set_char_dialogue_pic(6, 1947,0);		set_flag(0,0,2);		give_ter_script_message(0,3); // Go to Jack	break;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...