Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

NPCs & AI: Class #2


InsanitySorrow
 Share

Recommended Posts

NPCs & AI: Class #2

Class01.png

Welcome to class #2

If you have not already I would suggest completing class #1 becuase this one follows on from the end of the first. For this class we will be dealing with AI packages, don't worry they're not as hard as you may think XD

Step 1: Getting Started

Okay so we have our NPC created and placed in-game, but what good is the NPC if they don't do anything?, Well we're going to change that and give them a basic schedule.

So these are the packages we're going to create and apply to our NPC during this class:

Eat Package

Sleep Package

Wander Package

Let's get started then.

Step 2: Covering the basics

So to create a new AI package we need to locate the Packages menu, Look at the very top of the CS along the task bar you'll see the normal File, Edit ect. Along there you will see an option called Character, click this and a menu will drop down, click the Packages option there.

Screenshot20.jpg

This will open a new menu where we'll be able to edit or create AI packages.

Screenshot21.jpg

Now right click anywhere in that screen, you will be prompted with a few choices, select New. This will open the AI Package screen where we will be creating our new AI packages.

Screenshot22.jpg

Now that we know how to locate the Packages screen we will now move onto creating our first AI package.

Step 3: Eat AI Package

As you can see there are quite a lot of options on the screen, but don't worry we won't be using that many of them here, since we're keeping things basic :)

Like we done with our NPC we need to give this AI package a name, keeping with the previous prefix I'm going to set my ID as aaClassEatPackage.

:pints: Smarty Says: Be sure to give your package ID a good descriptive name, Ie never something plain like aaClassPackage01. It'll save you some trouble when working with them.

To the right of the ID we can see an option called Package Type, nex to it is a drop down box, click the little arrow so you can see the options available. From the options available select the Eat option.

Screenshot23.jpg

Next step for us is to check a checkbox :laugh:, Simple, In the flags are find the Weapons Unequipped checkbox and check it. This makes the NPC unequip any weapons they have equipped. Now before you say I know we never gave the NPC a weapon, but we want to make this compatible with any NPCs we made add it to in the future :D

Now that we have that done we need to give the package a time and duration. At the bottom of the Package screen you will see a drop down box for Time and a textbox for Duration. Click the drop down box for time and select 6, give it a duration of 2

Screenshot24.jpg

Our last step is to tell the NPC where to perform this package. Now click the Location Tab, As you can see everything is grey'd out, so go ahead and click the Location Checkbox.

Screenshot25.jpg

Since this is a basic package we are not going to set a specific cell for the NPC to eat in, rather we are going to set a distance they will travel from where you placed them in the CS. If you look at the bottom right of the Package screen you will see two options, Near Current Location and Near Editor Location, Select the Near Editor Location option and in the Radius textbox enter 1024

Screenshot26.jpg

Click Ok to save, congrats on creating your first AI package :rofl:

Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

Step 4: Sleep AI Package

So let's create a new package, this time it will be the Sleep Package. Now creating this one is the same as before with only a few small changes.

ID: My ID for this package is aaClassSleepPackage

Package Type: The package type is an important step, so for this one we'll do as we done before but we'll pick the Sleep option.

Screenshot27.jpg

Just like before we'll check Weapons Unequipped but also Armor Unequipped. This is incase we apply it to an NPC that wears armor, not going to be comforatble sleeping in that lot eh? :lmao:, So we'll make them remove it.

Screenshot28.jpg

Now we'll set up the time and duration, the time I have chosen is 21 and the duration 8, this should make the NPC wake up about an hour before the Eat package starts, which makes thing slightly more realistic.

Screenshot29.jpg

XD Smart Says: It's a good idea to plan out your AI packages before making them, this means you can set them so one ends close to when another starts, this way you make it more realistic and avoid any issues with packages overwriting each other.

Since this is a basic AI package we don't want to give a specific cell for our NPC to sleep in, instead we're going to use the Near Editor location again and this time set it to 2048, twice the range of eat. They never know where the beds might be XD

Screenshot30.jpg

That package is now done :clap:, We can move on :)

Step 5: Wander AI Package

This is the simplest package here because we don't need to do anything fancy, all we need is the NPC to wander. So open up a new Package screen, give the package an ID and set the package type to Wander.

Screenshot31.jpg

Now for this one we want it to be used anytime there is no other package running, so we'll simply not set a time or duration. This will allow the game to pick the package when the NPC has finished with the others.

So skip over to the Location tab and set up Near Editor Location with a radius of 2048. You can set this higher if you want them to have a wider wander radius.

Screenshot32.jpg

