Jump to content

Dialogues


Recommended Posts

Okay, so I get how to script a dialogue, and I have one ready, and I set the creature's 3rd memory cell to the number of the node. Then, I didn't know what to do next so I tried putting the text file in the folder for the scenario, and then loaded it. I tried talking to the guy, but I got an error message. It said there was no script loaded. What should I do?

Link to comment
Share on other sites

You need to have told BoA what town script to be used for the particular town (go to Town Details in the town menu). In addition, your dialog script should be the name of the town script with "dlg" added on to the end of it. So if your town script was "town.txt" your dialog script for the town would be "towndlg.txt".

Link to comment
Share on other sites

EDIT: Excalibur beat me to it. Ah, well.

 

Alright, you have to set the town script. Basically, the script the town reads off of for specials and such. It doesn't actually have to exist yet, but it has to be set. So if your town is "Roman Suburb", you'd go to the town menu, select 'Town Details', and type in the name of the script. (So it'd be something like 't0romansuburb'; keep in mind, it must be 13 characters or less).

 

Then, you put the dialogue script in the same folder (which you already have) and make sure it's named the same as the town script, but with a 'dlg' appended ("t0romansuburbdlg").

 

That's all there is to it.

Link to comment
Share on other sites

I wasn't sure if I should make a new topic for this in Tech Support, but the dialogue works fine, with one problem. The instructions told me to put the first node's question as the character name, but it just showed the character type with the name repeated under it and no button to go to the next node. When I took out the question, it played the text over and over with no button. Any ideas?

Link to comment
Share on other sites

It sounds like your game is functioning exactly as it should, you just need to make some fixes to your scripts.

 

Setting the starting node's question to the character name does nothing as far as I know; it's merely a convention that Jeff uses to make it easy to identify which character a chunk of dialogue belongs to. To actually make the character's name appear, you'll have to set it using a set_name() call. The typical place to do this is in the INIT_STATE of the town script. See 't0Fort Talrus.txt' in Valley of the Dying Things (or almost any other friendly town's script) for an example.

 

in order to connect two dialogue nodes, you must correctly set the nest_state property of the first and the state property of the second. The way it woirks is simple if a little unintuitive: If you are at a given node in the dialogue, the game displays that node's text and also reads that node's next_state property. It then scans all other dialogue nodes in that script, picks out all of the ones whose state property matches the next_state value it just read, and displays their questions as the options the player may choose. An example:

 

Code:
begintalknode 1;state = 1; //this doesn't matter in this examplenext_state = 2;text1 = "Fool! Are you deaf?!";//other properties omittedbegintalknode 2;state = 2;question = "No, I can hear you; stop shouting!";//other properties omittedbegintalknode 3;state = 2;question = "Eh? What's that? speak up!";//other properties omitted

 

When the player reaches node 1 in the discussion, by whatever means, the text "Fool! Are you deaf?!" will be displayed and because nodes 2 and 3 have states matching the next_state of node 1, the questions "No, I can hear you; stop shouting!" and "Eh? What's that? speak up!" will be given for the player to choose from.

Link to comment
Share on other sites

Okay, here is the script:

 

begintalknode 1;

state = -1;

nextstate = 1;

text1 = "A guard stands at the end of the walkway. He appears very mad. _You have disregarded our warnings! You must die!_";

 

begintalknode 2;

state = 1;

nextstate = 2;

question = "What is going on here?";

text1 = "_It is a secret. You must leave or die._";

 

begintalknode 3;

state = 2

nextstate = -1

question = "I demand entry!";

text1 = "_My orders are to kill intruders. Die!_";

Link to comment
Share on other sites

But they haven't been exhausted. What I'm trying to say is that it only plays node 1. And it plays it over and over again.

 

Well, I fixed it anyway.

 

Edit2: I want the guy to turn hostile after the dialog, but it doesn't say anything about it in the instruction file thing. Does anyone know how?

 

Link to comment
Share on other sites

Originally Posted By: Duck Vader
Edit2: I want the guy to turn hostile after the dialog, but it doesn't say anything about it in the instruction file thing. Does anyone know how?

You have to use "code =" to do this. If I remember this correctly off the top of my head, the call you want is set_attitude().
Link to comment
Share on other sites

Can I get some specifics as to the set_attitude format? Does it go right in the dialog file?

 

Also, I have two special encounters but neither of them plays when you step in the rectangle.

 

beginscenarioscript;

 

beginstate 11;

message_dialog("There is a disgruntled guard in front of you. He is fuming, his face is red, and his cheeks are puffed out.");

break;

 

beginstate 12;

message_dialog("Another guard walks up to you. _My master apologizes. Please go see him to the east._");

break;

 

Does anything in that look immediately wrong?

 

Edit: I figured out why one of the special encounters doesn't work. You start inside of it, so it doesn't call the state. But that still doesn't explain the second one.

 

Edit2: I moved the rectangle away, and it still doesn't work. frown

Link to comment
Share on other sites

If you read the text area at the bottom of the game screen, when you enter that town, or if it's the town where the scenario begins, when you start the scenario, you should see some error messages there.

 

The immediate problem is that your calls to message_dialog() will fail because you've given them the wrong number of parameters; it requires two strings (either one of which can be empty), not one.

 

The other point to be aware of, is that if the game encounters any error in loading a script, it will abort the loading process. If the script in question i a town script, none of the special rectangles will work, if it's a creature script the creature won't do anything, etc.

Link to comment
Share on other sites

Okay, two things: you need to look at other people's code and read the editor documentation for a while. You're going to be hopelessly lost unless you do that. Second, you need to read the game's error messages. If you see an error message when a town script loads or when a state is supposed to run, then NOTHING will work after that. Scripts stop running when they reach an error.

 

Here's an example of the "code =" feature being used (stolen out of Bahssikava):

Code:
begintalknode 7;	state = 4;	personality = 151;	nextstate = 5;	condition = 1;	question = "Freed?";	text1 = "_Our leader, Voss, managed it somehow. He has freed a number of us from servitude at the hands of the demons. It does not matter. Our freedom is only a temporary reprieve unless you defeat the demon lord.";	text2 = "_I know you are here to fight Nolagh-Khar, and I will help you as much as I can, but I am afraid that is not much. I can tell you that the eldest son in this house was training to be a warrior, and you can find some potions in his room.";	text3 = "_I know also that a large number of slith spirits are kept in a large crystal south of here. It is heavily guarded, and it has a magical system to prevent meddling by anyone who is not authorized, but I think there are holes in its protection.";	text4 = "_That is all the help I can give. I must go now and deal with events in the western mines. Good luck. We are all depending on you._";	code =	if (get_flag(14,21))		remove_string(3);	set_flag(15,28,1);	erase_char(65);	end();break;

This causes a character to vanish at the end of the conversation, IIRC, but set_attitude() would work much the same way.

 

At least one reason your message_dialog() calls aren't working is that they only have one string in them. You want every message_dialog() call to be formatted message_dialog("",""), even if you've got nothing in the second string.

Link to comment
Share on other sites

Wait, so I would format set_attitude like this:

 

set_attitude([creature number],[]);

 

but the problem is that I have no idea what to put after the creature number. I tried 3 (for the 3rd attitude, Hostile type A) but that didn't work.

 

I tried putting in another string for the message_dialogs but that didn't work either.

Link to comment
Share on other sites

You need to look in the Editor Documentation Appendices PDF for this sort of information, in general.

 

For set_attitude(), you must provide two parameters: First, the number of the creature or group to affect, and second the attitude to set for that creature or group. Attitude values are friendly (3), neutral (4), hostile type A (10), and hostile type B (11).

 

EDIT: If adding a second string parameter to each of your message_dialog() calls didn't fix your script, read the game's output to see what other errors there were.

Link to comment
Share on other sites

Yes, states that you want to use for special encounters in a town must go in the script assigned to that town, and the same goes for special encounters placed outdoors, which must be defined in the outdoor section's script.

 

The scenario script is mainly used for code which could be called from anywhere in the scenario. Examples are custom item effects and custom skills.

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...