Scripting tutorials?

Post » Sun Jan 24, 2010 10:08 pm

[Not really following the script development -> commenting on something it made me think of]

Ive been modding for a while, and i honestly cant remember the last time i had to force add a Topic to an NPC.. cant scripting their appearance be managed far easier through conditions in the dialogue? (dont read that as a question, its a statement of fact ;) )

Maybe i rely more on Quest/journal stages to manage things.. Or maybe your modding on an existing NPC? That would make sense. I try to mod existing NPC's as little as possible to reduce incompatabilities with other mods and people's games.
:obliviongate:
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Mon Jan 25, 2010 5:31 am

I would suggest putting in a few MessageBox commands so you can see what's happening.

For instance:

if ( timer >= 15.0 )        if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.                setHello 30 ;sets Tii Guar back to being able to initiate dialogue                set supplies to 3                set acompanion to 1                set timer to 0                MessageBox "Timer done!"


elseif ( supplies == 3 )        if ( GetDistance, Player <= 200 )                       MessageBox "Player is close enough!"                if ( greeting == 1 )                        ForceGreeting                        ;this is where set repair to 1 will be.                        set supplies to 5 ;change to 0 when repair feature is implemented.                endif        endifendif 

User avatar
Taylah Illies
 
Posts: 3369
Joined: Fri Feb 09, 2007 7:13 am

Post » Mon Jan 25, 2010 3:36 am

[Not really following the script development -> commenting on something it made me think of]

Ive been modding for a while, and i honestly cant remember the last time i had to force add a Topic to an NPC.. cant scripting their appearance be managed far easier through conditions in the dialogue? (dont read that as a question, its a statement of fact ;) )

Maybe i rely more on Quest/journal stages to manage things.. Or maybe your modding on an existing NPC? That would make sense. I try to mod existing NPC's as little as possible to reduce incompatabilities with other mods and people's games.
:obliviongate:


No I have not modded any existing NPC in any way, the reason I add the topics in the script is because they are simpler to deal with.

I would suggest putting in a few MessageBox commands so you can see what's happening.

For instance:

Spoiler
if ( timer >= 15.0 )        if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.                setHello 30 ;sets Tii Guar back to being able to initiate dialogue                set supplies to 3                set acompanion to 1                set timer to 0                MessageBox "Timer done!"


Spoiler
elseif ( supplies == 3 )        if ( GetDistance, Player <= 200 )                       MessageBox "Player is close enough!"                if ( greeting == 1 )                        ForceGreeting                        ;this is where set repair to 1 will be.                        set supplies to 5 ;change to 0 when repair feature is implemented.                endif        endifendif 



That is a good idea thank you. Do you think there is a problem with the timer not setting proper variables? Because it just doesn't force it. Though I get the proper dialogue.. this is strange.

I'll test it out and post.

EDIT~~~~~~~~~~

Alright so I tested it, and after tweaking location in the timer it worked.

Spoiler
if ( timer >= 15.0 )	if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.		setHello 30 ;sets Tii Guar back to being able to initiate dialogue		set supplies to 3		set acompanion to 1		set timer to 0		MessageBox "Timer done!"	else		set timer to ( timer + GetSecondsPassed )	endifendif


and when I changed it to this the timer message box showed up.

Spoiler
if ( timer >= 15.0 )	if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.		setHello 30 ;sets Tii Guar back to being able to initiate dialogue		set supplies to 3		set acompanion to 1		MessageBox "Timer done!"		set timer to 0	else		set timer to ( timer + GetSecondsPassed )	endifendif


But the message box for being close enough to the player never came up... What could be the problem?
User avatar
anna ley
 
Posts: 3382
Joined: Fri Jul 07, 2006 2:04 am

Post » Mon Jan 25, 2010 2:20 am

There is no effective difference between those snippets of code. All instructions within a conditional are executed sequentially, until some instruction (return, elseif, else, endif) halts that.

Having the timer increment within the timer conditional seems self-defeating, but I'm not sure how you're trying to set that up. Is something like this what you want?

