Modding Guide: How to create ELS mods!

Modding Guide: How to create ELS mods!

Example Mods


Modding Guide: How to create ELS mods! image 1

Modding Guide: How to create ELS mods! image 2

Welcome to our Modding Guide!

ELS Modding is quite a bit more complex than the previous mods related to skins, uniforms, and names. To make sure you know where and how to start, we've put together a collection of example mods.

Check out the Example Mods Collection in the Steam Workshop.

We've also updated the Official Modding Kit which now contains the Example Mods as well.

After downloading the Example Mods and the Modding Kit, you can find the files here:

C:\Program Files (x86)\Steam\steamapps\workshop\content\997010

How To Create A Modpack


Modding Guide: How to create ELS mods! image 10

This guide focuses specifically on ELS Modding and requires a basic understanding of how the creation of mods for Police Simulator: Patrol Officers works.

To learn more about it, we highly recommend taking a look at our previous guide in which you get to know everything you need to know about creating, uploading and downloading mods for the game. In that guide, you can also learn more about the nature of Override Mods.

Check out the official guide on Steam:

https://steamcommunity.com/sharedfiles/filedetails/?id=2778896763

Supported Override Keys In The Manifest.json File


Modding Guide: How to create ELS mods! image 16
Modding Guide: How to create ELS mods! image 17

In the usual manifest.json file (to be found at <ModDir>/FancyMod/manifest.json), we support the following Override Keys for ELS Modding:

OverrideKey OverrideValue Type & Example Description POLICE_CAR1_ELS_

LIGHT_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Cruiser/ElsLightPattern.json" Replaces the ELS light pattern of the cruiser saved in a level sequence with the pattern defined in the json file POLICE_CAR1_ELS_

BLIP_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Cruiser/BlipLightPattern.json" Replaces the Blip light pattern of the cruiser saved in a level sequence with the pattern defined in the json file POLICE_CAR2_ELS_

LIGHT_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Interceptor/ElsLightPattern.json" Replaces the ELS light pattern of the interceptor saved in a level sequence with the pattern defined in the json file POLICE_CAR2_ELS_

BLIP_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Interceptor/BlipLightPattern.json" Replaces the Blip light pattern of the interceptor saved in a level sequence with the pattern defined in the json file POLICE_CAR3_ELS_

LIGHT_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Utility/ElsLightPattern.json" Replaces the ELS light pattern of the utility saved in a level sequence with the pattern defined in the json file POLICE_CAR3_ELS_

BLIP_PATTERN "OverrideValue": "%MODPACK%/PoliceCar_Utility/BlipLightPattern.json" Replaces the Blip light pattern of the utility saved in a level sequence with the pattern defined in the json file

Supported Override Keys In The Individual ElsLightPattern.json & BlipLightPattern.json File


Modding Guide: How to create ELS mods! image 27
Modding Guide: How to create ELS mods! image 28

Use this reference image when working on your mod. Please click on the image for a higher resolution so that you can actually read the text.

Some example directions for these Override Keys could look like this:

<ModDir>/FancyMod/PoliceCar_Cruiser/manifest.json

<ModDir>/FancyMod/PoliceCar_Interceptor/manifest.json

<ModDir>/FancyMod/PoliceCar_Utility/manifest.json

We want to provide you with a solution that allows for a maximum of customizability when it comes to adjusting the patterns. This includes the adjustment of emission levels, several addressees, color and frequency.

Further down below, we provide a self-explanatory example for changing a select light pattern. In these individual ElsLightPattern.json and BlipLightPattern.json files we support the following Override Keys:

Flasher Patterns

OverrideKey OverrideValue Type & Example Description "FlasherEmissionLevel" float value: "0.5" This value adjusts the emission level of the flashers. "OverrideKey" Name of the addressed flasher:

"Front_Left_1"

"Front_Left_2"

"Front_Left_3"

"Mirror_Left_1"

"Side_Left_1"

"Side_Left_2"

"Back_Inner_Left_1"

