Aller au contenu

Photo

Script to Follow PC then Start Conversation?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Ugly_Duck_01

Ugly_Duck_01
  • Members
  • 69 messages
I got the follow part down, but I cant seem to get the NPC to talk to the player.  Having the NPC force start a conversation with PC, and make it so the PC cannot move while in conversation.

Any help would be great - thanks in advance!

#2
Tchos

Tchos
  • Members
  • 5 042 messages
To make it so that the PC cannot move, activate the box in the conversation properties that says "Multiplayer cutscene". This works whether or not it's a cutscene-style conversation. It also prevents the player from escaping from the conversation, so be sure there's always a farewell/end dialogue line.

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
The conversation script ga_party_freeze will make the entire party uncommandable. Not only can't you choose to exit the conversation (as per Tchos's "Multiplayer Cutscene" suggestion), but companion AI is also suppressed. Using both would make sure no-one does anything you don't want them to.

Make sure you put ga_party_unfreeze on every possible end node of the conversation though, otherwise your companions will ignore you completely from then on.

Modifié par DannJ, 19 février 2014 - 04:47 .


#4
Loki_999

Loki_999
  • Members
  • 430 messages
Sometimes the NPC AI likes to think it knows better than any commands you give as well, so its not a bad idea to set the NPC AI to off/low before you trigger the AssignCommand for the convo.

#5
Ugly_Duck_01

Ugly_Duck_01
  • Members
  • 69 messages
im using Liloc Souls script generator. I don't know how to shut off the creature's AI via script. I checked the script generator's functions but nothing whas there. Help plz?

#6
Ugly_Duck_01

Ugly_Duck_01
  • Members
  • 69 messages
NM! I figured it out. If anyone else needs to know how to do this, here is the script:

//Goes OnPerceived of a creature
void main()
{

object oPC = GetLastPerceived();

if (!GetIsPC(oPC)) return;

if (!GetLastPerceptionSeen()) return;
ActionForceFollowObject(oPC);

ClearAllActions();

object oTarget;
oTarget = GetObjectByTag("CREATURE_TAG_HERE");

AssignCommand(oTarget, ActionStartConversation(oPC, "CONVO NAME HERE"));

}

Modifié par Ugly_Duck_01, 19 février 2014 - 01:09 .


#7
Loki_999

Loki_999
  • Members
  • 430 messages
No idea about Lilac Soul's Script generator, i write code myself.

You can use a function like: SetAILevel - http://www.nwnlexico...itle=SetAILevel

And just remembered, its often useful to clear action queues before issuing new commands. For this use: ClearAllActions - http://www.nwnlexico...ClearAllActions

Remember to use AssignCommand to direct the action to the NPC if the calling script is not being called by the NPC itself.

PS: If the above is out of your comfort zone, sorry, i'm just used to doing scripting directly.

Modifié par Loki_999, 19 février 2014 - 01:11 .