Package Creation Help

Post » Fri May 27, 2011 5:26 pm

Hi.

I have a building that has 7 beds and a whole host of tastefully placed chairs/tables etc.

Assigning the beds to NPC's is easy enough, as is getting them to wander the building when they are awake, but Id like them to randomly use the chairs, benches, tables etc, while they are free to wander about.

Is this even possible? If so could someone outline the method of package creation (or script or whatever) please.

cheers

MVK
User avatar
Sian Ennis
 
Posts: 3362
Joined: Wed Nov 08, 2006 11:46 am

Post » Fri May 27, 2011 11:16 am

All that you'll need to do is play a function (every now and then, once per package, or constantly) and tell them to decide between sitting and wandering. The good thing about random-ness is that it can look random, even if it's not. You could just set a few functions that you want to be true to make it look random (such as time of day, month, weather, character level... etc) without it actually being random. Just chose one or a few things that are liable to change a lot, and you'll have something convincing without it being too hard. I'd suggest making one a higher priority (for example, the sitting package) with a random chance of it being used, and then if it's not, resorting to the wander package for the allotted time.
You could always try using GetRandomPercent as the condition that it needs, but I have a feeling that GetRandomPercent updates itself every single frame, so they'd go between wandering and sitting almost instantly. You could do this through a script though; using GetRandomPercent to assign either package to that actor, given it's outcome. With a script, you could control how often it updates the random percent by making it regenerate one each hour or so.

I hope that was helpful, and feel free to ask if you need help with scripts! Good luck!
User avatar
Sunnii Bebiieh
 
Posts: 3454
Joined: Wed Apr 11, 2007 7:57 pm

Post » Fri May 27, 2011 9:53 pm

An NPC doing an Eat package will attempt to find somewhere to sit down.

Also, NPC's with Wander packages sometimes sit, the likelihood of this is said to be linked to their Energy Level (in the AI tab)
I have not personally confirmed this.

Also try this.
Give them a short duration Find package telling them to find Object Type Furniture.
(Set the condition to something like GetRandomPercent <= 20 so they don't do it all the time)
This may not work! I've found using "Object Type" in Find packages to just not work sometimes.

If it doesn't, or is in some way unsatifactory try a UseItemAt package.

The Wiki is your friend, particularly in this case...
http://cs.elderscrolls.com/constwiki/index.php/Category%3a%50ackages

[edit] Also the previous poster's point is a good one. No one looks that closely. If it comes down to it, assign some of your people to sit in specific chairs sometimes.
80% of your players won't notice if it's random or not, another 19.5% won't care. Basically it looks pretty random.
And if you come right down to it, real people have routines and favorite places to sit anyway so don't stress out if true pure randomness eludes you.
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Sat May 28, 2011 12:28 am

Thanks guys - The random element was simply so that the same NPC would appear to do different things should anyone actually pay any attention to them. I know most wont, but of course I do, and you know what its like when you get an idea going on!

Anyway, I'm a little embarrassed for not seeing that this could be done with the conditions! I was looking at the package types and trying to work it out from there and I forgot that I can simply apply conditions.

Here is a question though:
If I have an item that I want the NPC to use, which is the best way to get them there, assuming that they could be pretty much anywhere (inside, outside) in the world space?
I have at the moment, an XMarker and a travel package that takes no time.

1) So I have my sleep package at the top, with times and a bed assignment.
2) I have a Travel package next for the NPC to provide a service (this is set so that he is sitting in a chair at a desk),
3) Then I have an XMarker placed beside some training apparatus. A Travel package, with no time set but "Must reach location" ticked gets him to that XMarker
4) Then a Use Item At package makes him use the training apparatus for a specific period of time.

Is this the best way to do this, or is there a specific method that is preferred? Indeed, is is possible to define an NPC's actions literally hour by hour in this way? (I have no intention of doing so, Id just like to know how far I can push this).

I'm also wondering about timing. For example, if the NPC is some distance from an item, and a Travel package sends him to it without the time set, when he gets there, the time for the next package, the Use Item At package, has actually started already. Will the NPC just start using the item until the end of the Use Item At time before processing the next package?