That's all the AI packages complete, now let's apply them to our NPC :D

Step 6: Applying them to our NPC

Applying packages to an NPC is fairly straightforward, in the Object Window find your NPC and double click on them to open their window. Just above the Ok and close buttons you will see an AI button

:) Smarty Says: You may use either of the two NPCs created in Class #1.

Screenshot33.jpg

Click it and it will open a new screen.

Screenshot34.jpg

Now before we add the AI packages I want to quickly go over a couple of things, at the top of the screen you will see a few settings:

Aggression

Confidence

Energy Level

Responsiblity

Screenshot35.jpg

Now as you may realise these are more like personality traits rather than AI, these will govern pretty much what they mean, but I'll briefly describe them here:

  • Aggression - This as the name suggests controls the aggression levels of the NPC, low values make them very passive and the higher values make them more aggressive. If this is high enough the NPC will lash out at anybody, so be carefull with this. Well unless you want an evil NPC :P
  • Confidence - This measures how likely the NPC will attack or flee in combat. A setting of 100 guarantees the NPC will never flee, while 0 means they will always flee.
  • Energy Level - This controls how often the NPC will move about when they're using their Wander packages.
  • Responsiblity - This controls how willing the NPC is to commit a crime or if they will/will not report any crimes they witness. Setting this with a value of 30 or less will mean the NPC will steal things, anything higher than 30 and the NPC will not steal, the higher it gets the more willing they will be to report crimes.

Now we are not going to touch these at all, but I thought it would be a good idea to let you know how they affect the NPC because in you future endeavours they will be used.

With the AI menu still open, open up the AI Packages menu and find your newly created packages.

Screenshot36.jpg

Now just drag and drop your AI packages into the AI screen's package list.

Screenshot37.jpg

:smarty: Smarty Says: The order of the AI packages is important, the game processes them from the top of the list down, So things like Quest AI packages and packages that need to run first like Service packages should be placed at the top of the list and all others should be added under them.

This will be come more important as you create more detailed NPCs.

And that's it you are done, save it and go look in-game :clap:, Be sure to post screenshots of all your packages.

Link to comment
Share on other sites

Homework

Homework time again XD, This should be fun.

Create a Travel AI Package, I want the NPC to travel to The Merchants Inn, which is located in the Imperial City. The time should be Four O'clock in the evening and the duration should be 10 hours. I also want the NPC to only do this on Mondays, Wednesdays and Fridays.

Be sure to post screenshots of all the package details and also in-game screenshots showing the pacakges are working. :smarty:, Good luck :)

Link to comment
Share on other sites

I have a couple of questions about the Wander package and the homework. In the Wander and Travel packages should we allow Defensive Combat in case our NPC is attacked or is it supposed to run away? Assuming that we used the default settings for Agression. And for the Travel package, which NPC do you want us to use, the one in Bruma or the one from the tutorial house? With a 4 hour time span I'm wondering if they can make it and if we need to check the Must Reach Location .

Edit:

I've posted all my pics with the exception of the ingame screen of the NPC traveling. Waiting to see if it only needs a screen of them actually traveling or if they are supposed to arrive and screen of them at the location.

Link to comment
Share on other sites

Snip

Just a screenshot of the settings will do, I can see from there if it's correct :)

NPCs - you can use either of the NPCs, both were created during the class you see so we're just building them up. So either one will do for this :)

For the Defensive combat - This maybe worth adding to the travel package since they travel outside cities ect which can be considered dangerous areas, but for inside cities it makes no sense because the only time they will be in danger really is if the player attacks them, in which case the game will check their aggression and confidence levels.

Time - The time is only set as an example, I just want to see how you are doing :), But if you think they will not make it, adjust it to say 8-10 hours and test then.

Must Reach Location - This is not relevant here, this is only needed when you have set travel conditions. This just makes sure the package does not end if the set conditions are not met.

Class 2 Screenies:

Snip

Well Done ;), You also made some good flag choices there too.

Also I made a couple of adjustments based on your feedback.

Link to comment
Share on other sites

Quick point for other students, make sure the beds in your home are switched to faction>playerfaction rather then npc>player. i watched arlowe just wander and eath for several minuets but no sleep, then it occured to me that when i built the house i had set some stuff to player owned rather then faction owned.

it's pretty funny, i just watched ajira steal the poor old beggar's (in bruma) bedroll, he had to stand all night... lol.

i'll post screenies soon.

Um IS, shouldn't we set the eat time to something else? cuz as it stands the sleep package ends at 7 in the morning but the eat package starts at 6.... so shouldn't we set the eat package to eight? thus giving us that hour gap you mentioned above?

