Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

dialog bubble question - tsl

Page: 1 of 1
 newbiemodder
06-03-2011, 9:36 AM
#1
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
 TimBob12
06-03-2011, 11:03 AM
#2
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
 newbiemodder
06-03-2011, 2:23 PM
#3
Thanks TB...I didn't use your script but it put me on the right path...I decided to use local numbers rather than global

If anyone interested I found this thread to be useful

http://www.lucasforums.com/showthread.php?t=178525&highlight=setlocalnumber+script)
 Fallen Guardian
06-03-2011, 9:36 PM
#4
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.
Page: 1 of 1