![]() |
|
#1
|
|||
|
|||
|
Hi all,
As I plug through the NPCs of the Market I see an area devoid of life. These people need to move. So this brings up animation behavior scripts. The other piece of this is how to run them. In Avertine I used a series of base scripts that included variables set on the NPC. You set probability of a animation being fired and the direction to face when firing. I did this for a number of things like friendly, angry and normal conversation. Sitting and sitting while drinking. Walking around and using objects, … It makes sense that these would be a campaign level resource. Does this make sense to others? I will end up making them for the market and any other areas I build so it’s fine with me either way. |
|
#2
|
|||
|
|||
|
You know, the built in ambient behavior scripts work quite well, are not resource intensive at all, available for both mobile and immobile NPCs, and require next to no work besides a custom spawn script. I was really impressed with them as a whole and suggest trying them before investing any serious work into this.
In case anyone doesn't know how they work, here's a link: http://nwn2forums.bioware.com/forums...9452&forum=114 |
|
#3
|
|||
|
|||
|
Good link DirtyWick.
|
|
#4
|
|||
|
|||
|
I've seen the defualt scripts, though I must admit I frequently find it easier to create simple scripts myself then to figure out someone else system so I skipped them in NWN1. That said, if they are easy to use and documented in any way I'm happy to adopt. Is there a list of what script/function does what out there somewhere? This is where I the snag in the past and just went what seemed to be the easier route (though I may have missed the easier route while going a different way...)
|
|
#5
|
|||
|
|||
|
Right now the most info you will find on the functions will be the comments in the scritps. In the Programming section of these forums I posted a list of the includes and the definitions they have within them.
But as to commenting on the uses of such is something I have in the works for later, probably after we get Raparia into Beta a bit. Hopefully someone else has a better idea of where to find the info you seek. |
|
#6
|
|||
|
|||
|
Because of previous NWN1 experiences, the OnHeartBeat event can be the cause of many system resources being taken up and performance suffering as the result. I would suggest using a "master section" that would contain all the references necessary for the random walking system within it and govern it with "IF" statements. The "IF" statements would check the current time of the module and spawn the appropriate NPCs to perform the appropriate actions. Once the NPCs are spawned their own scripts take over their actions. The main control script will only go into effect at "dawn" or "dusk," (plus a minor allowance for lag/timing), so during the rest of the day/night cycles this script is merely checked and ignored. Once a designated time slot has been reached, the appropriate "daytime" or "nightime" series of code gets run and the other is ignored entirely (not its time to be run).
A setup like this should help reduce server resource impact as much as possible, I believe. There is already enough going on with all the heat beat functions of the NPCs, you don't want to add more by throwing in the server event as well. Sincerely, -Velkyn
__________________
The only stupid question is the one never asked. |
|
#7
|
|||
|
|||
|
I'd say that "x0_i0_anims" is your best bet on how things work.
I can explain the bulk of it, though. Enable one of two lines in your spawn script, depending on if you want them walking around or standing still: Code:
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); |
|
#8
|
|||
|
|||
|
In the Court I've got the commoners that spawn in moving mostly around the outside of the Court with a few going through the inside. Then I have a few stationary shoppers at booths on the outside. Then on the inside I have four shoppers with module animations. I'm considering placing down NW_STOP waypoints for them to walk between.
Keeping them in a tight circle like that seems to help performance from when they were wandering all over the place. And this gives more of the illusion of the Court being busy than actually trying to make realistic shoppers. Thoughts? |
|
#9
|
|||
|
|||
|
Sounds good to me, you may see if you can get one to break off every once and again and move over to the merchant.
|
|
#10
|
|||
|
|||
|
Yeah, I was thinking of putting the NW_STOP waypoints at the merchants and see if that does the trick. I'm curious about scripted waypoints that I remember seeing a post a while back on the dev blog.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|