FANDOM


NPC remembers he spoke to PC before Edit

What it does Edit

Some easy functions that can be used for checking and setting if a PC has talked to an NPC before.


Notes Edit

When you meet an NPC, he always introduces himself. When you talk to him again, it isn't necessary for the NPC to repeat his introduction. When you want to do this, you have to set a local int on the PC/module/NPC/... so that he remembers this. I've made 2 functions that can be used for every NPC to set and check the fact that he has spoken to the PC. The int which will contain the information is stored on the PC and uses the tag of the NPC (so make sure you have unique tags!). It is also possible to check the int of an NPC different from the one you're talking to (eg: you can only ask NPC_1 about the strange behaviour of NPC_2 when you've already met NPC_2). I've put the two functions in an include file so they can be used in combination with other checks.

An example of a dialogue:

1 Greetings, I am NPC_1 > It's nice to meet you, I am <FullName>. 2 Welcome back, <FullName>. It is good to see you again.

Put the script "_ch_001" in the text appears when tab of line 1. Put the script "_at_001" in the actions taken tab of line 1. Put the script "_ch_002" in the text appears when tab of line 2. (See below for the scripts and the include file)

As you can see: this is nothing fancy, but it'll make the life of a designer a bit easier (less scripting required since the 3 scripts are useable for any NPC).

Send comment, questions and suggestions to wim_haeck@hotmail.com or send me a message on the bioware forums (username: thadeus).


The scripts itself Edit

The include file (save this as "include_dialogue"):



== The script "_ch_001" ==
<pre>
#include "include_dialogue"
int StartingConditional()
{
    // returns TRUE if this is the first time that the PC speaks with the NPC
    return (!GetSpokeBefore(GetPCSpeaker()));
}


The script "_at_001" Edit

#include "include_dialogue"
void main()
{
    SetSpokeBefore(GetPCSpeaker());
}


The script "_ch_002" Edit

#include "include_dialogue"
int StartingConditional()
{
    // returns TRUE if this isn't the first time that the PC speaks with the NPC
    return (GetSpokeBefore(GetPCSpeaker()));
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.