Jump to content

Home

dialog bubble question - tsl


Recommended Posts

I want to make a dialog that consists only of bubbles for a npc character. It consists of 3 different statements that pop up each time you click on the character...like what happens with certain random soldiers or commoners.

 

I found this tidbit by Stoffe the great.

 

If you mean speaking with "floating bubbles" over their heads instead of cutscene/dialog mode there are two ways of doing this that I am aware of.

You can lay out the entire "conversation" in a script using delayed BarkString() function calls. The disadvantage of doing this is that the script can get quite large if it's a long conversation, and you have to manually handle everything in the script that dialog files usually do for you (delays between barks etc). The largest disadvantage is that BarkString() won't take string constants, thus your text must be added to the dialog.tlk file.

 

 

Alternatively you can use normal DLG files for this. A dialog branch with only one entry will be "barked" with a speech bubble instead of going into dialog mode. Thus you can add all the conversation lines as entries under the root node (instead of building a dialog tree as usual) and then have a conditional script on each entry to check what "stage" the conversation is in to determine which entry should be used. Each entry would also have an Action script that increments the Stage (a LocalNumber would work to keep track of the stage) and re-starts the conversation to make the next entry show.

 

How would I script the section in yellow? The conditional and the action. Thanks for any help

Link to comment
Share on other sites

You would have to use Global Numbers. The first dialog node could have a conditional that checks for a certain number than e.g.

 

int StartingConditional()
{
  int i = GetGlobalNumber(dlg_check);

  if (i == '1')
  {
      return true;
  }
}

 

That dialog node would then set the global number one higher

 

void main()
{
  SetGlobalNumber(dlg_check, 2);
}

 

This process would then be repeated with each number.

 

Sorry if I didn't go into enough depth. A week away with 21 other teenagers really takes it out of you :p

 

If you have any problems just ask :D

Link to comment
Share on other sites

The first script you posted Timbob won't compile. I've tried fixing it with some results at least.

 

int StartingConditional()
{
int iResult;

  iResult = GetGlobalNumber("MERC_ASSIGN");

  if (iResult == 4)

      return iResult;
}

 

The only problem now is it says not all paths return a result.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...