What you basically need to do is setup packages that work off a controlling condition that becomes set when they've reached the destination of their previous package. The problem however is that in order for it to work, you need to script each actor separately. Meaning that each of your guards has to be a unique NPC with its own packages and scripts. Fortunately however, if you are wanting your NPCs to just keep running through their routines endlessly unless another package is called, you can just make a single package for every route and use both their placement on the list and a controlling condition to decide when they should run that package.
The easiest controlling condition would probably be by using a faction rank which is changed based on what the previous package was. You will probably already have a faction created for these guards, so all you're really doing is making further use of something that is already present. Factions have an advantage over script functions in this case since they don't need to point to a specific actor within package conditions and instead check against the actor the package is attached to (don't need to make unique packages for every actor). Make about a dozen of these to start.
With the package conditions, make the package available at any time, any day, but based on one of those faction ranks you defined earlier. Each NPC will only travel this path for as long as they are set to that specific rank. As soon as they change rank (through scripting) they will move to a different path). For the sake of simplicity, we'll work around the assumption of a square shaped path with a side hall that you also want covered:
#1-----------------#5
|XXXXXXXXXXXXX|
|XXXXXXXXXXXXX|
|XXXXXXXXXXXXX|
|XXXXXXXXXXXXX|
|XXXXXXXXXXXXX|
|XXXXXXXXXXXXX|
#2-----------------#3
|
|
|
|
|
|
#4
The numbers relate to the destination of the package and their respective faction condition.
Remember, packages define the end location, not the starting one, so both the conditions and scripts should dictate the destination rather than the path. So, package with condition 1 will have the ending location at #1, package with condition 2 will have an ending location at #2... and so on. All packages should be travel packages.
The script will be dictating which location would be next to be traveled to based around a http://cs.elderscrolls.com/constwiki/index.php/OnPackageDone block. Although you will probably need to make unique scripts for each actor, this is much easier than trying to make both unique scripts and packages. Fortunately, you can use the same scripts for the same actors who walk the same paths (day and night shift) or use the same script for two actors who have different package targets (different package sets). Using the above layout, the script for one patrol route could look like:
begin onpackagedone PRTwalktoNum1setfactionrank 4endbegin onpackagedone PRTwalktoNum4setfactionrank 2endbegin onpackagedone PRTwalktoNum2setfactionrank 3endbegin onpackagedone PRTwalktoNum3setfactionrank 5endbegin onpackagedone PRTwalktoNum5setfactionrank 1end
Although you may need to make multiple scripts, the scripting for each, as you can see, is very simple and low demand.
This would make the actor walk in a counter clockwise pattern from 1 to 4, from 4 to 2 to 3, then from 3 to 5 to 1, ignoring any other small hallway or room connections that might exist in the X'ed area. The thing to watch out for when setting up this route is to avoid circular logic like:
begin onpackagedone PRTwalktoNum4setfactionrank 2endbegin onpackagedone PRTwalktoNum2setfactionrank 3endbegin onpackagedone PRTwalktoNum3setfactionrank 2endbegin onpackagedone PRTwalktoNum2setfactionrank 4end
The problem with this bit is that the return trip from 3 to 2 to 4 won't work since you're using the same package and destination twice. Rather than go back to 4, the NPC would just keep walking between points 2 and 3. To get around this, either you would need to place a new point #6 at the same location as 2, and tie it to the condition of 6, changing it to:
begin onpackagedone PRTwalktoNum4setfactionrank 2endbegin onpackagedone PRTwalktoNum2setfactionrank 3endbegin onpackagedone PRTwalktoNum3setfactionrank 6endbegin onpackagedone PRTwalktoNum6setfactionrank 4end
Or if there are no shorter routes between point 3 and 4, just directing the NPC to point #4 from point #3, skipping 2 entirely.
It's a little complicated, but with a bit of thought and planning can work out rather well. Just remember that you don't need to have the end of a package at every single corner the NPC will cross, or even every turn, but instead only in places where you have multiple routes between two "ends" of the patrol route (point #3 to point #1, point #1 to #3). For all your other packages, just use the normal hourly settings, and place those packages at the
top of the list. This will mean that the actor will just keep running his route from the last point he ended on until interrupted by eating/sleeping. By having the packages setup this way, you can have different shifts for the same route and packages, just using different eat/sleep package times. Below those packages add all the patrol packages that the actor will use based on their script.
Before completing the NPC,
set their initial faction rank to one of the points within their package route. If you forget to give them a faction that relates to a package destination, they won't do anything. As an actor's faction is controlled in the base form, their rank will constantly be changing, deciding which package to use next, and will persist across play sessions or even respawns of that actor.