Jump to content

Please Help: My NPC isn't switching between packages


CaughtInTheCrossfire

Recommended Posts

Hi everyone, I'm wondering if anyone can help me with a problem I'm having in the geck.

 

Basically I want to have an npc (Bob) sitting at the bar in the Mojave Outpost, drinking a beer.

Easy enough, right? I just made an 'eat' package, specified food type as 'beer' and set eat location to the stool I want him on. It works no problem. Easy peasy.

 

What I want next is for the player to get a quest where they are instructed to go and tell Bob to go outside and stand next to another npc (Frank). I've created the quest perfectly fine as well as the package which directs the npc to 'travel' outside to an x marker next to Frank via a 'travel' package.

 

The way I've set it up is that the quest objective will come up as "Go tell Bob to meet Frank outside". So when I go to Bob I've got a dialogue option/topic "Frank wants you to meet him outside" with a result script of:

 

"setobjectivecompleted bobandfrank 15 1"

 

I also set the condition for the 'eat' package to:

 

"GetObjectiveCompleted bobandfrank 15 == 0"

 

and I've got the 'travel' package on a condition of:

 

"GetObjectiveCompleted bobandfrank 15 == 1"

 

So I what I expect to happen is that when I go into dialogue with Bob and I select the topic with the script that sets the objective as completed, the condition on the 'eat' package ceases to be satisfied and the condition on the 'travel' package becomes satisfied and Bob just goes from one to the other. Gets up and goes outside. However, this isn't the case he just keeps sitting there.

 

I tried deleting the 'eat' package so that he's just standing around when I tell him to go outside and that works fine. So I know it's not an issue with either package individually because they both work fine on their own. Its just when I put them together that theres an issue. I'm thinking that maybe there is some problem I'm not aware of when it comes to switching between packages, even when only one of them has its conditions met.

 

I've read on the geck website that the packages are evaluated every ten seconds and that an actor will pick whichever package is first on the list and has met its conditions. So I thought maybe I just need to wait 10 seconds after telling him to go outside and it will just kick in but that doesn't work either.

 

There is a script function "[ActorRefID].EvaluatePackage" which apparently forces the actor to evaluate their packages and pick the next one that's been satisfied. I basically want to run that on Bob just after I tell him to go outside. But I don't know how to exactly. My scripting skills are incredibly limited. I've poured over all the tutorials I can get my hands on and none of them can help me with this issue. I'm all out of ideas on how to get this to work and this is the last solution I can come up with.

 

Is there anyone that can please tell me how to run "[ActorRefID].EvaluatePackage" on Bob?

 

OR

 

Is there anyone who can tell me an alternative way of getting this done?

 

Thank you in advance to anyone who can help me. Any contributions and other perspectives are greatly appreciated. I'm sorry if this has been a little wordy. If you stuck around for the whole thing, you're my absolute hero.

 

 

Link to comment
Share on other sites

to force BobREF to re-evaluate his package, after the condition goes true, you simply need to write on your script:

BobREF.evp

 

Then, if you go in game and even if the condition of the travel package goes true he still won't pick that package, open the console, click on him and write evp, close the console and wait few seconds to see.

If still he doesn't pick it, re-open the console, click on him and write ResetAI, let's see how he will behave.

Link to comment
Share on other sites

Since the travel package isn't firing you would want to evaluate when the NPC is told to use that package. Use package followed by evaluate, use another also followed by evaluate.

 

I would use the AddScriptPackage and give the NPC the travel package because it will take precedence over all other AI packs. Once Bob has finished that AI pack use the removeScriptPackage to remove it followed by evaluating AI packs. It may even be good to evaluate everytime the NPC is told to use a an AI pack.

 

http://geck.bethsoft.com/index.php?title=AddScriptPackage

http://geck.bethsoft.com/index.php?title=RemoveScriptPackage

 

In the dialogue in the topic that you tell Bob to go meet Frank you would add something like below to the Result Script Begin box.

 

BobRef.AddScriptPackage MeetFrankPackage

BobREF.evp

setobjectivecompleted bobandfrank 15 1

 

With whatever you do to set the next stage and Bob can go do something else you would add something like below and Bob goes back to whatever.

 

BobRef.removeScriptPackage MeetFrankPackage

BobREF.evp

setobjectivecompleted bobandfrank 20 1

 

If you want Bob to do something different like go sandbox at some other cell you would insert another addScript so its something like below.

 

BobRef.removeScriptPackage MeetFrankPackage

BobRef.AddScriptPackage GoSandBoxAtCasinoPackage

BobREF.evp

setobjectivecompleted bobandfrank 20 1

 

At least that's how I would do the AI packs and Give Bob eat, sleep, and sandbox packages in the AI package tab for when he is at home so he is not just sitting at a table eating 24 hours a day.

