Jump to content

Home

Is this possible?


Pavlos

Recommended Posts

Again, I'm sorry but I did search for this and whether or not it is because I didn't specify correctly in the search or because I looked over it I don't know. How would I go about having a certain dialogue option that once said when you open up the conversation again it will produce a different greeting response from the default

For Example:

 

Normal Greeting: Greetings, I am Pavlos, how may I be of service

WE GO THROUGH LOADS AND LOADS OF DIALOGUE OPTIONS

[Repair] Rewire the droid so it recognises you as master

Blah blah responses

Close dialogue

open Dialogue

Greetings, master, how can I help you today?

 

How can I do that?

Link to comment
Share on other sites

Ok so how would I go about doing that? Would this work?



int StartingConditional()
{
object oPC= GetPCSpeaker();

int nSkill = GetSkillRank(SKILL_REPAIR, oPC);
if (nSkill>= 5)
{
return TRUE;
SetGlobalNumber("001ebo_3cfd_repaired", 1);
}
return FALSE;
}

[/Code]

 

I don't know I followed the short tutorial and I don't think it would work.

Link to comment
Share on other sites

The best example to work with would be from Kotor 1. Extract one of the Main NPC dialogues such as HK-47. With one of the dialogue editors view your dialogue and you will see some sort of field at the bottom stating script conditional or something like that. For many of the branched script greetings you'll see a script listed there. The sample script you posted above would be a good conditional script to use there.

 

Of course your script should look like the following if all it is doing is checking the single conditional.

void main()
{
   object oPC= GetPCSpeaker(); 

   int nSkill = GetSkillRank(SKILL_REPAIR, oPC);
   if (nSkill>= 5)
   {
       return TRUE;
       SetGlobalNumber("001ebo_3cfd_repaired", 1); 
   }
   return FALSE;
}

Link to comment
Share on other sites

Ok, I created that one for the [Repair] Option so that when it is a success you get the

 SetGlobalNumber("001ebo_3cfd_repaired", 1); [/Code]

so if I wanted to then check that that had been set would I do,

[Code]
int StartingConditional()
{
return (GetGlobalNumber ("001ebo_3cfd_repaired") == 1);
}
[/Code]

?

Link to comment
Share on other sites

err...

you have to use int StartingConditional and not void main() and place your script in the conditional script field that determines whether the conversation node will be available.

int StartingConditional()
{
   object oPC= GetPCSpeaker(); 

   int nSkill = GetSkillRank(SKILL_REPAIR, oPC);
   if (nSkill>= 5)
   {
       return TRUE;
   }
   return FALSE;
}

 

 

 

Then, in the normal script field (script that is fired when the dialogue is "spoken" ), you place something like this:

void main()
{
SetGlobalNumber("001ebo_3cfd_repaired", 1); 
}

 

While you may use use a GlobalNumber or GlobalBoolean for this, it may be overkill depending on what you want to do. If you want an npc to say something only one time you would be better using a LocalBoolean. Local variables are stored on an object and Globals affect the whole game. Also, local variables do not require you to edit globalcat.2da. Use globals when you need to keep track of a quest, of the actions of your PC, per example.

 

Finally, also note that in TSL, you don't need to make a script to set a global variable: just type in a_global_set or a local_set (I think that's the correct .nss but double check it as I don't have the game with me) and then use the parameter fields: http://img.photobucket.com/albums/v144/Darth333/paramcopy.jpg

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...