Making NPCs Initiate Dialogue (untested, but should work)
When the NPC sees a PC, he or she will walk up to the PC and start a conversation.
This will not work if the PC starts visible to the NPC (no OnPercieve event fires).
Create an OnSpawn (by editing the standard OnSpawn) with: SetSpawnInCondition (NW_FLAG_PERCIEVE_EVENT); uncommented.
In your NPC's dialogue file, go to the very first line where he starts his dialogue with
the PC. If you only want him to start this with any given PC once, add the following script
into Actions Taken:
This sets the variable that is used in the script you were using, so the dialogue
isn't done more than once. Now create a new script in the OnUserDefined event for your NPC.
You can put that second script in here, as follows:
Now the first time the NPC COMES INTO SIGHT of the player, he should apporach and start his conversation. By adding a second conversation branch, you can mek him say someting else when the PC come up to him later.
Should work *crosses fingers*
As for making them move....
-Jam
When the NPC sees a PC, he or she will walk up to the PC and start a conversation.
This will not work if the PC starts visible to the NPC (no OnPercieve event fires).
Create an OnSpawn (by editing the standard OnSpawn) with: SetSpawnInCondition (NW_FLAG_PERCIEVE_EVENT); uncommented.
In your NPC's dialogue file, go to the very first line where he starts his dialogue with
the PC. If you only want him to start this with any given PC once, add the following script
into Actions Taken:
Code:
void main() { SetLocalInt(GetPCSpeaker(), "Dlg_Init_" + GetTag(OBJECT_SELF), TRUE); }
isn't done more than once. Now create a new script in the OnUserDefined event for your NPC.
You can put that second script in here, as follows:
Code:
void main() { int nEvent = GetUserDefinedEventNumber(); if (nEvent == 1002) // OnPerceive event { object oPC = GetLastPerceived(); if(GetIsPC(oPC) && GetLocalInt(oPC, "Dlg_Init_" + GetTag(OBJECT_SELF)) == FALSE && !IsInConversation(OBJECT_SELF)) { ClearAllActions(); AssignCommand(oPC, ClearAllActions()); ActionMoveToObject(oPC); ActionStartConversation(oPC); } } }
Should work *crosses fingers*
As for making them move....
-Jam
Comment