if ( timer < 15.0 )    Set timer To ( timer + GetSecondsPassed )else    if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.        SetHello 30 ;sets Tii Guar back to being able to initiate dialogue        Set supplies To 3        Set acompanion To 1        MessageBox "Timer done!"        Set timer To 0    endifendif


That will count up to 15, then wait until the AI package is not 1. To wait for the AI, then count, just reverse the conditions (and move the timer inc block inside the AI if).
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Mon Jan 25, 2010 3:13 am

No the problem isn't with the timer at all, the timer is setting all variables at the right time and is all running smoothly. The point I was trying to make was that the message box didn't come up when the:

MessageBox "Timer done!" was after set timer to 0

But when I placed it before set timer to 0 it showed up.



But my problem has nothing to do with that, my problem is that ForceGreeting isn't working.

Here is the code, The first ForceGreeting works great.

So let me explain my problem in more detail, the second ForceGreeting may not be working, but if I manually talk to the NPC I get the proper dialog then if I close out and open it back up that dialog is gone just as it is supposed to run, the only problem is that when she is set to acompanion and therefor set to follow you, I want her to walk up to you then once she is close enough initiate the second ForceGreet.


Spoiler
begin "Tii_Guar_Companion_Script";Variables.short topics ;used to add all necessary topics at the right times to Tii Guar.short acompanion ;used for setting AI to follow player.short objectCount ;used for checking how many arrows Tii Guar has.short supplies ;used for the feature of resupplying Tii Guars inventory.short greeting ;used for checking distance for force greet.short repair ;used for reparing Tii Guar's equipment.'short NoLore ;used to prevent Tii Guar from having standard Morrowind lore topics.float timer ;used for timing an event for resupplying.;set variables.set objectCount to ( GetItemCount, "chitin arrow" ) ;sets objectCount to the amount of arrows Tii Guar has in her inventory.;control all topicsif ( topics == 0 ) ;topics added the moment you talk to Tii Guar	AddTopic, "Why are you in Seyda Neen?"	AddTopic, "Why do you trade at Arrille's Tradehouse?"	AddTopic, "Why are you a hunter?"	AddTopic, "That is a very nice amulet."	AddTopic, "Who is Hircine?"	AddTopic, "Supplies"	set topics to 1endif;controls setting Tii Guar as a companion.if ( acompanion == 1 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIFollow Player 0, 0, 0, 0 ;sets Tii Guar to Follow player.		endif	endifelseif ( acompanion == 0 )	if ( GetCurrentAIPackage != 0 ) ;if Tii Guar isn't already Wandering.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIWander, 0, 0, 0, 0, 30, 0, 40, 40, 30, 10, 0, 0		endif	endifendif;control timerif ( timer >= 15.0 )	if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.		setHello 30 ;sets Tii Guar back to being able to initiate dialogue		set acompanion to 1		set greeting to 1		set supplies to 3		MessageBox "Timer done!"		set timer to 0	else		set timer to ( timer + GetSecondsPassed )	endifendif;control resupplying (for use with objectCount, timer, timerOn, acompanion, and greeting)if ( GetPCCell "Seyda Neen, Arrille's Tradehouse" == 1 ) ;makes sure Tii Guar and the player are in the right cell.if ( supplies == 0 )	if ( objectCount < 25 ) ;if Tii Guar has less then 25 chitin arrows.		if ( acompanion == 1 )			set supplies to 1		else			Return		endif ;only ends checking if Tii Guar is your companion.	endif ;only ends checking objectCount.elseif ( supplies == 1 )	if ( GetDistance, Player <= 200 )		if ( greeting == 0 )			ForceGreeting			set acompanion to 0			set supplies to 2 ;after the greeting is forced moves to the next step.		endif ;only ends checking distance and setting greeting.	endif ;only ends checking greeting.elseif ( supplies == 2 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if (GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			setHello 0 ;makes Tii Guar not initiate voice dialogue wile the walking.			"aa shaddow_Tii Guar"-> AITravel, -324, -64, 387 ;makes Tii Guar start heading up stairs.			set timer to ( timer + GetSecondsPassed ) ;sets proper variables and sets supplies to 3.		endif		endif	endifelseif ( supplies == 3 )	if ( greeting == 1 )		if ( GetDistance, Player <= 200 )			MessageBox "Player is close enough!"			if ( GetLOS Player == 1 )				ForceGreeting				set greeting to 0				;this is where set repair to 1 will be.				set supplies to 5 ;change to 0 when repair feature is implemented.			endif		endif	endifendif ;ends the whole block.endif ;ends checking it Tii Guar and the player are in the right cell.end

User avatar
abi
 
Posts: 3405
Joined: Sat Nov 11, 2006 7:17 am

Post » Sun Jan 24, 2010 11:32 pm

What peachykeen is saying is that the 2 snippets of code where you just moved the MessageBox are essential identical. If one works, the other should work also, unless some other condition is not being met.

peachykeen also raises an interesting point about the timer...

if ( timer >= 15.0 )        if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.                setHello 30 ;sets Tii Guar back to being able to initiate dialogue                set acompanion to 1                set greeting to 1                set supplies to 3                MessageBox "Timer done!"                set timer to 0        else                set timer to ( timer + GetSecondsPassed ) ; THIS is the line in question        endifendif


The line in question increases the timer, but it is already contained within the "if ( timer >= 15.0 )" block, therefore the timer has already reached 15 seconds.

I would recommend something more like what peachykeen suggested, but that will make the timer start straight away, whereas am I right in thinking that you only want the timer to start when supplies == 2?

In which case... oh, here you go ;)

