Author guide

Patrols on the roads the mod already has. New roads cannot be added from a plugin yet.

For mod authors

Put your own patrol on the road.

A patrol is a quest in your own plugin. You choose who rides, what they ride and where they are heading. The mod finds a road, puts them on it near the player and drives them there. No DLL work and no new models.

Your first patrol ↓

What a patrol is

Every group the mod puts on the road, from the Crimson Caravan to the NCR patrol jeep, is built the same way. Yours is no different.

Three parts

  • A quest with a script. The script declares a handful of variables by name and the mod reads them.
  • Pools: a list of drivers, a list of vehicles and a list of the places the patrol travels to.
  • The DrvEncounters form list. A quest on that list is one the mod will consider.

What the mod does with it

  • Picks a road that ends at one of your destinations and admits every vehicle in the group.
  • Places the group on that road out of the player’s sight and within reach.
  • Drives it along the road, round obstacles and past other traffic, to the far end.
  • Retires it once the player has left it behind.

Riders only exist near the player. A patrol is something you meet on the road, not a convoy that crosses the map while you are elsewhere.

Your first patrol

The example is an NCR supply run: one army jeep with a driver and a couple of troopers, travelling between NCR places. Your plugin needs New Vegas Drivables.esm as a master.

  1. Make the pools

    Create four form lists in your plugin. Fill MySupplyDrivers with driver NPC bases or a levelled NPC list. Put DrvJeepArmy in MySupplyVehicles and the trooper bases for its passenger seats in MySupplyTroopers. Add MojaveOutpostMapMarker and PrimmMapMarker to MySupplyDestinations. Use the road table to choose other destinations.

  2. Write the quest script

    Declare the variables the mod reads and set them once. The mod writes fLastSpawn, iAlive and rLastLeader. Declare these three variables and leave their values to the mod. The block after the set-up decides when the patrol may appear. The script on the right is complete.

  3. Create the quest

    Tick Start Game Enabled, attach the script and give it a short script delay. The shipped patrols use 0.25 seconds.

  4. Put it on the list

    The script adds its own quest to DrvEncounters. The mod reads that list when a save loads, so after installing your plugin, save and load once. Do not edit DrvEncounters in your plugin: two mods that both override the list would cancel each other out.

  5. Test it

    Stand near one of your roads and enter DrvStartEncounter MySupplyRun in the console. It works as soon as the quest is running, before the save and load. The patrol starts if it can. If it cannot, read the refusal in the corner of the screen.

The variables

The mod finds each one by its name, so spell them exactly. Declare only the ones you use. A variable you leave out takes its default.

VariableTypeWhat it sets
rDriversform list or levelled NPCWho drives the lead vehicle.
rVehiclesform list or levelled listWhat the lead vehicle can be. The mod only uses entries the chosen road admits.
rDestinationsform list of map markersWhere the patrol travels to. It appears on a road that ends at one of them.
iPlacementintSet to 6 for a road patrol.
iCategoryint2 for a group, which takes the one group slot near the player and waits out the interval between convoys. 0 for a lone rider counted with ordinary traffic.
iCountintVehicles in the group, 1 to 4.
iSizingintHow iCount is used. 0 draws a size up to it, 1 brings exactly that many, 2 brings any number from one to it.
iMaxAliveintHow many of this patrol’s riders may exist at once.
fCooldownfloatSeconds of play between spawns. Waiting, sleeping and fast travel run it down.
fWeightfloatIts chance against the other groups that could appear. The shipped patrols use 0.5 to 0.6.
fDensityfloatSet to 1. Lower it from your script to thin the patrol out, as the Crimson Caravan does when its owner dies.
iGateintSet to 1 while the patrol may appear and 0 while it may not. Your script decides: place, quest stage, reputation, time of day.
fHaltSecondsfloatSet it and the group halts at each end of its road, stands watch for about that long, then turns round and rides back.
rEscorts, rEscortDriversform listsVehicles and drivers for the rest of the group. Without them the followers come from the lead pools.
rLeaders, fLeaderChanceform list, floatA different lead vehicle at that chance, as the Legion patrol’s chariot.
rPassengers, iPassengersform list, intCrew for the lead vehicle’s spare seats, and how many.
rTrailers, fTrailerChanceform list, floatA trailer or cart behind the lead vehicle at that chance.
iInitintYour own flag so the set-up block runs once.

What the mod writes back

VariableTypeHolds
fLastSpawnfloatGameDaysPassed at the last spawn.
iAliveintHow many of the patrol’s riders exist now.
rLastLeaderrefThe driver who led the last group.

