Jump to content

Need help with dlg scripts...


Devotion

Recommended Posts

I'm kind of new to scripting BOA but have read the guides and still am having trouble with how to have multiple characters have their own dialogue (the third guy doesn't talk much just says "OK.", also can someone help me in how to script opening doors when you talk to a certain person? confused

 

Here's the code if you need it...(just a basic mod.)

 

Click to reveal..
begintalkscript;

variables;

 

begintalknode 1;

state = -1;

nextstate = 1;

question = "Janitor";

text1 = "You meet the Janitor of these Barracks. _What do you want, friend?_";

 

begintalknode 2;

state = 1;

nextstate = 2;

question = "Where am I supposed to go?";

text1 = "_What I heard was that you were to meet up with the General at the Training Camp_";

 

begintalknode 3;

state = 2;

nextstate = -1;

question = "Where is the Training Camp?";

text1 = "_It is not to far from here, just a little to the North_";

 

begintalknode 4;

state = 1;

nextstate = 3;

question = "What do you do here?";

text1 = "_I clean and organize things here_";

 

begintalknode 5;

state = 3;

nextstate = -1;

question = "Do you have a hard time?";

text1 = "_Mostly no, but It can get frustrating at times_";

 

begintalknode 6;

state = -1;

nextstate = 4;

question = "Chef";

text1 = "You meet the Chef of the Barracks. _As you see I am quite busy right now, but anyways...what can I do for you?_";

 

begintalknode 7;

state = 4;

nextstate = -1;

question = "Can I buy some food?";

text1 = "You conclude your business";

code =

begin_shop_mode("Chef's Wares","Food carefully prepared at a slightly high price.",5,3,-1);

break;

 

begintalknode 8;

state = -1;

nextstate = 5;

question = "Official";

text1 = "You meet the Official of the Barracks. _Hello, how may I help you?_";

 

begintalknode 9;

state = 5 ;

nextstate = 6;

question = "Can I pass through the door?";

text1 = "He checks you out on his check-out paper and then asks the guards to unlock the door. _Ok now you may pass_";

 

Link to comment
Share on other sites

Quote:
having trouble with how to have multiple characters have their own dialogue

I'm not entirely sure what you mean by that. If you mean you can't get the NPCs to open their dialog when you talk to them, you have to select them and set memory cell 3 to the number of their first dialog node.

Quote:
also can someone help me in how to script opening doors when you talk to a certain person?

If you mean unlock a door, here's how you do it:
In the BoA Editor, select the door you want. Set memory sells 2 and 3 to coordinates for a Stuff Done Flag. In the code section of the dialog node that opens the door set the flag to 1. Then the door will be unlocked.
Link to comment
Share on other sites

Are you sure that you have set each character's memory cell 3 correctly to correspond to the node at which it should being talking? You may also want to assign a unique personality number to each character and to the corresponding nodes, although I don't think that leaving that out would produce problems like what you describe. (I regret that it's been rather a long time since I've actually written any dialogue code.)

 

To your second question: That depends, possibly, on whether you want to literally open a door, or unlock a locked door. For either one, you want to use the code section of the relevant dialogue node. To open a closed door, all you have to do is place a call to set_terrain() in the code section, which sets the terrain on the space in question to be the appropriate open door. If you want to unlock a locked door, the easiest way would be to set the memory cells of the door so that it checks a Stuff Done Flag to see whether it is in fact locked. Then all you have to do is use the set_flag() call from your dialogue node's code section to set the flag you chose to be used by that door.

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