My apologies to anyone who has
tried to use my scripts I put on this thread on page 30. I had
altered the scripts before posting but I didn't test them. They
appear not to be working. When you remove the underscore "_" in
the string "FirstConversation_", everything appears to work
again. I have reposted my original post with the corrected
scripts (I can't edit my original post).
1. Script name: Generic Remember NPC Talked Before
2. What it does: set and test a local int on the PC (the name of
the int is based on the tag of the NPC the PC talks to) to
remember that the NPC has spoken his first line of dialogue
(with greetings and introductions). These scripts can be used
for any conversation with any NPC. So it is not necessary to
write scripts for every NPC.
3. Notes: See comment in scripts for more information.
I don't know if this has been done before, but I find that it
will make your life a lot easier when you have lots of NPCs and
conversations.
4. The scripts.
conv_set (sets the int):
NWScript:
void main()
{
string oName = GetTag(OBJECT_SELF);
string FirstConversation = "FirstConversation" + oName;
SetLocalInt(GetLastSpeaker(),FirstConversation,1);
}
conv_true (checks the int to see if it is true):
NWScript:
int StartingConditional()
{
string oName = GetTag(OBJECT_SELF);
string FirstConversation = "FirstConversation" + oName;
if (!(GetLocalInt(GetLastSpeaker(),FirstConversation) == 1))
return FALSE;
return TRUE;
}
conv_false (checks the int to see if it is false):
NWScript:
int StartingConditional()
{
string oName = GetTag(OBJECT_SELF);
string FirstConversation = "FirstConversation" + oName;
if (!(GetLocalInt(GetLastSpeaker(),FirstConversation) == 0))
return FALSE;
return TRUE;
}
|