Declare all three even if you never read them: the cooldown is kept in fLastSpawn and does nothing without it. They save with the quest, so a cooldown survives a reload. The Drv:OnEncounterSpawn and Drv:OnEncounterEnd events on the Modders page report the same moments.

The roads

A patrol rides one of these 21 roads, either way along it. Put a road’s end marker in your destinations list and the patrol can appear on that road, heading for that end.

RoadOne endOther end
The 188 to Boulder City188MapMarkerBoulderCityMapMarker
The 188 to Novac188MapMarkerNovacMapMarker
The 188 to Sloan188MapMarkerSloanMapMarker
The 188 to Camp Golf188MapMarkerCampGolfMapMarker
Westside to the 188WestsideWestEntranceMapMarker188MapMarker
Crimson Caravan to the 188CrimsonCaravanMapMarker188MapMarker
Crimson Caravan to Bitter SpringsCrimsonCaravanMapMarkerBitterSpringsMarkerREF
Sloan to Crimson CaravanSloanMapMarkerCrimsonCaravanMapMarker
Bonnie Springs to WestsideBonnieSpringsMapMarkerWestsideWestEntranceMapMarker
Goodsprings to SloanGoodsprings map marker (no editor ID, form 000CDF51)SloanMapMarker
Goodsprings to PrimmGoodsprings map marker (no editor ID, form 000CDF51)PrimmMapMarker
Sloan to PrimmSloanMapMarkerPrimmMapMarker
Primm to Mojave OutpostPrimmMapMarkerMojaveOutpostMapMarker
Primm to Novac via NiptonPrimmMapMarkerNovacMapMarker
Mojave Outpost to NiptonMojaveOutpostMapMarkerNiptonMapMarker
Mojave Outpost to NovacMojaveOutpostMapMarkerNovacMapMarker
Nipton to NovacNiptonMapMarkerNovacMapMarker
Boulder City to NovacBoulderCityMapMarkerNovacMapMarker
Novac to SearchlightNovacMapMarkerSearchlightMapMarker
Searchlight to Viper’s EncampmentSearchlightMapMarkerHighway95VipersMapMarker
Cottonwood Cove to SearchlightCottonwoodCoveMapMarkerSearchlightMapMarker

The Goodsprings map marker is the one road end with no editor ID. Pick the reference itself in the GECK when you add it to a form list. Where a script needs a name, such as a GetDistance check in your gate, use GoodspringsArrivalMarker, the fast-travel arrival point the map marker links to.

What each road admits

Use sRouteClass in the vehicle definition. All 21 roads exclude the truck class. Cars, horses, motorcycles and bicycles share a direction on each road. If a patrol of any of those classes is already riding the other way, a new patrol of those classes must find another road or wait.

What it will not do

Better to know before you build around it.

  • No new roads from a plugin. The 21 roads are generated from the game’s road surfaces with our own tools. Camp McCarran, the Strip and Freeside are not on any of them.
  • No timetable. A cooldown is the nearest thing to a schedule, and a patrol only ever appears near the player.
  • No fights started for you. Riders whose factions would fight the people where the patrol would appear are not placed there.
  • One group at a time. A group shares the roads with the mod’s own convoys and waits its turn after them.
  • Four vehicles at most in a group.
  • The riders are ordinary NPCs. Their factions, weapons and packages decide what they do when they meet trouble.

When it does not appear

Run DrvStartEncounter with your quest to see the reason for a refused spawn on screen. For a log on the release build, repeat the attempt within 15 seconds of loading a save. Search new_vegas_drivables.log in the game directory or your mod manager’s overwrite output for the refusal or your quest’s editor ID.

My quest is never mentioned in the log

Check that your script ran AddFormToFormList DrvEncounters, then save and load. The line encounter: DrvEncounters holds N quests should count one more than before.

“gate closed”

Your script has iGate at 0. Check the conditions that set it and that the quest is running.

“cooldown” or “convoy interval”

It is waiting its turn. The first is your own fCooldown. The second is the gap the mod keeps between any two groups. DrvStartEncounter skips both for a test.

“No patrol road within reach” or “No patrol road point within reach is free”

None of your destinations is the end of a road near the player, or every point on those roads is in view, taken or too close to its end. Move away from town, look elsewhere and try again. The log line counts each reason.

The wrong vehicle turns up, or never the one I listed

The road does not admit it. Check its class against what each road admits.

The patrol appears and attacks, or is attacked

That is its drivers’ factions at work. Use NPC bases whose factions fit the roads you send them down.

Back to your first patrol ↑Modders ↑