Author Topic: Dialogue Help  (Read 358 times)

Legacy_redmokah

  • Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Dialogue Help
« on: February 14, 2011, 09:45:56 pm »


               I'm new to the modding scene, so I have a very basic question about dialogue. Say I have a NPC called Wrex and my PC is called Shepard.

Shepard: Hello, I'm Shepard.
Wrex: I'm Wrex.

The next two dialogue options are:

1. Why are you on my ship?
2. Why can't you reproduce?

What I want is for dialogue option 1 to disappear after it has been selected. For example, I choose dialogue option 1:

Wrex: You asked me to tag along.

The dialogue returns to the original root.

1. Why are you on my ship? [except this option no longer shows up]
2. Why can't you reproduce?

Much thanks to anyone who can point me in the right direction (:
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Dialogue Help
« Reply #1 on: February 15, 2011, 12:04:04 am »


               In the Text Appears tab of the first convo node you will need a small script that will test weather or not the node has been choosen before.



In the tab of the PCs answer for that node: You asked me to tag along, you will need a small script in the Action Taken tab to mark the PC as having choosen that node previously. Now the methodology to do so is dependent on your mod type. Is is single player, or multiplayer? Does your PC have a no drop item that variables can be stored on? Or are you using databases to keep up with PC info?

               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Dialogue Help
« Reply #2 on: February 15, 2011, 12:17:36 am »


               Here is a starting conditional for the Text Appears when tab of the convo node. You will need to fill in the optional stuff at the top. Use either the NO_DROP option or the DATABASE option by adding ither the tag of the nodrop item or the name of the database at the appropriate place.

[nwscript]
const string NO_DROP = "";
const string DATABASE = "";
const string VAR_NAME = "";//you must fill in this with a variable name

int StartingConditional()
{
  object oNoDrop;

  //This would be the nodrop item option
  if(NO_DROP != "")//if you have added a tag in the above NO_DROP option
  {//get the variable off the nodrop item possessed by the PC
       oNoDrop = GetItemPossessedBy(GetPCSpeaker(), NO_DROP);
       if(GetLocalInt(oNoDrop, VAR_NAME) == 1)return FALSE; return TRUE;
  }
  if(DATABASE != "")//if you have added a DB string name to the DATABASE option above
  {//get the variable from the database
       if(GetCampaignInt(DATABASE, VAR_NAME, GetPCSpeaker()) == 1)return FALSE;
       return TRUE;
  }

   if(DATABASE == "" && NO_DROP == "")//this option assumes the info has been stored on the PC
   {
       if(GetLocalInt(GetPCSpeaker(), VAR_NAME) == 1)return FALSE; return TRUE;
   }

   return TRUE;//default option will always show the node

}[/nwscript]
               
               

               


                     Modifié par Baragg, 15 février 2011 - 12:17 .
                     
                  


            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Dialogue Help
« Reply #3 on: February 15, 2011, 12:22:24 am »


               This would go on the Action Taken tab of the PC response to the 1st convo node.

[nwscript]
const string NO_DROP = "";
const string DATABASE = "";
const string VAR_NAME = "";//you must fill in this with a variable name


void main()
{
   object oNoDrop;

  //This would be the nodrop item option
  if(NO_DROP != "")//if you have added a tag in the above NO_DROP option
  {
       oNoDrop = GetItemPossessedBy(GetPCSpeaker(), NO_DROP);
       SetLocalInt(oNoDrop, VAR_NAME, 1);
       ExportSingleCharacter(GetPCSpeaker());
  }
  if(DATABASE != "")//if you have added a DB string name to the DATABASE option above
  {
       SetCampaignInt(DATABASE, VAR_NAME, 1, GetPCSpeaker());
  }

   if(DATABASE == "" && NO_DROP == "")//this option assumes the info has been stored on the PC
   {
       SetLocalInt(GetPCSpeaker(), VAR_NAME, 1);
   }

}[/nwscript]
               
               

               


                     Modifié par Baragg, 15 février 2011 - 12:23 .
                     
                  


            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Dialogue Help
« Reply #4 on: February 15, 2011, 12:23:18 am »


               Blah, double posted.
               
               

               


                     Modifié par Baragg, 15 février 2011 - 12:24 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Dialogue Help
« Reply #5 on: February 15, 2011, 01:40:17 am »


               1 Select the line you want to do this with in the conversation editor.

2 Select the 'Text Appears When...' tab in the lower righ corner

3 click on the 'Red wizard Hat' Icon next to the edit buton.

4 in the windo that pops up,  Check the Local Variable option.

5 click next.

6 in the next window  Make the Top read.  'int'   'Question_ship'   'is equal to'  '0'

7 Click Add then Next. .

8  In this window you want to give your script a unique name.   something like sc_ship_question

9 click finish. 



10.  now click on the action taken tab.

11 Click the wizards hat again on this tab. 

12 select 'Set Local Varaiable.  and click next.

13  Get the top part to read : SetLocalvariable 'int'  'Question_ship' to the value 'constant int'  '1'

14 click add.  then next.

14 give it a unique name like 'at_Question_ship' and click finish. 

And you are done.
               
               

               
            

Legacy_redmokah

  • Newbie
  • *
  • Posts: 37
  • Karma: +0/-0
Dialogue Help
« Reply #6 on: February 15, 2011, 03:40:19 am »


               Thanks to the both of you (:

I wasn't sure if I was going to have to write some script to make it happen or if there was an easier, built-in function that helped form branching dialogue options.

It's a simple dialogue so I won't need anything fancy. I'm just going to use a boolean varaible as a check.

However, thanks for dropping the knowledge because I'm sure I'll run across more advanced dialogue trees in the future.
               
               

               


                     Modifié par redmokah, 15 février 2011 - 03:43 .