Aller au contenu

Photo

NPC is following tag based WPs but wont talk to PC


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

#1
Corvittin

Corvittin
  • Members
  • 23 messages

hi 

 

a city guard spawns by night and following their tag based waypoints. but when players tries to talk with him he isnt responding to player. just following WPs. his on_convo script is like that.

void main()
{
object oSelf=OBJECT_SELF;
int nRndm=d4();
string sMsg2="b";
string sMsg3="c";
string sMsg4="d";
if (nRndm == 1)
	{
		int nHour=GetTimeHour();
		if (nHour > 6 && nHour < 17)
			{
			AssignCommand(oSelf,ActionSpeakString("Have a Good Day Citizen."));
			}
		else
			{
			AssignCommand(oSelf,ActionSpeakString("Have a Good Night Citizen."));
			}
	
	}
if (nRndm == 2)
	{
	AssignCommand(oSelf, ActionSpeakString(sMsg2, TALKVOLUME_TALK));
	}
if (nRndm == 3)
	{
	AssignCommand(oSelf, ActionSpeakString(sMsg3, TALKVOLUME_TALK));
	}
if (nRndm == 4)
	{
	AssignCommand(oSelf, ActionSpeakString(sMsg4, TALKVOLUME_TALK));
	}
}

this script is working on a standing guard. but not working on wp following guard.

 



#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
My guess is he is busy so you need to clear his actions and afterward restart him walking. I'm sure this has been covered in the forums before so do a little searching and you will probably find the solution.

Regards

#3
Tchos

Tchos
  • Members
  • 5 054 messages

Or use SpeakString instead of ActionSpeakString.  The latter waits until the NPC is done with its action queue before speaking, and the former speaks immediately.



#4
Corvittin

Corvittin
  • Members
  • 23 messages

thank you guys i will check on this...

 

EDIT:

 

Kaldor Silverwand and Tchos, Thank you guys for your attention. using speakstring solved the problem. Becouse Npc have several actions to do speakstring wont occur as an action. its executing command immediately.