Make an Actor walk to somewhere?

Post » Tue Jun 19, 2012 6:47 pm

Okay, so I've got my house up and running. I even got the Servant to appear, and to do stuff when you use a menu. But, for some reason, he won't do any AI Package actions. I have three of them:
1) One that should make him wait at SMMguardBedMarker
2) One that should make him wait at SMMguardVaultMarker
3) One that should make him wait at SMMreturnCRmarker
They all are basically the same thing, but have two differences:
A) Where the Servant should wait
:cool: Their Conditions --each uses the same GlobalVariable, but if it's value is '0', then package 3 should run, value '1' makes package 1 run, and value '2' makes package 2 run.

The problem is that, it doesn't work. It doesn't error, I have the debug settings on. He just sits there, in a ball. (He's a Dwarven Sphere).

Spoiler
Scriptname SMMservantActions extends ObjectReference{Makes a menu so you can tell the servant what to do.}Message Property MainMenu auto ;doneMessage Property DecMenu auto ;doneMessage Property PlantMush auto ;doneMessage Property DecBed auto ;doneMessage Property DecKitchen auto ;doneMessage Property DecServRoom auto ;doneMessage Property DecVault auto ;doneMessage Property CleanRubble auto ;doneMessage Property FoodMenu auto ;doneMessage Property PotionMenu auto ;doneMessage Property MiscMenu auto ;doneMessage Property ScrapSearch auto ;doneMessage Property CantBuy auto ;doneMessage Property WaitADay autoMiscObject Property Gold auto;MiscObject Property SoulFrag1 auto;MiscObject Property SoulFrag2 auto;MiscObject Property SoulFrag3 auto;MiscObject Property SoulFrag4 auto;MiscObject Property SoulFrag5 auto;MiscObject Property DweLargePM auto;MiscObject Property DweSmallPM auto;MiscObject Property DweCog auto;MiscObject Property DweGear auto;MiscObject Property DweGyro auto;MiscObject Property DweLS1 auto;MiscObject Property DweLS2 auto;MiscObject Property DweLS3 autoMiscObject[] Property scrapArray autoObjectReference Property RubblePiece1 autoObjectReference Property RubblePiece2 autoObjectReference Property RubblePiece3 autoObjectReference Property RubblePiece4 autoObjectReference Property RubblePiece5 autoObjectReference Property RubblePiece6 autoPotion Property VenisonStew autoPotion Property ApplePie autoPotion Property Sweetroll autoPotion Property HomeCKmeal autoPotion Property HPpot autoPotion Property STpot autoPotion Property MGpot autoGlobalVariable Property LastSearched autoGlobalVariable Property FirstUse autoGlobalVariable Property PackageNumbers autoActor Property Servant auto;Main Menu:;Decorate House   ::0;Prepare Food   ::1;Prepare Potion   ::2;Misc	 ::3;[EXIT]	 ::4	  ;Decoration Menu  :>0;Plant Cave Mushrooms ::0;Decorate Bedroom  ::1;Decorate Servant Room ::2;Decorate Kitchen  ::3;Decorate Vault   ::4;Clean Rubble   ::5;[EXIT]	 ::6	  ;Food Menu	:>1;Venison Stew   ::0;Apple Pie	::1;Sweetroll	::2;Homecooked Meal  ::3;[EXIT]	 ::4	  ;Potion Menu   :>2;Health Potion   ::0;Stamina Potion   ::1;Magicka Potion   ::2;[EXIT]	 ::4	  ;Misc Menu	:>3;Search for Scrapmetal ::0;Guard Bedroom   ::1;Guard Vault   ::2;Return to Creation Room::3;[EXIT]	 ::4Event OnActivate(objectReference akActionRef)int randomA = Utility.RandomInt(1,13)int randomB = Utility.RandomInt(1,13)int randomC = Utility.RandomInt(1,13)if akActionRef == Game.GetPlayer()  Int MainM = MainMenu.Show()  If (MainM != -1)   If (MainM == 0)	If (Game.GetPlayer().GetItemCount(Gold) >= 5000)	 Int Decor = DecMenu.Show()	 If (Decor != -1)	  If (Decor == 0)	   ;Decorate Bedroom	   Game.GetPlayer().RemoveItem(Gold, 5000)	   DecBed.Show()	  ElseIf (Decor == 2)	   ;Decorate Servant Room	   Game.GetPlayer().RemoveItem(Gold, 5000)	   DecServRoom.Show()	  ElseIf (Decor == 3)	   ;Decorate Kitchen	   Game.GetPlayer().RemoveItem(Gold, 5000)	   DecKitchen.Show()	  ElseIf (Decor == 4)	   ;Decorate Vault	   Game.GetPlayer().RemoveItem(Gold, 5000)	   DecVault.Show()	  ElseIf (Decor == 5)	   RubblePiece1.Disable()	   RubblePiece2.Disable()	   RubblePiece3.Disable()	   RubblePiece4.Disable()	   RubblePiece5.Disable()	   RubblePiece6.Disable()	   Game.GetPlayer().RemoveItem(Gold, 5000)	   CleanRubble.Show()	  ElseIf (Decor == 6)	   ;[EXIT]	  EndIf	 EndIf	Else	 CantBuy.Show()	EndIf   ElseIf (MainM == 1)	Int FoodM = FoodMenu.Show()	If (FoodM != -1)	 If (FoodM == 0)	  Game.GetPlayer().AddItem(VenisonStew)	 ElseIf (FoodM == 1)	  Game.GetPlayer().AddItem(ApplePie)	 ElseIf (FoodM == 2)	  Game.GetPlayer().AddItem(Sweetroll)	 ElseIf (FoodM == 3)	  Game.GetPlayer().AddItem(HomeCKmeal)	 ElseIf (FoodM == 4)	  ;[EXIT]	 EndIf	EndIf   ElseIf (MainM == 2)	Int PotionM = PotionMenu.Show()	If (PotionM != -1)	 If (PotionM == 0)	  Game.GetPlayer().AddItem(HPpot)	 ElseIf (PotionM == 1)	  Game.GetPlayer().AddItem(STpot)	 ElseIf (PotionM == 2)	  Game.GetPlayer().AddItem(MGpot)	 ElseIf (PotionM == 3)	  ;[EXIT]	 EndIf	EndIf   ElseIf (MainM == 3)	Int MiscM = MiscMenu.Show()	If (MiscM != -1)	 If (MiscM == 0)	  If (LastSearched.GetValue()+1 < Utility.GetCurrentGameTime()) || (FirstUse.GetValue() == 0)	   LastSearched.SetValue(Utility.GetCurrentGameTime())	   FirstUse.SetValue(1)	   Game.GetPlayer().AddItem(scrapArray[randomA])	   Game.GetPlayer().AddItem(scrapArray[randomB])	   Game.GetPlayer().AddItem(scrapArray[randomC])	   ScrapSearch.Show()	  Else	   WaitADay.Show()	  EndIf	 ElseIf (MiscM == 1)	  PackageNumbers.SetValue(1) ;Bedroom	  Servant.EnableAI(true)	  Servant.EvaluatePackage()	 ElseIf (MiscM == 2)	  PackageNumbers.SetValue(2) ;Vault	  Servant.EnableAI(true)	  Servant.EvaluatePackage()	 ElseIf (MiscM == 3)	  PackageNumbers.SetValue(0) ;Creation	  Servant.EnableAI(true)	  Servant.EvaluatePackage()	 ElseIf (MiscM == 4)	  ;[EXIT]	 EndIf	EndIf   ElseIf (MainM == 4)	;[EXIT]   EndIf  EndIfEndIfendEvent

Any ideas?
~L
User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Tue Jun 19, 2012 8:44 am

Oh, and this is the part of the script that I'm referring to:

Spoiler
ElseIf (MiscM == 1)	  PackageNumbers.SetValue(1) ;Bedroom	  Servant.EnableAI(true)	  Servant.EvaluatePackage()	 ElseIf (MiscM == 2)	  PackageNumbers.SetValue(2) ;Vault	  Servant.EnableAI(true)	  Servant.EvaluatePackage()	 ElseIf (MiscM == 3)	  PackageNumbers.SetValue(0) ;Creation	  Servant.EnableAI(true)	  Servant.EvaluatePackage()

~L
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Tue Jun 19, 2012 6:56 am

I had a similar problem. EvluatePackage() doesn't seem to do the trick. So I did EnableAI(false) then EnableAI(true)... like so:
Servant.EnableAI(false)
PackageNumbers.SetValue(2) ;Vault
Servant.EnableAI(true)

Worked for me. Hope it works for you.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Tue Jun 19, 2012 1:17 pm

have you navmeshed your new home? without it the npc ai won't be able to move around. Also think there is a serious bug that means your navmesh can be deleted in game if you leave the cell go to a cell a certain distance away and come back. Which they need to fix badly since its game breaking if your mod makes new cells
User avatar
Jessica Lloyd
 
Posts: 3481
Joined: Fri Aug 25, 2006 2:11 pm

Post » Tue Jun 19, 2012 2:38 pm

If you don't want to use ai packages, you can always use http://www.creationkit.com/PathToReference_-_Actor

You will still need a working nav mesh though, but at least you can test for the return value.
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Tue Jun 19, 2012 3:30 pm

Thanks, I just finished NavMeshing. I had forgotten about that.
Heck, it even fixed an error that I'd forgotten about.

Thanks, everyone! Now on to fixing a KneelMarker. Can't have an Altar without the option to pray, right?

...right?

~L
User avatar
Dark Mogul
 
Posts: 3438
Joined: Tue Feb 20, 2007 11:51 am


Return to V - Skyrim