Spoiler
begin "Tii_Guar_Companion_Script";Variables.short topics ;used to add all necessary topics at the right times to Tii Guar.short acompanion ;used for setting AI to follow player.short objectCount ;used for checking how many arrows Tii Guar has.short supplies ;used for the feature of resupplying Tii Guars inventory.short greeting ;used for checking distance for force greet.short repair ;used for reparing Tii Guar's equipment.'short NoLore ;used to prevent Tii Guar from having standard Morrowind lore topics.short timerOnfloat timer ;used for timing an event for resupplying.;set variables.set objectCount to ( GetItemCount, "chitin arrow" ) ;sets objectCount to the amount of arrows Tii Guar has in her inventory.;control all topicsif ( topics == 0 ) ;topics added the moment you talk to Tii Guar        AddTopic, "Why are you in Seyda Neen?"        AddTopic, "Why do you trade at Arrille's Tradehouse?"        AddTopic, "Why are you a hunter?"        AddTopic, "That is a very nice amulet."        AddTopic, "Who is Hircine?"        AddTopic, "Supplies"        set topics to 1endif;controls setting Tii Guar as a companion.if ( acompanion == 1 )        if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.                if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.                        "aa shaddow_Tii Guar"-> AIFollow Player 0, 0, 0, 0 ;sets Tii Guar to Follow player.                endif        endifelseif ( acompanion == 0 )        if ( GetCurrentAIPackage != 0 ) ;if Tii Guar isn't already Wandering.                if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.                        "aa shaddow_Tii Guar"-> AIWander, 0, 0, 0, 0, 30, 0, 40, 40, 30, 10, 0, 0                endif        endifendif;control timerif ( timerOn == 1 )	if ( timer < 15.0 )	    Set timer To ( timer + GetSecondsPassed )	else	    if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.	        SetHello 30 ;sets Tii Guar back to being able to initiate dialogue	        Set supplies To 3	        Set acompanion To 1	        Set timer To 0		MessageBox "Timer done."	    endif	endifendif;control resupplying (for use with objectCount, timer, timerOn, acompanion, and greeting)if ( GetPCCell "Seyda Neen, Arrille's Tradehouse" == 1 ) ;makes sure Tii Guar and the player are in the right cell.	if ( supplies == 0 )	        if ( objectCount < 25 ) ;if Tii Guar has less then 25 chitin arrows.	                if ( acompanion == 1 )	                        set supplies to 1                	else                    	    return                	endif ;only ends checking if Tii Guar is your companion.        	endif ;only ends checking objectCount.	elseif ( supplies == 1 )        	if ( GetDistance, Player <= 200 )                	if ( greeting == 0 )	                        ForceGreeting        	                set acompanion to 0                	        set supplies to 2 ;after the greeting is forced moves to the next step.	                endif ;only ends checking distance and setting greeting.        	endif ;only ends checking greeting.	elseif ( supplies == 2 )	        if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.        	        if (GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.        	                setHello 0 ;makes Tii Guar not initiate voice dialogue wile the walking.                	        "aa shaddow_Tii Guar"-> AITravel, -324, -64, 387 ;makes Tii Guar start heading up stairs.				set timerOn to 1				MessageOn "Timer is on."	                endif        	endif	endif	elseif ( supplies == 3 )        	if ( greeting == 1 )                	if ( GetDistance, Player <= 200 )                        	MessageBox "Player is close enough!"	                        if ( GetLOS, Player == 1 )        	                        ForceGreeting                	                set greeting to 0                        	        ;this is where set repair to 1 will be.                                	set supplies to 5 ;change to 0 when repair feature is implemented.	                        endif        	        endif	        endif	endif ;ends the whole block.endif ;ends checking if Tii Guar and the player are in the right cell.end