Edited by spicydeath82
Link to comment
Share on other sites

Well here's the pics of my travel package, it does work as i've seen ajira walking through the imperial city though i never seem to catch her in the inn i always find her as she's leaving it.... lol. but the fact that she's getting to the ic market area from bruma tells me that it works.

travelpackage02.th.jpg

travelpackage01.th.jpg

Link to comment
Share on other sites

I have two beds in the house i placed the NPC, one for me and one for a servant, i changed the ownership for the one for me to Player Faction and the ownership for his bed to his nameed NPC ..is that the right way to do this?

And when we create AI packages should we have just the OB esp as the active one?

Edited by CrisG9
Link to comment
Share on other sites

Cris you should follow the class, get the basics down before asking questions, also for questions not suited to the class post them in the Q&A thread :evil:

Answer to question one is: You don't need to set ownership of the second bed, the NPC will sleep in any free ownership beds. So just set one to player or playerfaction owned.

Link to comment
Share on other sites

OK, ....sorry about asking questions, i am excited to be doing this, had wanted to learn NPCs for a long time.

working on the next step in the class, my NPC will sleep fine and walk around fine but he wont eat.

I tried moving the chairs closer to the table and moving the walk grid closer... might that be a problem? I also had benches, and changed to chairs. I think i saw him make eating gestures standing up ..at the time he should eat, but he would not sit down yet.

Here are the pics of the successful idles and my AI list for him..i changed the meal time to 7 to see if that made any differnce,..so far, he wont do the eating animation...

any ideas?

http://img375.imageshack.us/img375/791/sleepingidle.jpg

Walking Animation works

But He Wont Eat

and the path grid...

NPC path grid

AI list for this NPC

the settings for the eat animation..i changed the time back to 6... had tried 7 to see if giving him more time woudl help...

Settings for Eat Package

more eat settings

HOMEWORK:

OK i set up the travel package, thus:

Travel Package 1

travel package 2

location setting

assigned it to the NPC who we had placed in Bruma.

then i went and staked out the Merchants Inn, waited for a week, no show.

I went to Bruma and there she was. I waited until 4:00 PM bell rang and she did not move.

she is chatting with people and seems alive ..but not moving....

i had some flags checked, i will try unchecking them all tomorrow and try again.

Edited by CrisG9
Link to comment
Share on other sites

Asking questions is fine, but some of yours were answered by the class. If the NPC is not eating then there must not be food in the home, either place some food in the home or place a food item in the NPCs inventory and set it with a value of -1.

The first image link is broken :evil:, Also you posted a couple of Pathgrid images that are apart of the CS Basics Class, be sure to post them there instead.

Your packages look fine, just be careful when using the "Continue if PC Near" flag, it can cause some problems.

Link to comment
Share on other sites

OK thanks, i will try adding more food and putting some in his inventory with value of 1

I posted the pathgrid pics here to show how i had the chairs and table set up in case i needed to move them closer..i have completed the first class already.

ok, will try removing that flag, i was worried she might not continue if i showed up. thanks for checking my package, i tried hard to get it right and follow your instructions. Will keep working on it.

sleeping works fine, he looks very comfy...

sleepingidle.jpg

UPDATE: and that did the trick he is eating!

eatingj.jpg

thank you so much, i had tried everything i could think of.... :D

Edited by CrisG9
Link to comment
Share on other sites

wow, ok, cool idea... the -1...

how do we change the value of food items? i cant change the value once it is in the house, i just tried with a cheese wedge. And i couldnt get the item to open up in the NPC inventory... can you help me know how to change the value?

cheese inventory data

tried accessing value for cheese from house in render..

cheese data in house

but could not find anywhere to input change in value

Edited by CrisG9
Link to comment
Share on other sites

IIRC You can only change the values of food placed inside containers, like a chest or an NPCs inventory. Anything you drag into the CS Render Window can only be done one at a time :D

For either an NPC or chest, drag and drop the food item into the inventory/chest window. You will see a column for the count (amount), click in the column right next to the food item once, you will then be able to edit the amount.

Link to comment
Share on other sites

OK, my other NPC showed up at the Merchants Inn right on time...

http://img3.imageshack.us/img3/7674/sheshoweduprightontime.jpg

And Arlowe is eating fine now, so all his animations are working well.

sleeping

nap time

eating

http://img534.imageshack.us/img534/2647/arloweeats.jpg

walking

http://img404.imageshack.us/img404/3415/arlowewalks.jpg

Edited by CrisG9
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...