Jump to content

Home

[K1] Dialog Progression Script


Recommended Posts

I have a question about the script I'm utilizing in my dialog. At the moment, I'm looking at the Recruit Mekel, Recruit Kay, and Jolee's dialog files as guides. I'm trying to begin a dialog progression tree for my recruit character, for example...

 

Never talked to before: Have anything to say about your self?

Talked to once and leveled up: Can you tell me about your childhood?

Talked to twice and leveled up again: Tell me about your journeys on Korriban? etc.

 

I'm using this script to try to get rid of the first dialog option to prepare the way for the second. However, the 1st dialog option never disappears, and you can select it infinitely. Can someone look at this script and tell me if there are any problems with it?

 

void main()
{
   int nPlot = GetGlobalNumber("K_SWG_ZAEN");
   int nLevel = GetHitDice(GetFirstPC());
   SetGlobalNumber("K_SWG_ZAEN", (nPlot + 1));
   SetGlobalNumber("K_SWG_ZAEN_LEVEL", nLevel);
}

Link to comment
Share on other sites

I'm using this script to try to get rid of the first dialog option to prepare the way for the second. However, the 1st dialog option never disappears, and you can select it infinitely. Can someone look at this script and tell me if there are any problems with it?

 

Show spoiler
(hidden content - requires Javascript to show)
void main()
{
   int nPlot = GetGlobalNumber("K_SWG_ZAEN");
   int nLevel = GetHitDice(GetFirstPC());
   SetGlobalNumber("K_SWG_ZAEN", (nPlot + 1));
   SetGlobalNumber("K_SWG_ZAEN_LEVEL", nLevel);
}

 

There is nothing wrong with that script on it's own. However, it requires that the K_SWG_ZAEN and K_SWG_ZAEN_LEVEL global number variables are added to the globalcat.2da file to work properly.

 

It also requires dialog conditional scripts that checks for the level change to enable the other dialog nodes. Something like:

 

talked to once and leveled up:

int StartingConditional() {
   int iLvl = GetGlobalNumber("K_SWG_ZAEN_LEVEL");
   int iPlot = GetGlobalNumber("K_SWG_ZAEN");

   if ((GetHitDice(GetFirstPC()) > iLvl) && (iPlot == [color=Yellow]1[/color])) {
       SetGlobalNumber("K_SWG_ZAEN", ++iPlot);
       SetGlobalNumber("K_SWG_ZAEN_LEVEL", GetHitDice(GetFirstPC()));      
       return TRUE;    
   }
   return FALSE;
}

 

talked to twice and leveled up again:

int StartingConditional() {
   int iLvl = GetGlobalNumber("K_SWG_ZAEN_LEVEL");
   int iPlot = GetGlobalNumber("K_SWG_ZAEN");

   return ((GetHitDice(GetFirstPC()) > iLvl) && (iPlot == [color=Yellow]2[/color]));
}

 

This assumes that the K_SWG_ZAEN variable starts out at 0, gets increased to 1 in the script you posted (which would be run as an action script on one of the nodes when first talking to them), and that this number isn't increased anywhere else. If the K_SWG_ZAEN is used for other purposes as well, and thus you can't be sure of what its value is, it might be better to create a new one.

 

In the dialog tree you place the node with the conversation after having leveled up twice at the top, followed by the node with conversation after having leveled up once, and with the node with the first time conversation at the bottom of the entry list.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...