Emergency 4 scripts commonly use the .script file format. Mission scripts are automaticly packed and saved into a .pscript format on mission load. Command scripts are also converted into a .pscript format once the mod loads, but they are not saved anywhere. Most of the loading time of a mod comes from this packing process.
This precompiler for emergency 4 packs .script files into the .pscript format before the game even starts. It thereby eliminates the time Emergency 4 normaly takes for packing scripts when loading mods. This process drasticly reduces the loading time for mods.
Variants of this precompiler has been tested and have already been used in the Auenburg and Rosenburg Modification, the same procedure of packing scripts before deployment has been used in Wegberg 8 and Bieberfelde Retrofitting.
Instructions for use:
The precompile.exe (or precompile.py, if you have a python enviroment installed) is placed into the "Scripts" folder of a modification. You should make a backup of the "Scripts/Game" folder before use. Then create a copy of your "Scripts/Game" folder and name it "Scripts/Source". You can find examples of this setup in Auenburg and Rosenburg.
When you run the precompiler, it will automaticly detect changes in the "Source" folder and will pack the changed scripts into the "Game" folder. The precompiler also supports importing custom library files placed in a "Scripts/Source/Lib" folder using #import [filename] as [alias] . Note that the imported script is just copied verbatim into the script wrapped into a namespace.
The precompiler comes with an additional settings.json which can be placed into the same folder as the precompile.exe. The settings.json provided is the version we used for Auenburg v1. You can define default imports via the Import list in settings.json as provided in the example.
You need to adjust the settings.json accordingly for your own mod and clear the IMPORT list.
We have tested this for our mods, but bugs may still occur on other projects. Please report them on the download page on em-hub.de.
-
Version 1.0.0
-
Antiphon -
7. Juli 2026 um 13:10 -
7,79 MB -
14 Downloads
-