Tes3Mod:Living Cities

Overview
Adds schedules to the NPCs in many of the towns in Vvardenfell (listed below), but does not modify, in any fashion, individual NPCs (thus avoiding incompatibility with other mods). NPCs will go home at night, go to bars, go out at night, go shopping, go walking, and live their little lives on a daily basis. More guards come out at night (works brilliantly with mods such as TLM), and the schedules of NPCs have been done so as to imply who is sleeping with whom, who is the shady business elf, so on and so forth. 
Adds training sessions at several locations. 
Adds fishing boats at fishing villages.

Current Version
Version 03-13 at Mod History

Project Status


Schedule File Format
LCV schedules scripts are now automatically generated from a specially formatted text file, using a generator built into Wrye Mash. The format for this file is explained below, using an abbreviated chunk of the Seyda Neen schedule as an example...
 
comments Any text starting with '#' is a comment and is ignored. This is useful for adding notes about what the character is doing in case it isn't evident in the schedule itself.

town defines the base name for the scripts and constants. 

defs marks the beginning a section of text aliases. E.g., the def for "seyWarehouse" will expand to "Seyda Neen, Census Office Warehouse" whenever ".seyWarehouse" is later used in the file. 

sleep This builds the sleep script... Basically SC_Sleep is set to 1 in cells marked with a '+' and is set to 0 (off) in cells marked with a '-'. Note that a cell like Arrille's tradehouse will fall through and get caught by the last "Seyda Neen" -- hence you usually only need to put the town cell as last and define it as minus. Note that you can and should use text aliases here.

code These are chunks of code that getted added to the corresponding cycle scripts. Here the code to enable the fishing boats is added to cycles 1 and 2, while code to disable them is added to cycles 3 and 4. Code to be shared by all cycle scripts can be put immediately after the "code" line (e.g., before 1,2 in the example above).

NPC Schedules: So the final work is mostly defining the positionCell coordinates for the four times of day (1 = morning to 4 = after midnight). A repeated schedule is marked by a '= N' where N is the earlier cycle that is being repeated. 

An NPC's schedule can be made dependent on a condition -- e.g., Fargoth doesn't start doing his schedule until he's done his walkabout thing. Furthermore an npc can have several schedules, where different schedules are dependent on different conditions. E.g., Indrele's schedule could be dependent on her LGNPC Seyda Neen quest. 

For each schedule cycle, you define the cell to position them in, then their x, y, z and rotation coordinates. To get these coordinates, position the NPC in TESCS and then read their coordinates from the status bar. (In about the middle of the bar, you'll see something like: 258, -1528, -409 (0, 0, 329) -- the first three numbers are the x, y and z coordinates and the last number in parentheses is the rotation.) Usually, for cycle one, you'll use the original coordinates of the player -- though you don't have to. To get coordinates for other times of day, place a dummy NPC at the cell/position/rotation that you want and then read off their coordinates. (BTW, after placing a bunch of dummy NPCs, you want to make sure to NOT save the esp -- you're only using them to get information.) Also, you'll probably position your text editor window so that you can still see the TESCS status bar while typing the coordinates in the text editor window.

After you give the cell and coordinates, you need to give the AI action. Usually, this is wander, but it can also be travel or follow. The formats are:
- wander distance idleNumbers
- travel travel-to-coordinates
- follow who [etc. same as regular script command]
Note that for wander you should NOT enter the start time or duration -- these are automatically added by the code generator. Note also that there's no "AI" in front of wander, travel or follow. To get the NPC's original AI action, double click on them and then click on their AI button. (If the NPC is blocked, just uncheck "blocked", save, and then reopen them.) From the AI, you'll see the wander distance (ignore the duration and time of day numbers), then look at their idle numbers and mentally add a "0" at the beginning for "Idle 1" -- then match that number to one of the idles below. E.g. "40 20 20 10" matches to i42. (This may seem like a hassle, but there's only about 6 idles that are used really frequently, so you'll quickly learn them.)

For idlenumbers you usually use one of the built in idle text aliases, e.g. .i62 (0 60 20 10 10) or .s02 (0 15 15 20 10 40  0 25). Usually, you'll get the NPC's idle from their AI. Look at the NPC's object info and click on the AI 

The "s" idles are good for sleepy characters. Just make sure that NPCs that end up standing next to each other don't have exactly the same idles. I usually give women .s01 and men .s02.

It's pretty common for NPCs to stand in one place, and for them you can use ".stand" in place of "wander 0".

Remember you can also define arbitrary text aliases if it's convenient. For example, in Seyda Neen, everyone who stands lighthouse watch has the same position and AI action, so I define "seyLHWatch" to ""Seyda Neen" -12218 -74310 1107 257 wander 0"

Default text aliases are (from mush.py):