Route Set

Route sets define groups of route names that will be used by the specified command post to arrange its soldiers for time and phase-based patrols, shift break routes, travel route groups, special Walker Gear parking routes and weather-dependent routes. These do not define the actual route data - that would be `.frt` Fox Route files, only one of which can be loaded in an `.fpk` pack.

This is as minimal as you can get with a custom route set: one priority route group, sneak day and night sets, and a caution set, along with an empty hold route group.

```
this.routeSets = {
	ms\_13\_34\_ob = {
		priority = {
			"groupA",
		},
		sneak\_day = {
			groupA = {
				"rts\_d\_ene01\_13to34\_0000",
				"rts\_d\_ene02\_13to34\_0000",
			},
		},
		sneak\_night = {
			groupA = {
				"rts\_n\_ene01\_13to34\_0000",
				"rts\_n\_ene02\_13to34\_0000",
			},
		},
		caution = {
			groupA = {
				"rts\_d\_ene01\_13to34\_0000",
				"rts\_d\_ene01\_13to34\_0000",
			},
		},
		hold = {
			default = {},
		},
	},
	//...
}

```

## Route Sets Lua Table

### Parameters

#### USE\_COMMON\_ROUTE\_SETS

Optional boolean flag. Set to true to use common route sets from `afgh_routeSets.lua` or `mafr_routeSets.lua`. The merging is a complex process if you define more custom route set types.

```
this.routeSets={
    afgh\_field\_cp = {
        USE\_COMMON\_ROUTE\_SETS = true,
        //...
    },
    //...
}

```

#### priority

List of shift-based route group names, listed in descending order of priority. Usually named "groupA", "groupB", etc., but they're arbitrary.

```
this.routeSets={
    afgh\_field\_cp = {
		priority = {
			"vip",
			"groupSniper",
			"groupA",
			"groupB",
			"groupC",
			"groupD",
		},
        //...
    },
    //...
}

```

#### fixedShiftChangeGroup

List of shift-based route group names that are fixed, meaning the soldiers using these routes will not cross over into other route groups on shift changes. Used commonly for VIPs, snipers, and other importantly-placed soldier routes.

```
this.routeSets={
    afgh\_field\_cp = {
		fixedShiftChangeGroup = {
			"vip",
			"groupSniper",
		},
		//...
    },
    //...
}

```

### Shift-based grouped route sets

These route sets of groups change by shifts and phases, and are grouped with names like the ones defined above. These route sets all follow the same format:

```
this.routeSets={
    afgh\_field\_cp = {
        sneak\_day = {
			groupA = {
				"rt\_field\_d\_0000",
				"rt\_field\_d\_0002",
				"rt\_field\_d\_0012",
				"rt\_field\_d\_0013",
			},
			groupB = {
				"rt\_field\_d\_0011",
				"rt\_field\_d\_0010\_sub",
				"rt\_field\_d\_0014",
				"rt\_field\_d\_0006",
			},
		    //...
		},
		//...
    },
    //...
}

```
For route names that are meant to attract a soldier with a sniper rifle or a VIP, you should use a table instead of a route, with the first entry in the table being the route name, and the other, an `attr` string that defines whether the route should only be used by snipers or a VIP.

```
this.routeSets={
    mafr\_lab\_cp = {
		sneak\_day = {
			vip = {
				{ "rts\_10093\_d\_0000", attr = "VIP" },
			},
			//...
		},
		//...
    },
    //...
}

```

```
this.routeSets={
    afgh\_remnants\_cp = {
		sneak\_day = {
			groupSniper = {
				{ "rt\_remnants\_snp\_0000", attr = "SNIPER" },
				{ "rt\_remnants\_snp\_0001", attr = "SNIPER" },
			},
            //...
		},
		//...
    },
    //...
}

```

#### sneak\_day

Sets of groups of routes used in the Sneak phase in the daytime, starting from 06:04:33.

#### sneak\_night

Used in the Sneak phase in the nighttime, starting from 18:14:13. When the set `sneak_midnight` is not defined, which is always in the vanilla game, is also used starting from 22:00:00.

#### sneak\_midnight

Used in the Sneak phase around midnight, starting from 22:00:00. Never used in the vanilla game, but seemingly can still be used. When it's not defined, `sneak_night` overwrites it.

#### caution

Used in the Caution phase. Usually all routes are stored into the first route group, leaving other route groups as empty tables.

#### hold

Used for extra soldiers who don't get a free route in other route groups on shift changes in the Sneak phase in the daytime. Usually uses an undefined `default` route group, but seemingly per-route group hold and sleep routes can be used. Is usually always there, even if it's empty, as in contains an empty table of a `default` route group.

