AI Package Problem

Post » Thu Apr 07, 2011 10:30 pm

EDIT: Problem Solved - It seems like if the AI package starts in one day and ends in another it goes haywire and just wont end. I changed all the AI to make sure everything they do starts and ends in the same day and while they still bug out every once and a while by and large it seems fixed. So for now I'm tentatively saying problem solved, although I may be back later.


So, I have a very large cell, with lots of NPC's in it, and for the most part all there AI Packages take place in that cell. The problem I'm starting to have now is that they just won't I guess update there packages unless I cause the game to reload the cell (waiting/resting or leaving and returning). If I just stand there for a few hours none of the actors will move on to the next stage of there AI.
Do to the design of the cell I might be able to reduce its size by a forth, but that still leave's a pretty big area that I can't really cut up. I looked at some info on the http://cs.elderscrolls.com/constwiki/index.php/EvaluatePackage command and I'm considering just throwing a script on every NPC in there to run that at the start of every hour if the player is in the cell. But " This function should be used sparingly as it can be slow if the actor has a long list of packages and conditions to test. " has me a bit worried as some of them have quite a few packages.

I'm still fairly new to setting up AI Packages, am I missing something here? Or is this just a part of the engine? I just spent the last 4 hours trying to get these NPCs to do what there told, and I'm finally giving up for the night. On that note sorry if this post is rambling a bit, I should have been to sleep awhile ago. Going to head off now, but if anyone has any tips or info that I'm missing I would really appreciate it. I just hate not knowing if this is an engine limitation or if I'm messing up.

Thanks for taking a look at this =)

-Mike
User avatar
Brentleah Jeffs
 
Posts: 3341
Joined: Tue Feb 13, 2007 12:21 am

Post » Fri Apr 08, 2011 1:27 am

So, no word yet it seems I took a stab at using EvaluatePackage take a look and tell me if this will break my game if it goes off on 20 NPCs at once.
scn aaMMucAIEvaluateref MyselfBegin GameMode	If Player.GetInCell aaMMucMarketV3		set mySelf to getSelf			If GetCurrentTime == 0.01 || GetCurrentTime == 1.01 || GetCurrentTime == 2.01 || GetCurrentTime == 3.01 || GetCurrentTime == 4.01 || GetCurrentTime == 5.01 || GetCurrentTime == 6.01 || GetCurrentTime == 7.01 || GetCurrentTime == 8.01 || GetCurrentTime == 9.01 || GetCurrentTime == 10.01 || GetCurrentTime == 11.01				mySelf.EvaluatePackage			Elseif GetCurrentTime == 12.01 || GetCurrentTime == 13.01 || GetCurrentTime == 14.01 || GetCurrentTime == 15.01 || GetCurrentTime == 16.01 || GetCurrentTime == 17.01 || GetCurrentTime == 18.01 || GetCurrentTime == 19.01 || GetCurrentTime == 20.01 || GetCurrentTime == 21.01 || GetCurrentTime == 22.01 || GetCurrentTime == 23.01				mySelf.EvaluatePackage			EndIf		EndIfEnd


That does not seem to work, so I made another one
scn aaMMucAIEvaluatefloat timerbegin gameMode	if Player.GetInCell aaMMucMarketV3 == 0		return	elseif ( timer < 10 )		set timer to timer + getSecondsPassed	else		set timer to 0		aaMMucTsabhiraRef.evp	endifend
with aaMMucTsabhiraRef being the NPC I'm using for testing. And nothing. If I put a message on the else the message goes off so its getting there. But still there AI just refuses to update to the next package. I'm at a total loss here please someone anyone tell me whats going on.

And to clarify/reiterate, the problem is I have an interior cell and the AI of NPCs inside it will ONLY move to the next package if I cause the cell to load by sleeping, waiting, or reentering. As long as I just stand there the next AI package WILL NOT fire. The only thing I can find that could explain it is if "Continue if PC near" was checked on the packages, but its not. Whats going on!?
User avatar
Myles
 
Posts: 3341
Joined: Sun Oct 21, 2007 12:52 pm

Post » Thu Apr 07, 2011 7:55 pm

Have you tried checking 'must complete' and 'Once per day' are ticked. and have you checked that they have a set time to do the package? e.g 'start: 9' 'duration: 3' and make another package 'start: 11' 'duration 2' so that they don't overlap each other, they make sure they complete it and they don't do it again if they don't have any more AI.

As for the continue if PC near, that just means they will stop what they're doing when the player walks by. as soon as you are a few feet away from them, they should just continue their package.

I hope this helped
Oblivious12123
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Fri Apr 08, 2011 4:16 am

Tell me if it worked
User avatar
Nikki Hype
 
Posts: 3429
Joined: Mon Jan 01, 2007 12:38 pm