I ask because it seems that sometimes the NPC will reach the item to be used, and then just stand there, almost as if to say "I wasn't here when I was meant to be, so I cant start now". Whenever I see this behavior, the next package, which is usually sleep, fires as normal and the NPC goes off to bed.

Many thanks for your replies

MVK
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Fri May 27, 2011 1:38 pm

There doesn't seem to be much need for a second travel package in '3)'. Can you not just set the location for the Use Item At package? See below for an example in the Vanilla.
As for the second point: Hmm. It sounds like it should just force the actor into using the apparatus; I can't see why it wouldn't. Check out the packages that the Actor 'Deetsan' has. She's the mages guild woman who uses apparatus and sells alchemy related things. Her package is strictly from 12:00 to 20:00 though, so that probably doesn't really help. Try to find an example NPC in the game already if you can think of one. That would make it much simpler, as you could just copy and paste things in.

Good luck!
User avatar
Mylizards Dot com
 
Posts: 3379
Joined: Fri May 04, 2007 1:59 pm

Post » Fri May 27, 2011 1:20 pm

You can also Read Appendix 3 there is even more detailed information here..About AIpackages..

http://cs.elderscrolls.com/constwiki/index.php/A_beginner%27s_guide_-_Appendix_3
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Fri May 27, 2011 10:59 am

There doesn't seem to be much need for a second travel package in '3)'. Can you not just set the location for the Use Item At package? See below for an example in the Vanilla.
As for the second point: Hmm. It sounds like it should just force the actor into using the apparatus; I can't see why it wouldn't. Check out the packages that the Actor 'Deetsan' has. She's the mages guild woman who uses apparatus and sells alchemy related things. Her package is strictly from 12:00 to 20:00 though, so that probably doesn't really help. Try to find an example NPC in the game already if you can think of one. That would make it much simpler, as you could just copy and paste things in.

Good luck!


Thats odd. All of my Use Item At packages seems to suffer from a similar problem: If I have just the Use Item At package the NPC will not always go to the item, and even then, wont actually use it (Ill check out Deetsan shortly). If I miss out point3 then most often I find the NPC standing in place at the last location where a package worked (in this case beside the chair he was sitting in).

Corepc: Yes thanks for that. Iv been through the Wiki a fair bit and I'm always finding pages that Iv not seen yet. With that said it doesn't really shed any light on why the Use Item At package doesn't go to the item (or use it if the NPC actually gets there)

Its not really a biggie - adding one more package is no real hardship, but Id love to find out why these things work sometimes and not others.

Thanks for all your help guys - if you think of anything that might cause the issue Iv described with the Use Item At package Id love to hear it.

MVK
User avatar
Emilie M
 
Posts: 3419
Joined: Fri Mar 16, 2007 9:08 am

Post » Fri May 27, 2011 10:29 pm

Its not really a biggie - adding one more package is no real hardship, but Id love to find out why these things work sometimes and not others.

Thanks for all your help guys - if you think of anything that might cause the issue Iv described with the Use Item At package Id love to hear it.

MVK


Are you sure you useitem package has a location set, time set to run, must complete or must reach location is set, skip fallout is not checked,

If using open ended useitempackage use target and count's and must complete ..
User avatar
Tha King o Geekz
 
Posts: 3556
Joined: Mon May 07, 2007 9:14 pm

Post » Fri May 27, 2011 7:11 pm

Are you sure you useitem package has a location set, time set to run, must complete or must reach location is set, skip fallout is not checked


Yes, thats the thing, everything is set as it should be, in fact I even went back last night (really late!) after I saw your post just to check, but for sure, all of the settings are correct but my NPC still makes his way to the chair and just stands there. This was the reason why I placed the extra Travel package in the AI - just to get him where he was meant to be, in the hope that he would start using the chair once he was there.

Oh well, thanks anyway - its not really a big deal, but you know how little things bug you!

Cheers

MVK
User avatar
Dylan Markese
 
Posts: 3513
Joined: Sat Dec 01, 2007 11:58 am


Return to IV - Oblivion