Edited by jet4571
Link to comment
Share on other sites

EDID is a different animal than REFID, you want to make Bob's REFID. In the cell you placed Bob double click him or right-click and edit in the Cell View list. His reference edit window is now there to be worked with and in the empty box at the top of that window is Referance Editor ID awaiting you to add something to it. That box is the REFID used by the scripts because some items have many referances and using the EDID would make all of them affected by the script, like for example picking up a specific teddy bear to give to an NPC requires the REFID because if the EDID was used any teddy bear will work rather than the one you placed on the bed in that new house cell you made.

 

Anyway in that box add something to it. Usually something like the EDID with REF added to it for NPC's or unique items. Example 01BobREF. If its not a unique item and can have a dozen REFID's you want to make it easy to remember in relation to your quest like AbraxoCleaner4BobAndFrankREF if you added an Abraxo cleaner that's required for your quest because Bob wants you to go get his off his shelf at home so he can use it to clean Franks lucky horseshoe.

 

*Edit

Oh, also the number to the right of that box is the REFID number used by console commands. So that's good to know for when you release because someone may need a console command for whatever reason like moveto player. the first 2 characters in that is load order so it may show as 0C00109A but load order has it at 1100109A. So telling them 01BobRef wont help them lol.

 

*Edit again

Anytime you see REF for scripts it is the REFID of the item you are working with. REFID is Referance ID and EDID is Editor ID. In this case Bobs EDID is 01Bob and REFID is 01BobRef. EDID is the one found in the lists of items and REFID is always in a cell. There could be 1 million 01Bob's used but only 1 01BobRef.

Edited by jet4571
Link to comment
Share on other sites

@Jet4571

I went and gave him a refid. I called him 01BobREF. But the geck kept telling me that 01BobREF was not found. So I changed his refid to BobBobREF because I figured "hey, maybe the geck just hates numbers" and I put that in a script and it was fine with it. When I went into the game to test it out, however, it didn't work. I've ended up just using ResetAI in the topic result script. It works, in that it makes him get off his ass and go outside to talk to his best mate frank, although his animation getting off the stool is really jerky and sped up and looks garbage but i might just need to settle for that. I justn hope there isn't some major repercussion to using it, the geck website makes it out to be a really severe last resort.

The tutorials ive looked at, everyone ive spoken to and just my common sense all tell me that the method you suggested shouldve worked. But its not. Bob just keeps sitting on his ass in the goddamn mojave outpost just drinking his beer and mocking me, like a bastard. I've found a solution in the ResetAI thing. i'm kinda bothered by this though. it feels like im settling for less and also that there is some weird underlying yet simple thing that im doing wrong which im not gonna figure out until it no longer even matters.

 

But anyway, thanks soooo much to you guys, Fallout2AM and Jet4571, that took the time and helped me out. I really appreciate it =D

Link to comment
Share on other sites

Skyrim hates numbers at the start of an ID too, I used to name everything 01name but now I use AAName to make it easy to find.

 

I don't know if NPC's will retain some old AI behavior in the save when changes are made in a mod in FNV but they definitely did in Skyrim. When I am adjusting an NPC in Skyrim I always go to the NPC and use the resurrect console command on them or ResetAI so they get fully loaded from the mod without whatever old info from the save. So you may want to test him out from a save that you never met him before just to be sure it wasn't the save file messing it up. Oh and resetting the AI while it is sitting and drinking is probably why the animation to stand up got messed up.

Link to comment
Share on other sites

I wouldn't suggest to use AddScriptPackage in that case. Bob is eating, I feel randomly the package won't be executed anyway.

I made you use ResetAI on console because... I was assuming evp wasn't evaluating. My suggestion? Just replace BobRef.evp on script with BobRef.ResetAI. The only "downside" you will see is Bob jumping on feet when he changes the package, very... "jumpy" I would say, instead of... how can I say... standing up more relaxed. If you are not picky, you probably will solve your issues with that.

 

And yes, never use numbers when it's something involving scripts

 

EDIT: just to clarify a little more. You didn't do wrong. Just don't forget this workaround whenever you will have issues with packages. I mean, always try to check if you setted them correctly, of course, but at the end of the day, if the problem is just them refusing to evp, just use ResetAI, don't get mad.

Edited by Fallout2AM
Link to comment
Share on other sites

Did you try making Bob simply re-evaluate his packages from the dialogue result-script? Something like:


SetObjectiveCompleted bobandfrank 15 1

BobRef.EvaluatePackage


If it still doesn't work, instead of EvaluatePackage, you can also try BobRef.RemoveScriptPackage. This will make Bob abort his current package and then re-evaluate. It is much less harsh than ResetAI and should not cause any animation glitches.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...