"Back_Inner_Left_2"

"Back_Inner_Left_3"

"Top_Back_Left_1"

"Top_Back_Left_2"

"Top_Front_Left_1"

"Top_Front_Left_2"

"Top_Side_Left_1"

"Top_Lower_Back_Left_1"

"Top_Lower_Back_Left_2"

"Top_Lower_Back_Left_3"

"Front_Right_1"

"Front_Right_2"

"Front_Right_3"

"Mirror_Right_1"

"Side_Right_1"

"Side_Right_2"

"Back_Inner_Right_1"

"Back_Inner_Right_2"

"Back_Inner_Right_3"

"Top_Back_Right_1"

"Top_Back_Right_2"

"Top_Front_Right_1"

"Top_Front_Right_2"

"Top_Side_Right_1"

"Top_Lower_Back_Right_1"

"Top_Lower_Back_Right_2"

"Top_Lower_Back_Right_3" The name of the flasher that the player wants to address and change. If a flasher does not get addressed the default pattern will be played for this player. "ColorOverrideValue" RGB Value : "rgb(209, 34, 41)" This value changes the light pattern for the overridden flasher. "FrequencyOverrideValues" Boolean list for each frame:

[ "False", "False", "True",

"False", "False","True",

"False", "False", "True",

"False", "False", "True",

"False","False", "True",

"False", "False", "True",

"False", "False", "True",

"False", "False", "True",

"False","False", "True",

"False", "False", "True", ... ] The actual ELS light pattern.

Each second consists of 30 frames. For an easy use it's recommended that for each second 30 booleans are used.

ElsLightPattern.json:

5 seconds x 30 frames = 150 booleans

BlipLightPattern.json:

1 seconds x 30 frames = 30 booleans

If the player uses more than the maximum boolean amount all the rest will not be considered.

If the player uses less than the maximum boolean amount the booleans get evenly distributed between the LoopTime (like that it’s hard to predict how the end result will look like).

The booleans will create keyframes where the system interpolates the light intensity between 0 and the value set in the FlasherEmissionLevel Key. The booleans are not fixed states.

When: "True", "False", "False" the light interpolates down from one Keyframe to the other and is then fully turned off.

When: "False", "True" the light interpolates up from one keyframe to the other and is then fully turned on, but the light will already be turned on after the false keyframe passed.

"TurretLightPatterns"

OverrideKey OverrideValue Type & Example Description "OverrideKey" Name of the addressed turret :

"EmergencyLightLeft_Front"

"EmergencyLightLeft_Middle"

"EmergencyLightLeft_Rear"

"EmergencyLightRight_Front"

"EmergencyLightRight_Middle"

"EmergencyLightRight_Rear" The name of the flasher that the player wants to address and change.

If a flasher does not get addressed the default pattern will be played for this player. "ColorOverrideValue" RGB Value : "rgb(209, 34, 41)" The name of the flasher that the player wants to address

and change.

If a flasher does not get addressed the default pattern will

be played for this player. "ColorOverrideValue" RGB Value : "rgb(209, 34, 41)" This value changes the light pattern for the overridden turret. "LoopTimeOverrideValue" float value : 1 This float changes the duration of the ELS sequence specified in "FrequencyOverrideValues" in seconds.

The default value is also the maximal value, which is 5 seconds. Higher values are clamped down to 5s.

If the time is larger than 5s the key frames are squashed down into the 5s duration (this might lead to skipped frames and weird flickering when the value is higher than 10s).

If the time is smaller than 5s the frames are repeated until the 5s are full. The last loop might be cut off. Therefore in the siren light pattern a value of 5.0 is recommended or not to use this override key at all, so that the default value will be used.

For the blip light pattern only the first second is played. Therefore in the blip light pattern a value of 1.0 is recommended.

