Jump to content

Use AddScriptPackage to make a group of NPCs sit in


Recommended Posts




Ok, this should be a easy problem to solve, but it's proven surprisingly difficult. I created an AI package which makes an NPC sit in a chair in their current cell using the AddScriptPackage command. With one NPC it works fine. However, if I have a group of NPCs I want to sit down all in the same cell, they all try to use the same chair and most end up just standing around. They should use a different chair in the cell if an NPC is already sitting in it.

If anyone has any insights, I would greatly appreciate them.



Link to comment
Share on other sites

Are all of the chairs persistent references?

For now, yes. In the final mod, I will apply the script to many cells. So chairs will sometimes be non-persistent.

Link to comment
Share on other sites

I asked because if I remember correctly that was something I had to do to get a couple of NPCs I have use chairs ... and both do use chairs at the same time on occasion (they each have a read package on rainy days) but they wouldn't until I made the chairs persistent (the packages aren't assigned a particular chair ... they use one of the three close to a fireplace).

 

Now eating packages seem to be handled with less need for persistence. Most of the time they'll use one of the chairs at the table, but sometimes one or both of them like to eat by the fireplace. I don't mind because I like to see the variety of behavior.

Link to comment
Share on other sites

The AI is sometimes so screwed and bugged. Maybe some scripting might be needed.

 

What I dislike is when they look for food, well yes I know about the pewter mug but I want immersion with food... When they search for food they walk into walls, skip using the path's and behave like idiots, like a 1 cell organism that do not know where it is or where it is heading. A evp at them, and they suddenly works perfect and the first thing they do is find the path grid and then head towards the food or a container with food. I will make a simple evp spell myself later on when i start adding dynamic packages to my project...

 

Try evp at them and if they choose another chair, then it solved the problem and then make a quest that cast evp at them and adding them to the quest you can do with a spell and that is what I will do. Well the adding spell is already in game but not the quest yet nor a evp spell. :wink:

 

An evp spell will be useful at any NPC that screwed their AI really. When I port as one example, the mobs just stand there, doing nothing so yesterday I did evp 2 Ogre's and I stood next to them in a minute and they did not care about my lovely char. An evp solved it.

 

I am sure we should be able to make much smarter ways to solve this with quest scripts.

Edited by Pellape
Link to comment
Share on other sites

I agree that at times NPCs seem to ignore everything "they know" which leads them to getting nothing done. One celled organisms are complex compared to NPCs though. NPCs have a one, or they have a zero (repeat until they are "complete") ... at least our DNA based life gets to scramble up four letters (A, C, T and G with a sugar and a phosphate stirred in for flavour).

 

Another trick I've found that does the same as EVP is to just go up to them so they notice the player (which I believe interrupts whatever they were unsuccessfully trying to do) and generally they'll get back on track.

 

Good thing my goal is always increased variety.

Link to comment
Share on other sites

Aha! Time for me to shine with my incredibily niche knowledge I randomly found out while messing with AI packages. Despite it sounding easy, getting NPCs to use random furniture to sit in is one hell of a pain to get working, I managed to do it without scripts even in my Radiant AI mod and this is how:

 

There is a way to get NPCs to randomly sit down in random furniture that is not persistent and the answer is an "Accompany" package setup the following way:

 

Package type: Accompany

Location: Unchecked.

Target: Furniture

 

Now if you try and create a package that way in the CS, you will notice that it seems to not be possible. An accompany package doesn't allow to set a non-persistent target, so now we use a bug in the CS to create a feature in-game!

Make a find package as described above (Location unchecked, Target "Furniture") save it. Open it again and change only the package type to "Accompany" save without changing anything else.

 

When you now open the Accompany package again, you will notice that it has "Furniture" as target still, despite the setting being grayed out, but it works correctly in-game.

NPCs will even pay attention to ownership restrictrions on furniture that way, which a "Travel" package with "Furniture" as location would not.

Edited by mixxa77
Link to comment
Share on other sites

Now this is very very good info Mixxa ... +1 :thumbsup:

 

- Edit - Would have given you a hug, but it seems I already gave you one some time in the past and they are a "one per customer" commodity.

Link to comment
Share on other sites

So damn coool. I do hope we can fool ECS as easy as CS... ;) So damn nice. I will use that later when my library is built as I will add a package for the companions to go down to the reading section and read books but it will be up to them to sit or stand in that package anyway, when I think about it... So many options, so much to do...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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