The bottom line is that the work per NPC is not overwhelming, but it is not that trivial either.
The number of NPCs is what makes it discouraging. (there are about 2800 NPCs in the CS)
Besides, for this particular behavior (running when it is raining) there might be other, more generic, solutions.
I suppose it would not be that difficult to devise a mod that uses OBSE's SetPackageAlwaysRun to make NPCs around the player run when raining.
Anyway, I can give you guys an idea of the amount of work:
First, a quick review of the concept:
The engine replaces the AI packages, but runs on similar concepts:
- Instead of AI packages, there are Activities and Stages (data in arrays)
- Instead of package types (wander, travel, etc), there are Actions ( script functions)
- Instead of a series of packages, NPCs have a Schedule (data in arrays)
Starting from the concept bottom:
ACTIONS
Actions are the scripted behavior of the NPCs.
The scripts apply AI packages dynamically, according to the situation at hand. For example, if the NPC is running a Travel action and it starts raining, the script will either equip a raincoat or switch to a 'run to location' AI package.
There are a few already done: Travel to, Wander, Eat, Drink, Sleep and Brawl.
Other behaviors need new scripts.
ACTIVITIES and STAGES
An Activity is pretty much a list of stages to be executed one after the other.
A Stage is a block of data pointing to the Action script and the proper AI package
SCHEDULES
Schedules are the activities the NPC will perform during the day.
Each period of so many hours may have multiple activities to, randomly, choose from. This way an NPC may eat at one place one day and at another place the next day.
Now, what you may need to do to apply the existing engine (no new behaviors) to other NPCs:
Supposing you want to keep the NPC schedule close to the vanilla schedule, creating the NPC schedule would the most time consuming activity.
You need to anolyze the vanilla AI package list, their times and conditions and adapt and transpose it to the proper arrays in the mod.
A final schedule code would look like this:
call zvActorBuildActivity oActor zSleep 6 30 03 9 1 1 call zvActorAddBaseActivity oActor zSleep 100 zSleepPrivRoom02 call zvActorBuildActivity oActor zWander1 4 30 09 13 1 1 call zvActorAddBaseActivity oActor zWander1 10 zWanderDock01 call zvActorAddBaseActivity oActor zWander1 15 zWanderDock02 call zvActorAddBaseActivity oActor zWander1 25 zWanderDock03 call zvActorAddBaseActivity oActor zWander1 30 zWanderDock04 call zvActorAddBaseActivity oActor zWander1 10 zWanderFocsle call zvActorAddBaseActivity oActor zWander1 10 zWanderFBowl call zvActorBuildActivity oActor zLunch 1 15 13 14 1 1 call zvActorAddBaseActivity oActor zLunch 80 zEatFocsle call zvActorAddBaseActivity oActor zLunch 20 zEatFBowl call zvActorBuildActivity oActor zWander2 4 30 14 18 1 1 call zvActorAddBaseActivity oActor zWander2 100 zWanderAnvilFountain call zvActorBuildActivity oActor zWander3 3 30 18 21 1 1 call zvActorAddBaseActivity oActor zWander3 100 zWanderShipDeck call zvActorBuildActivity oActor zDrink 1 20 21 3 1 3 call zvActorAddBaseActivity oActor zDrink 80 zDrinkFocsle call zvActorAddBaseActivity oActor zDrink 20 zDrinkFBowl call zvActorBuildActivity oActor zDine 1 10 21 3 1 1 call zvActorAddBaseActivity oActor zDine 80 zEatFocsle call zvActorAddBaseActivity oActor zDine 20 zEatFBowl call zvActorBuildActivity oActor zWander4 1 30 21 3 1 2 call zvActorAddBaseActivity oActor zWander4 10 zWanderDock01 call zvActorAddBaseActivity oActor zWander4 15 zWanderDock02 call zvActorAddBaseActivity oActor zWander4 25 zWanderDock03 call zvActorAddBaseActivity oActor zWander4 30 zWanderDock04 call zvActorAddBaseActivity oActor zWander4 10 zWanderFocsle call zvActorAddBaseActivity oActor zWander4 10 zWanderFBowl call zvActorBuildActivity oActor zDefault .5 10 0 0 0 0 call zvActorAddBaseActivity oActor zDefault 100 zWanderHome
The first line reads: the period named zSleep runs for 6 hours, +/- 30 minutes, starting around 3AM, ending around 9AM and runs only once
The second line reads: the period zSleep has 100% chance of running Activity 'zSleepPrivRoom02'
While creating the schedule, you will create new Activities and Stages as needed.
Let's say you want an NPC to wander at the Arboretum.
First you need an AI package. The vanilla ones are no good, as they usually have time and duration set. But you may clone it, removing the time and duration from the schedule tab.
The you create the Activity and Stage arrays. The code would look like this:
call zvBuildStage zWanderArboretum01 zzActionWander ArboretumMainGateMarker aaMyWanderArboretumPackagecall zvBuildBaseActivity zWanderArboretum01 zOutdoors zWander call zvAddStage zWanderArboretum01 zWanderArboretum01
The first line reads: create a Stage named "zWanderArboretum01" that uses the Action function "zzActionWander", has a reference marker ArboretumMainGateMarker (a vanilla XMarker) and uses the AI package "aaMyWanderArboretumPackage"
The second line reads: Create an Activity named "zWanderArboretum01" that runs outdoors (for the raining behavior) and is of type "zWander"
The third line reads: Add the Stage "zWanderArboretum01" to the Activity "zWanderArboretum01"
Probably there are a few other minor things that escape me at the moment.