The order of a conversation has to be created in a step fashion.
Conversation Tree Example.
+ Well, here we are. Do you have anything to ask me? (TEXT APPEARS SCRIPT)
We have no more time to talk. Let's go! (TEXT APPEARS SCRIPT)
+ Hello there. We've never met before. (ACTIONS TAKEN SCRIPT)
+
Hello There. We've never met before -
This line has nothing. No TEXT APPEARS because it's the line you want to appear the first time the player meets the NPC.
Somewhere along this conversation tree, you need to create an ACTIONS_TAKEN script to set a variable. This variable will be used on the conversation node above.
An example of an ACTIONS_TAKEN script to set a variable.
void main()
{
SetLocalInt(GetPCSpeaker(), "metcoolnpc", 1);
}
The conversation node -
We have no more time to talk. Let's go - requires a TEXT APPEARS script.
This script checks the variable that was just set. If it equals 1, we know the player has met the NPC and the -
Hello there. We've never met before - conversation node has fired and been read by the player.
An example of a TEXT APPEARS script to check a variable.
int StartingConditional()
{
if (!(GetLocalInt(GetPCSpeaker, "metcoolnpc") == 1)) return FALSE;
return TRUE;
}
The conversation node -
We'll, here we are. Do you have anything to ask me? - requires a TEXT APPEARS script as well just like above.
Here's another example -
int StartingConditional()
{
if (!(GetLocalInt(GetPCSpeaker(), "spawnednameoftown") == 1)) return FALSE;
return TRUE;
}
Now in the OnEnter of your TOWN or AREA, you'll want to set this variable and make it unique to the AREA. This is so the conversation tree knows you're in that area. For your OnExit of the AREA, you'll want to set it back to 0, so the scripts know you've left the area and cannot fire that part of the conversation until you return.
Here is an example of an OnEnter and OnExit for an AREA.
ON ENTER
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
SetLocalInt(oPC, "spawnednameoftown", 1);
}
ON EXIT
void main()
{
object oPC = GetExitingObject();
if (!GetIsPC(oPC)) return;
SetLocalInt(oPC, "spawnednameoftown", 0);
}
Hope that gives you some thing to work with.
FP!
Modifié par Fester Pot, 08 décembre 2010 - 05:01 .