Small script help

Post » Fri Dec 16, 2011 3:34 pm

Hi all. Been playing with a script. Not really done much scripting for morrowind at all.

Begin Scriptshort doOnceif ( doOnce != 0 )	Returnendifif ( GetDistance Player < 150 )	ForceGreeting	set doOnce to 1endifShort do_onceIf ( doOnce == 0 )	AiTravel, 454144, 44816, 256		AiTravel, 454400, 44944, 192		AiTravel, 454560, 45232, 176	AiTravel, 454512, 45776, 288	AiTravel, 454752, 45920, 288	AiTravel, 455168, 45664, 272	AiTravel, 455264, 45456, 240	AiTravel, 455040, 45040, 224	AiTravel, 455072, 44848, 272	AiTravel, 455296, 44720, 400	AiTravel, 455552, 44704, 496	AiTravel, 455808, 44448, 592	AiTravel, 456080, 44112, 720	AiTravel, 456512, 44256, 736	Set do_once to 1endifEnd TravelGetAIPackageDone ( returns Boolean/short )	if ( GetAIPackageDone == 1 )	ForceGreetingshort doOnceEnd


This is what I have so far, and it works to a certain degree. Basically, when your within 150 gam units of the NPC, he greets you, you talk, and on closing the chat menu he walks to another location and stops.

Now...

What i don't know how to do is make it so that he stops walking when im too far away, and, I'd also like the NPC to open up the chat window again when he stops walking and im close enough to him again.

Like I said, morrowind scripting isnt something ive used before so any pointers would be great. I am using the MSFD which is a great help, I just can't seem to figure this bit out.

Thanks alot in advance people

-SGM
User avatar
Killer McCracken
 
Posts: 3456
Joined: Wed Feb 14, 2007 9:57 pm

Post » Fri Dec 16, 2011 5:20 pm

You need to use AIEscort.

Also in between each walking location you need to check and make sure the NPC has completed the previous task by using GetAIPackageDone == 1 along with state to make sure the NPC isn't skipping destinations.

MWSD Is the best guide there is. Look at the index for AI and scripting NPC Movement.
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm


Return to III - Morrowind