Jump to content

Construction Set help- How to get "random" AI behavior?


Ru5tyShackleford

Recommended Posts

Any chairs etc need to be set as a persistent reference and not owned (or owned by the NPC you want to use the item).

 

I have some NPCs who randomly use chairs, either to read or to just sit. I use a combination of conditions for the sitting and sitting and reading packages ... GetRandomPercent primarily and also GetIsCurrentWeather (generally either raining or snowing).

 

Note that there are some differences between using a UseItemAt package and a Travel package when getting an NPC seated and reading. When using a UseItemAt targeting a book in their inventory and a particular chair they will often just warp to the chair and sit down and start to read (watch Arvena Thelas in Anvil at 10am for an example of warping if she doesn't happen to be right next to the bench she reads at). What I do in that case (this isn't for the random chance sit and read packages but their regular evening package) is I give them a Travel package aimed at their usual chair, so they sit for an hour before their UseItemAt read package. The downside is they stand up briefly before sitting to read.

 

Here is a couple of links to the CS Wiki regarding the UseItemAt Package and Travel Package.

 

Their sleeping packages don't have a target bed so I never know who I'll be sleeping with on any particular evening.

 

Each of these instances I've outlined are set to a specific time. If you want the packages to happen randomly you'd need to set the time to Any.

 

Note that the order that packages appear in their AI Package list is important. As far as I can tell the list is evaluated from top to bottom. It's often beneficial (or sometimes imperative) to order the package in a manner that makes sure a package's conditions are checked before another package is evaluated when the game parses down the list (which is why your default wander should always be at the very bottom of your list). You'll often find examples of chronologically out of order packages in the vanilla game, done to make certain particular packages are evaluated before other packages.

Edited by Striker879
Link to comment
Share on other sites

  • 3 weeks later...

well I'm stumped.

 

So, I added a new package- "relax" set to anytime, and going for two hours. supposed to make them find a piece of furniture to use. Also placed it above the normal wander package.

 

However, now the NPCs just stand there doing nothing. Not wandering, not looking for furniture.

 

Here are some GECK pictures I took:

 

GdC0Hhh.pngnsIzU3U.pngxsuBRZI.png

 

 

Any ideas?

Link to comment
Share on other sites

Anything set for Conditions that may not be satisfied?

 

Only use Flags that are absolutely necessary (e.g. Must Complete will prevent all other packages until the flagged package completes, effectively locking the NPC with nothing to do if the flagged package doesn't complete).

 

Not at my gaming computer for most of the summer so I can't think of anything else off the top of my head.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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