The Driver Syndicate/Vehicles/Vehicle Zones: Difference between revisions

From Equilibrium Engine Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
== Making Vehicle Zones ==
== Making Vehicle Zones ==
Each level/city can have it's own unique sets of vehicles. Vehicle zones are defined in the file located in next path:
Each level/city can have it's own unique sets of vehicles. Vehicle zones are defined in the file located in next path:
  <Addon Folder>/scripts/levels/<Level Name>_vehiclezones.def
  <Addon Folder>/scripts/lua/levels/<Level Name>_vehicles.lua
For '''default''' level it is going to be located in '''GameData/scripts/levels/default_vehiclezones.def'''
For '''default''' level it is going to be located in '''GameData/scripts/lua/levels/default_vehicles.lua'''
 
For '''parking''' level it is going to be located in '''GameData/scripts/levels/parking_vehiclezones.def'''


If your city is in early stages of development or for some reason it does not have vehicle zones, the game will fall back for ''default'' one.
If your city is in early stages of development or for some reason it does not have vehicle zones, the game will fall back for ''default'' one.


== File Structure ==
== File Structure ==
Example of vehiclezones.def file:<syntaxhighlight lang="cpp" line="1">
Example of vehicles.lua file:<syntaxhighlight lang="lua" line="1">
copcar "cop_regis";
local FreeRideVehicleSet = {
    CopVehicles = {
        default = {
            Patrol = {
                cop_regis  = { },
                --cop_k5      = { minFelony = 0.75 }
            },
            RoadBlock = {
                cop_regis  = { },
                --cop_k5      = { minFelony = 0.75 }
            },
        },
mission3 = {
            Patrol = {
k5 = { type = "GangAI", tags = PURSUER_PATROL_TAGS }
            },
            RoadBlock = {}, -- no roadblocks
        },
mission4 = {
            Patrol = {
k5 = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
mustang = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
carla = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
            },
            RoadBlock = {}, -- no roadblocks
        },
    },
    Traffic = {
        default = {
            rollo      = {},
            mustang = {},
            mustang_f = {},
            carla = {},
            torino = {},
            taxi = { interval = 5, tags = "taxi" },
            ranchero = { interval = 5 },
            k5 = { interval = 8 },
            van = { interval = 15 },
            cop_regis = { interval = 20, traffic = false }, -- cops are spawn by the requests
            vette = { interval = 15 },
            --suburban = { interval = 25 },
            --bus = { interval = 30, parked = false },
        },
        warehouses = {
            ranchero = { interval = 3 },
            k5 = { interval = 3 },
            van = { interval = 4 },
            taxi = { interval = 12, tags = "taxi" },
            rollo      = { interval = 2 },
            mustang = { interval = 2 },
            mustang_f = { interval = 2 },
            carla = { interval = 2 },
            torino = { interval = 2 },
            cop_regis = { interval = 20 },
            vette = { interval = 25 },
        },
    }
}


default
local GameModeVehicleSets = {
{
    ["freeride"] = FreeRideVehicleSet,
rollo 0;
    --["minigames/survival"] = SurvivalVehicleSet
mustang 0;
mustang_f 0;
carla 0;
torino 0;
taxi 5;
ranchero 5;
k5     8;
van     15;
cop_regis 20;
vette 15;
}
}


outskirts
local vehicleSet = GameModeVehicleSets[MissionManager:GetGameMode()]
{
 
van     10;
-- always return freeride set if no corresponding gamemode set has been found
ranchero 0;
return vehicleSet or FreeRideVehicleSet
k5     2;
suburban 5;
rollo 0;
}
</syntaxhighlight>In this example:  
</syntaxhighlight>In this example:  


# '''default''' and '''outskirts''' are representing zone names. ''Currently only default is used and IT DOES NOT represent a level name.''
# '''default''' and '''warehouses''' are representing zone names. ''Currently only default is used and IT DOES NOT represent a level name.''
# '''rollo, mustang, carla, van''' etc are the [[The Driver Syndicate/Vehicles/Configuration File|vehicle script]] names that are spawned for that zones
# '''rollo, mustang, carla, van''' etc are the [[The Driver Syndicate/Vehicles/Configuration File|vehicle script]] names that are spawned for that zones
# '''numbers''' are represeting the spawn interval which also determines the rarity of traffic in a level.
# '''numbers''' are represeting the spawn interval which also determines the rarity of traffic in a level.
# '''copcar''' sets the cop car script globally for the level
# '''CopVehicles''' sets the cop car script globally for the level
 
== See Also ==
[[The Driver Syndicate/Vehicles/Configuration File|Vehicle configurations]]

Latest revision as of 19:25, 24 January 2025

Vehicle Zones are used to define named vehicle sets for the level.

Currently it's not possible to set vehicle zones to other than default yet but with ongoing road system refactoring it's coming true soon.

Making Vehicle Zones

Each level/city can have it's own unique sets of vehicles. Vehicle zones are defined in the file located in next path:

<Addon Folder>/scripts/lua/levels/<Level Name>_vehicles.lua

For default level it is going to be located in GameData/scripts/lua/levels/default_vehicles.lua

If your city is in early stages of development or for some reason it does not have vehicle zones, the game will fall back for default one.

File Structure

Example of vehicles.lua file:

local FreeRideVehicleSet = {
    CopVehicles = {
        default = {
            Patrol = {
                cop_regis   = { },
                --cop_k5      = { minFelony = 0.75 }
            },
            RoadBlock = {
                cop_regis   = { },
                --cop_k5      = { minFelony = 0.75 }
            },
        },
		mission3 = {
            Patrol = {
				k5 = { type = "GangAI", tags = PURSUER_PATROL_TAGS }
            },
            RoadBlock = {},	-- no roadblocks
        },
		mission4 = {
            Patrol = {
				k5 = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
				mustang = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
				carla = { type = "GangAI", tags = PURSUER_PATROL_TAGS },
            },
            RoadBlock = {},	-- no roadblocks
        },
    },
    Traffic = {
        default = {
            rollo       = {},
            mustang		= {},
            mustang_f	= {},
            carla		= {},
            torino		= {},
            taxi		= { interval = 5, tags = "taxi" },
            ranchero	= { interval = 5 },
            k5			= { interval = 8 },
            van			= { interval = 15 },
            cop_regis	= { interval = 20, traffic = false }, -- cops are spawn by the requests
            vette		= { interval = 15 },
            --suburban	= { interval = 25 },
            --bus		= { interval = 30, parked = false },
        },
        warehouses = {
            ranchero	= { interval = 3 },
            k5			= { interval = 3 },
            van			= { interval = 4 },
            taxi		= { interval = 12, tags = "taxi" },
            rollo       = { interval = 2 },
            mustang		= { interval = 2 },
            mustang_f	= { interval = 2 },
            carla		= { interval = 2 },
            torino		= { interval = 2 },
            cop_regis	= { interval = 20 },
            vette		= { interval = 25 },
        },
    }
}

local GameModeVehicleSets = {
    ["freeride"] = FreeRideVehicleSet,
    --["minigames/survival"] = SurvivalVehicleSet
}

local vehicleSet = GameModeVehicleSets[MissionManager:GetGameMode()]

-- always return freeride set if no corresponding gamemode set has been found
return vehicleSet or FreeRideVehicleSet

In this example:

  1. default and warehouses are representing zone names. Currently only default is used and IT DOES NOT represent a level name.
  2. rollo, mustang, carla, van etc are the vehicle script names that are spawned for that zones
  3. numbers are represeting the spawn interval which also determines the rarity of traffic in a level.
  4. CopVehicles sets the cop car script globally for the level

See Also

Vehicle configurations