I've just made a few tweaks - let me know how it goes, and what messageboxes pop up (including if any pop up multiple times).

Good work so far anyway! Putting in lots of comments is definitely a good thing to do if you're new to scripting. You can go ahead and put in more MessageBoxes if you want, they can help you see what the code is doing, and if it's not working then why it's not working; if you can track down exactly what line it's getting stuck at, you should be able to fix it.

Also, objectcount is being set every frame - is it being used in dialogue or anywhere outside this script? Because otherwise I'd only get the arrow count when you need it.
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Sun Jan 24, 2010 4:48 pm

Alright so testing out your script, it doesn't actually work as I want it to you script has the timer being set but the moment she reaches her destination (about a 15 second venture) it says timer done. My script is working properly though... there are no bugs at all with the timer I made I see what you guys are pointing out and I know what you mean but it still works either way.

Here is what I think the problem is, the timer is setting supplies to 3 and greeting to 1 in which case the requirments have been met with this code (where the problem is):

elseif ( supplies == 3 )	if ( greeting == 1 )		MessageBox "Greeting has been set!"		if ( GetDistance, Player <= 200 )			MessageBox "Player is close enough!"			if ( GetLOS Player == 1 )				ForceGreeting				set greeting to 0				;this is where set repair to 1 will be.				set supplies to 5 ;change to 0 when repair feature is implemented.			endif		endif	endif


But maybe if I were to make it constantly check if the player is close enough then it would work. Maybe an

else
Return

type of thing? What are your thoughts on weather or not this will fix it, and if so where would I place it?
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Sun Jan 24, 2010 4:56 pm

Putting it a "return" statement shouldn't really matter as the script should loop unless it's explicitly terminated.

If those 2 conditions ARE being met, and the player is also in the correct cell, then by process of elimination the GetDistance check must be the problem!

What MessageBoxes are popping up?
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Mon Jan 25, 2010 1:31 am

The only message box I get is "Timer Done!"

I don't get the:

MessageBox "Greeting has been set!"

or the:

MessageBox "Player is close enough!"

:( I don't know what I should do...
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Sun Jan 24, 2010 7:04 pm

Can you post the full code you have at this point? I'd rather not piece it together and have some different.

Your timer before was definitely backwards, but if it was working, then there may be some other issues. You could even have a case of bugs that unbug each other, which is always fun to debug. :P
User avatar
Del Arte
 
Posts: 3543
Joined: Tue Aug 01, 2006 8:40 pm

Post » Sun Jan 24, 2010 3:51 pm

Lol :) That could be it! bugs that go about debugging bugs hmmm.... I should learn how to make those!

