Jump to content

making an NPC leave after dialogue topic


dantheman1234

Recommended Posts

hey guys, im back again because i am stuck. AGAIN!

 

basically. i am creating an NPC that i want to leave after the player buys a key from them.

 

so,

 

i have two topics which allow you to buy the key, this is done via the result script on the topic.

 

player.removeitem caps001 1000
additem caps001 1000
player.additem marketprojectplayerhomekey 1
marketprojectplayerhomebed.setownership
marketprojectplayerhomewindow1.setownership
marketprojectplayerhomewindow2.setownership
marketprojectplayerhomedoor.setownership
all this works fine. but i am trying to make the NPC leave after this topic has been selected.
Ive tried using conditions on the AI packages, one for when the npc has < 1000 caps (when the npc waiting on you buying the key.house) and two for when the NPC has => 1000 caps (when the npc is meant to leave. Also, i have a seperate AI package for each "leave" topic)
but this doesnt work, and i am completely stumped!
im learning.....slowly! haha
Edited by dantheman1234
Link to comment
Share on other sites

yep, the NPC is definatley getting the caps, I am going to use that script anyway cos it makes more sense :)

 

Ive been poking around a bit and I think that the "leave" AI packages arent running for some reason.

until you buy the key, My NPC is running an eat package, upon buying the key. The NPC stop eating but continues to sit on the chair, refusing to leave town haha.

 

i have set the travel package correctly I think lol, i am using this condition

 

getitemcount caps001 >= 1000 (the target is subject)

 

also, my npc is in an interior, the travel marker is in a exterior, is there anything special i have to do for this?

Link to comment
Share on other sites

so I managed to get it working!!

 

for anyone else who might have this problem...

 

 

Instead of using a travel package, use a patrol package.

set an xmarker at your desired location (where you want your NPC to travel to) and link it to your NPC.

uncheck "repeatable"

 

not sure if the last step is needed tbh lol

 

voila! your NPC will now leave when he/she is supposed to! :)

 

thanks jazzisparis for helping out!

Link to comment
Share on other sites

The 'Travel' package type should be the obvious choice here. You might have set something wrong.

You need to set the destination to 'Near Reference' and select the XMarker you placed at the destination.

Also, set these flags: Continue If PC Near, Must Reach Location, Continue During Combat.

Link to comment
Share on other sites

The 'Travel' package type should be the obvious choice here. You might have set something wrong.

You need to set the destination to 'Near Reference' and select the XMarker you placed at the destination.

Also, set these flags: Continue If PC Near, Must Reach Location, Continue During Combat.

I think it's some basic package management stuff that might be going wrong with the situation. This is what I would have looked at initially. I"m going to go into a lot of detail here which you may already know in case dantheman1234 comes back to the thread.

 

1) He didn't evp the NPC to make the NPC change packages immediately and get him to travel right then.

 

2) From his description it sounds like he is using multiple packages with the same condition. Every package should have a unique condition because of the way packages work. NPCs scan the list and choose the first one where conditions match. And when there are multiples of the same type of package there is a particular problem in NV that even with unique conditions NPCs can get "confused." The way to solve that is to list all conditions you have for every package of that type on every package of that type. Then on each package of that type zero out the ones that aren't applicable. That should keep your NPC filling the appropriate package at the right time. That's assuming...

 

3) that once all of that has been done the package list in the NPC record is sorted so that all packages will work properly. Because you have to have everything built right before you know if the list order if functioning properly. Sometimes you have to move packages up or down in the list to get them working.

 

 

 

@jazz

Also, Re: flags on package

ContinueIfPCNear according to the wiki is for shop owner type NPCs. You wouldn't want to use it with a package you want to terminate because the package won't terminate while the PC is near; or at least that's what the wiki says. I won't use the flag because of it and wanting my packages to end most of the time.

Link to comment
Share on other sites

Thanks, llama, for the input.

Indeed, EVP would be crucial in this case. I forgot all about that.

 

And when there are multiples of the same type of package there is a particular problem in NV that even with unique conditions NPCs can get "confused."

That's good to know. Though I would have thought that, since GetItemCount Caps001 >= 1000 and GetItemCount Caps001 < 1000 are both mutually exclusive, there wouldn't be such problems here.

As for the 'Continue If PC Near' flag - you're absolutely right about that one, too. I make extensive use of the Travel package in CC&C (in emulating 'Attack Target' and 'Lockpick/Hack/Disarm' script packages). From what I observed, when the actor reaches the specified destination, the package is set to 'Done' and terminates, regardless of whether this flag is set or not. I deduce it is one of those flags which are only applicable to certain package types. I wasn't sure if it was actually needed, so I left it there while debugging, and it sort of stayed there.
Link to comment
Share on other sites

 

And when there are multiples of the same type of package there is a particular problem in NV that even with unique conditions NPCs can get "confused."

That's good to know. Though I would have thought that, since GetItemCount Caps001 >= 1000 and GetItemCount Caps001 < 1000 are both mutually exclusive, there wouldn't be such problems here.

 

 

 

Yes, I agree :smile: those should work as properly unique conditions and you shouldn't need to do anything other than that to get those two packages working together in a list.

 

But in the inital post he says that he has two packages with GetItemcount Caps001 >= 1000. That set all of my package problem alarm bells off :biggrin: I probably (okay, definitely lol) overreact to the potential for problems to package issues after working in NV for so long. It can be such a nightmare getting packages to work here. But you won't get two packages of the same type working properly together in the same list if they use the same condition(s). Or, at least, I wouldn't expect to depend on them working correctly with any kind of reliability. What I would expect is the first one would be chosen all of the time. Although, because the system seems to break down with packages of the same type you might see the second one sometimes.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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