```
this.routeSets={
    afgh\_field\_cp = {
		hold = {
			default = {
				"rt\_field\_h\_0000",
				"rt\_field\_h\_0001",
				"rt\_field\_h\_0002",
				"rt\_field\_h\_0003",
			},
			//...
		},
        //...
    },
    //...
}

```

#### sleep

Just like `hold` above, but for nighttime, and has sleep routes where soldiers sleep while sitting or lying on beds.

### Other

#### travel

This route set's route groups are fully managed by the travel plan system, they are not at all affected by priority, the fixed list, shifts or phases. The route groups expected here can be used for the reinforcements system or by simplified travel plans.

##### lrrpHold

This route group that appears in guard posts (`_ob`) and command posts (`_cp`) is used by simplified travel plans. The routes in it are for soldiers smoking in a spot where the LRRP patrol stays at the CP after moving into it and before moving out of it. Usually has two different routes.

```
this.routeSets={
    afgh\_field\_cp = {
		travel = {
			lrrpHold = {
				"rt\_field\_l\_0000",
				"rt\_field\_l\_0001",
			},
            //...
		},
        //...
    },
    //...
}

```

##### lrrp\_%02dto%02d

These route groups that appear in LRRP CPs (`_lrrp`) between the indexed CPs in its name. These usually contain two duplicate names of the same route that leads from the first indexed CP and to the other, and the soldiers driving a vehicle or walking along that route will be synchronized that way. Used by simplified travel plans. For simplified travel plans, the LRRP CP name should also be formatted in `%s_%02d_%02d_lrrp`, with the four letter location name at the start and the first CP index being the lesser number to the second. The indices are defined for vanilla locations in `afgh_travelPlans.lua` and `mafr_travelPlans.lua`, or in the enemy subscript's `lrrpNumberDefine` and `cpLink` tables, which are never used in the vanilla game.

```
this.routeSets={
    afgh\_field\_cp = {
		travel = {
			lrrp\_01to13 = {
				"rt\_01to13\_0000",
				"rt\_01to13\_0000",
			},
			lrrp\_13to01 = {
				"rt\_13to01\_0000",
				"rt\_13to01\_0000",
			},
            //...
		},
        //...
    },
    //...
}

```
Formatted name examples would be: `lrrp_01to13`, `lrrp_21to20`.

##### rp\_%02dto%02d

Just like `lrrp_%02dto%02d` above, but used by reinforcement plans. Has four duplicate route names instead, and those route names can be the same as the two `lrrp_%02dto%02d` has.

```
this.routeSets={
    afgh\_field\_cp = {
		travel = {
			rp\_01to13 = {
				"rt\_01to13\_0000",
				"rt\_01to13\_0000",
				"rt\_01to13\_0000",
				"rt\_01to13\_0000",
			},
			rp\_13to01 = {
				"rt\_13to01\_0000",
				"rt\_13to01\_0000",
				"rt\_13to01\_0000",
				"rt\_13to01\_0000",
			},
            //...
		},
        //...
    },
    //...
}

```

#### walkergearpark

A list of routes that soldiers will leave Walker Gears at when they return to the Sneak phase. These are not grouped and are just a direct list of routes for the CP, which can't be merged into the common route set.

```
this.routeSets={
    afgh\_sovietBase\_cp = {
		walkergearpark = {
			"rts\_sovietBase\_walkerGearPark0000",
			"rts\_sovietBase\_walkerGearPark0001",
			"rts\_sovietBase\_walkerGearPark0002",
		},
        //...
    },
    //...
}

```

#### outofrain

A list of routes soldiers will temporarily use when it rains or a sandstorm comes in. Usually they're placed indoors or under a roof. These are also not grouped and are a direct list of routes, which also can't be merged into the common route set.

```
this.routeSets={
    afgh\_sovietBase\_cp = {
		outofrain = {
			"rt\_field\_r\_0000",
			"rt\_field\_r\_0001",
			"rt\_field\_r\_0002",
			"rt\_field\_r\_0003",
			"rt\_field\_r\_0004",
			"rt\_field\_r\_0005",
			"rt\_field\_r\_0006",
			"rt\_field\_r\_0007",
			"rt\_field\_r\_0008",
			"rt\_field\_r\_0009",
			"rt\_field\_r\_0010",
			"rt\_field\_r\_0011",
			"rt\_field\_r\_0012",
			"rt\_field\_r\_0013",
			"rt\_field\_r\_0014",
			"rt\_field\_r\_0015",
			"rt\_field\_r\_0016",
		},
        //...
    },
    //...
}

```