Spoiler
begin "Tii_Guar_Companion_Script";Variables.short topics ;used to add all necessary topics at the right times to Tii Guar.short acompanion ;used for setting AI to follow player.short objectCount ;used for checking how many arrows Tii Guar has.short supplies ;used for the feature of resupplying Tii Guars inventory.short greeting ;used for checking distance for force greet.short repair ;used for reparing Tii Guars equipment.short NoLore ;used to prevent Tii Guar from having standard Morrowind lore topics.float timer ;used for timing an event for resupplying.;set variables.set objectCount to ( GetItemCount, "chitin arrow" ) ;sets objectCount to the amount of arrows Tii Guar has in her inventory.;control all topicsif ( topics == 0 ) ;topics added the moment you talk to Tii Guar	AddTopic, "Why are you in Seyda Neen?"	AddTopic, "Why do you trade at Arrille's Tradehouse?"	AddTopic, "Why are you a hunter?"	AddTopic, "That is a very nice amulet."	AddTopic, "Who is Hircine?"	AddTopic, "Supplies"	set topics to 1endif;controls setting Tii Guar as a companion.if ( acompanion == 1 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIFollow Player 0, 0, 0, 0 ;sets Tii Guar to Follow player.		endif	endifelseif ( acompanion == 0 )	if ( GetCurrentAIPackage != 0 ) ;if Tii Guar isn't already Wandering.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIWander, 0, 0, 0, 0, 30, 0, 40, 40, 30, 10, 0, 0		endif	endifendif;control timerif ( timer >= 15.0 )	if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.		setHello 30 ;sets Tii Guar back to being able to initiate dialogue		set acompanion to 1		set supplies to 3		MessageBox "Timer done!"		set timer to 0	else		set timer to ( timer + GetSecondsPassed )	endifendif;control resupplying (for use with objectCount, timer, timerOn, acompanion, and greeting)if ( GetPCCell "Seyda Neen, Arrille's Tradehouse" == 1 ) ;makes sure Tii Guar and the player are in the right cell.if ( supplies == 0 )	if ( objectCount < 25 ) ;if Tii Guar has less then 25 chitin arrows.		if ( acompanion == 1 )			set supplies to 1		else			Return		endif ;only ends checking if Tii Guar is your companion.	endif ;only ends checking objectCount.elseif ( supplies == 1 )	if ( GetDistance, Player <= 200 )		if ( greeting == 0 )			ForceGreeting			set acompanion to 0			set supplies to 2 ;after the greeting is forced moves to the next step.		endif ;only ends checking distance and setting greeting.	endif ;only ends checking greeting.elseif ( supplies == 2 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if (GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			setHello 0 ;makes Tii Guar not initiate voice dialogue wile the walking.			"aa shaddow_Tii Guar"-> AITravel, -324, -64, 387 ;makes Tii Guar start heading up stairs.			set timer to ( timer + GetSecondsPassed ) ;sets proper variables and sets supplies to 3.		endif		endif	endifelseif ( supplies == 3 )	if ( greeting == 1 )		MessageBox "Greeting has been set!"		if ( GetDistance, Player <= 200 )			MessageBox "Player is close enough!"			if ( GetLOS Player == 1 )				ForceGreeting				;this is where set repair to 1 will be.				set supplies to 5 ;change to 0 when repair feature is implemented.			endif		elseif ( GetDistance, Player > 200 )			Return		endif	endifendif ;ends the whole block.endif ;ends checking it Tii Guar and the player are in the right cell.end

User avatar
Jeff Turner
 
Posts: 3458
Joined: Tue Sep 04, 2007 5:35 pm

Post » Mon Jan 25, 2010 1:47 am

Thank you very much arvisrend!!

arvisrend has just helped me get this whole thing working. And you would be surprised to find out what the problem was... An extra endif in the supplies == 2 section.

LOL

Here is the operational script!!

Spoiler
begin "Tii_Guar_Companion_Script";Variables.short topics ;used to add all necessary topics at the right times to Tii Guar.short acompanion ;used for setting AI to follow player.short objectCount ;used for checking how many arrows Tii Guar has.short supplies ;used for the feature of resupplying Tii Guars inventory.short greeting ;used for checking distance for force greet.short repair ;used for reparing Tii Guars equipment.short NoLore ;used to prevent Tii Guar from having standard Morrowind lore topics.float timer ;used for timing an event for resupplying.;set variables.set objectCount to ( GetItemCount, "chitin arrow" ) ;sets objectCount to the amount of arrows Tii Guar has in her inventory.;menus returnif ( MenuMode == 1 )	Returnendif;control all topicsif ( topics == 0 ) ;topics added the moment you talk to Tii Guar	AddTopic, "Why do you trade at Arrille's Tradehouse?"	AddTopic, "Why are you a hunter?"	AddTopic, "That is a very nice amulet."	AddTopic, "Who is Hircine?"	AddTopic, "Supplies"	set topics to 1endif;controls setting Tii Guar as a companion.if ( acompanion == 1 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIFollow Player 0, 0, 0, 0 ;sets Tii Guar to Follow player.		endif	endifelseif ( acompanion == 0 )	if ( GetCurrentAIPackage != 0 ) ;if Tii Guar isn't already Wandering.		if ( GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			"aa shaddow_Tii Guar"-> AIWander, 0, 0, 0, 0, 30, 0, 40, 40, 30, 10, 0, 0		endif	endifendif;control timerif ( timer >= 15.0 )	if ( GetCurrentAIPackage != 1 ) ;if Tii Guar has made it to her destination.		setHello 30 ;sets Tii Guar back to being able to initiate dialogue		set acompanion to 1		set supplies to 3		set timer to 0	else		set timer to ( timer + GetSecondsPassed )	endifendif;control resupplying (for use with objectCount, timer, timerOn, acompanion, and greeting)if ( GetPCCell "Seyda Neen, Arrille's Tradehouse" == 1 ) ;makes sure Tii Guar and the player are in the right cell.if ( supplies == 0 )	if ( objectCount < 25 ) ;if Tii Guar has less then 25 chitin arrows.		if ( acompanion == 1 )			set supplies to 1		else			Return		endif ;only ends checking if Tii Guar is your companion.	endif ;only ends checking objectCount.elseif ( supplies == 1 )	if ( GetDistance, Player <= 200 )		if ( greeting == 0 )			ForceGreeting			set acompanion to 0			set supplies to 2 ;after the greeting is forced moves to the next step.		endif ;only ends checking distance and setting greeting.	endif ;only ends checking greeting.elseif ( supplies == 2 )	if ( GetCurrentAIPackage != 3 ) ;if Tii Guar isn't already following the player.		if (GetCurrentAIPackage != 1 ) ;if Tii Guar isn't already Traveling upstairs.			setHello 0 ;makes Tii Guar not initiate voice dialogue wile the walking.			"aa shaddow_Tii Guar"-> AITravel, -324, -64, 387 ;makes Tii Guar start heading up stairs.			set timer to ( timer + GetSecondsPassed ) ;sets proper variables and sets supplies to 3.		endif	endifelseif ( supplies == 3 )	if ( greeting == 1 )		if ( GetDistance, Player <= 200 )			if ( GetLOS Player == 1 )				ForceGreeting				;this is where set repair to 1 will be.				set supplies to 5 ;change to 0 when repair feature is implemented.			endif		endif	endifendif ;ends the whole block.endif ;ends checking it Tii Guar and the player are in the right cell.end


Now on to feature number two! If I have any errors from now on I will make a new thread "Shaddow's scripting trouble" and post them all there :)

Thank you all for the help with this!

excerpt from credits

Special Thanks to:

Danjb
peachykeen
abot
Slaanesh The Corruptor
Psycholex_the_Architect
arvisrend

All for the great scripting help, learning this all is hard but you guys made it easier!

User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Sun Jan 24, 2010 5:03 pm

Ah, how annoying that it was something so simple!

Anyway, great job on getting this working, and thanks for including me in the credits (but you totally don't have to!) :D
User avatar
Jessica Nash
 
Posts: 3424
Joined: Tue Dec 19, 2006 10:18 pm

Previous

Return to III - Morrowind