PDA

View Full Version : Is this possible?


Pavlos
10-25-2005, 06:02 AM
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?

Darth InSidious
10-25-2005, 06:53 AM
Different dialogue nodes, and a conditional script should do it....I think.

Pavlos
10-25-2005, 03:19 PM
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;
}



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

Darkkender
10-25-2005, 04:05 PM
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;
}

Pavlos
10-25-2005, 04:19 PM
Ok, I created that one for the [Repair] Option so that when it is a success you get the
SetGlobalNumber("001ebo_3cfd_repaired", 1);
so if I wanted to then check that that had been set would I do,

int StartingConditional()
{
return (GetGlobalNumber ("001ebo_3cfd_repaired") == 1);
}
?

Darth333
10-25-2005, 04:22 PM
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

Pavlos
10-25-2005, 04:49 PM
Thanks a lot I've got it now. What my problem was was that my changed option was below the default one, is there any way to start a new entry above an already entered one, as cutting and pasting seems to mess it up slightly.