Post » Fri Apr 08, 2011 7:15 am

Have you tried checking 'must complete' and 'Once per day' are ticked. and have you checked that they have a set time to do the package? e.g 'start: 9' 'duration: 3' and make another package 'start: 11' 'duration 2' so that they don't overlap each other, they make sure they complete it and they don't do it again if they don't have any more AI.

As for the continue if PC near, that just means they will stop what they're doing when the player walks by. as soon as you are a few feet away from them, they should just continue their package.

I hope this helped
Oblivious12123


I have the basic stuff down, for example, I have an NPC running a tavern from 14 for 12, so it ends at 2 the next day, then at 2 there's a travel package (duration 2) to move her away from the tavern counter so her replacment can come in while she goes off to eat and then sleep. I have Must Complete set on both of these packages, and have tried it with once per day on and off, but left it off as it seemed to have no effect. But that second package at 2 just wont go off unless the cell reloads. If I leave the cell between 2:00 3:59 and come back in at any point from 2:01 to 3:59 she will do the travel package just like she should. If I rest and the rest ends in the 2:00-3:59 bracket she will do as told. But if I hang out running around the cell for 5-6 hours (by now she should have done an eat and a sleep package) and she's still standing in that same stop. I just don't get it, I've even run a script to make her evaluate her packages and nothing. She just refuses to any more packages until I reload the cell.
Edit:
I read over what I said to try and catch any hostility in there but if anything slipped my notice its not directed at you, I'm just really frustrated right now. At this point all that I really have left to do on this mod is the AI. And right now it feels utterly hopeless. I'm sure it can be gotten around and that I'm just making some really simple mistake that when I spot it or it gets pointed out I'm just gonna be sitting there silently cursing myself for a good 2-3 minutes for overlooking something so obvious, but just right now just gahhh!
User avatar
Kelly John
 
Posts: 3413
Joined: Tue Jun 13, 2006 6:40 am

Post » Thu Apr 07, 2011 5:56 pm

Try checking must complete for just the latter package, because then even if the package where she stands at the counter isn't completed, then she will still have to complete the travel package.
I'm not sure it will 100% work but you might as well try.

Hope this helps
Oblivious12123
User avatar
leni
 
Posts: 3461
Joined: Tue Jul 17, 2007 3:58 pm

Post » Thu Apr 07, 2011 7:01 pm

Try checking must complete for just the latter package, because then even if the package where she stands at the counter isn't completed, then she will still have to complete the travel package.
I'm not sure it will 100% work but you might as well try.

Hope this helps
Oblivious12123


Problem there is the first package is a travel package with the offer services flag. So if its not flagged as must complete as soon as she gets there it finishes and you cant buy any drinks =/
But I don't think that's it because I've tried knocking that first package down to only 11 hours so it ends at 1AM and her Travel should be kicking in at 2AM. But it plays out exactly the same. But its not just her, all the NPCs in the cell are doing it. One of them sits at a desk for a few hours then goes and looks for food. Or at least he should go looking for food but if the cell doesn't reload he just gets out of the chair and stand there. That's the really worrying part I guess. There packages ARE finishing (her offer services package goes off at 2AM and you cant trade with her anymore). Its just there next package in line wont go off.

Ah well, I'm going to head off to bed, if you have any other ideas please do drop them off. I do really appreciate the help.
Oh, and http://tesnexus.com/downloads/file.php?id=33465 if anyone wants to crack it open and look at the packages first hand.
User avatar
Hella Beast
 
Posts: 3434
Joined: Mon Jul 16, 2007 2:50 am

Post » Thu Apr 07, 2011 11:36 pm

Problem there is the first package is a travel package with the offer services flag. So if its not flagged as must complete as soon as she gets there it finishes and you cant buy any drinks =/
But I don't think that's it because I've tried knocking that first package down to only 11 hours so it ends at 1AM and her Travel should be kicking in at 2AM. But it plays out exactly the same. But its not just her, all the NPCs in the cell are doing it. One of them sits at a desk for a few hours then goes and looks for food. Or at least he should go looking for food but if the cell doesn't reload he just gets out of the chair and stand there. That's the really worrying part I guess. There packages ARE finishing (her offer services package goes off at 2AM and you cant trade with her anymore). Its just there next package in line wont go off.

Ah well, I'm going to head off to bed, if you have any other ideas please do drop them off. I do really appreciate the help.


Well I would check the AI screens and everything, but my CS is mucked up atm so, yeah.
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Fri Apr 08, 2011 5:04 am

So I think I may have solved it. It seems like if the AI package starts in one day and ends in another it goes haywire... I changed all the AI to make sure everything they do starts and ends in the same day and while they still bug out every once and a while by and large it seems fixed. So for now I'm tentatively saying problem solved, although I may be back later.
User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am


Return to IV - Oblivion