Each 1s long section of the 5s is looped 3 times before going to the next "FrequencyOverrideValues" Integer: [ 80, 0, 0, 0, 80, 80, 0,

0, 0, 80, 80, 0, 0, 0, 80, 80, 0,

0, 0, 80, 80, 0, 0, 0, 80, 80, 0,

0, 0, 80, 80, 0, 0, 0, 80, 80, 0,

0, 0, 80, 80, 0, 0, 0, 80, 80, 0,

0, 0, 80 ] This value must be between 0 and 100, else it will be clamped either to 0 or 100. This value changes the light intensity

Example For Light Patterns


Modding Guide: How to create ELS mods! image 115

"Flashers" : { "FlasherEmissionLevel": "0.5", "FlasherPatterns": [ { "OverrideKey": "Front_Left_1" "ColorOverrideValue": "rgb(209, 34, 41)", "LoopTimeOverrideValue": 5, "FrequencyOverrideValues": [ "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "True", "False", "False", "False", "False", "True", "True", "True", "False", "False", "False", "False", "True", "True", "True", "False", "False", "False", "False", "True", "True", "True", "False", "False", "False", "False", "True", "True", "True", "False", "False", "True", "True", "True", "True", "False", "False", "True", "True", "True", "True", "False", "False", "True", "True", "True", "True", "False", "False", "True", "True", "True", "True", "False", "False", "True", "True", "True", "True", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "False", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True", "True" ] }, { ... } ] }, "TurretLightPatterns": [ { "OverrideKey": "EmergencyLightLeft_Front", "ColorOverrideValue": "rgb(209, 34, 41)", "LoopTimeOverrideValue": 5, "FrequencyOverrideValues": [ 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80, 80, 0, 0, 0, 80 ] }, { ... } ] }

Attention:

The final result can look a bit different than imagined because each full second gets repeated multiple times (around 3 times) before the next second gets played.

How To Replace ELS Sounds


Modding Guide: How to create ELS mods! image 120
Modding Guide: How to create ELS mods! image 121

The steps to override ELS Sounds with custom ones are very similar to those connected to the override of skins and uniforms.

To replace the unique sounds, you can use the following Override Keys:

OverrideKey OverrideValue Type & Example Description POLICE_CAR1_ELS_SOUND "OverrideValue": "%MODPACK%/PoliceCar_Cruiser/Siren.wav"

Analogous for all other sound overrides

Allowed file formats are .wav, .mp3 and .flac Replaces the ELS Siren sound for the Cruiser patrol car. POLICE_CAR1_ELS_BLIP_SOUND See above Replaces the Blip Siren sound for the Cruiser patrol car. POLICE_CAR1_ELS_Yelp_SOUND See above Replaces the Yelp Siren sound for the Cruiser patrol car. POLICE_CAR1_ELS_HONK_SOUND See above Replaces the car honk/horn sound for the Cruiser patrol car. POLICE_CAR2_ELS_SOUND See above Replaces the ELS Siren sound for the Interceptor patrol car. POLICE_CAR2_ELS_BLIP_SOUND See above Replaces the Blip Siren sound for the Interceptor patrol car. POLICE_CAR2_ELS_Yelp_SOUND See above Replaces the Yelp Siren sound for the Interceptor patrol car. POLICE_CAR2_ELS_HONK_SOUND See above Replaces the car honk/horn sound for the Interceptor patrol car. POLICE_CAR3_ELS_SOUND See above Replaces the ELS Siren sound for the Utility patrol car. POLICE_CAR3_ELS_BLIP_SOUND See above Replaces the Blip Siren sound for the Utility patrol car. POLICE_CAR3_ELS_Yelp_SOUND See above Replaces the Yelp Siren sound for the Utility patrol car POLICE_CAR3_ELS_HONK_SOUND See above Replaces the car honk/horn sound for the Utility patrol car.

Questions?


Modding Guide: How to create ELS mods! image 128

No worries, that can always happen!

If you need any support, we highly recommend taking a look at the Steam Forums.

Even better: Join our official Discord[discord.gg] and talk to other community members about everything related to modding! Our developers are also active there... so feel welcome :)

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=2808924041					

More Police Simulator: Patrol Officers guilds