Types/SimulationDefinition

From Official Factorio Wiki
Jump to navigation Jump to search

Used by Prototype/TipsAndTricksItem and by main menu simulations (Prototype/UtilityConstants).

Optional properties

save

Type: Types/FileName

The save file that is used for this simulation. If not given and generate_map is true, a map gets generated by the game.

init_file

Type: Types/FileName

This code is run as a (silent) console command inside the simulation when it is first initialized. Since this is run as a console command, the restrictions of console commands apply, e.g. require is not available[1].

init

Type: Types/string

Default: ""

Only loaded if init_file is not present.

This code is run as a (silent) console command inside the simulation when it is first initialized. Since this is run as a console command, the restrictions of console commands apply, e.g. require is not available[2].

update_file

Type: Types/FileName

This code is run as a (silent) console command inside the simulation every time the simulation is updated. Since this is run as a console command, the restrictions of console commands apply, e.g. require is not available[3].

update

Type: Types/string

Default: ""

Only loaded if update_file is not present.

This code is run as a (silent) console command inside the simulation every time the simulation is updated. Since this is run as a console command, the restrictions of console commands apply, e.g. require is not available[4].

init_update_count

Type: Types/uint32

Default: 0

Amount of ticks that this simulation should run for before the simulation is shown to the player. These updates happen after init/init_file has been run and at the highest possible rate (> 60 UPS).

length

Type: Types/uint32

Default: 0

How long this simulation takes. In the main menu simulations, another simulation will start after this simulation ends.

generate_map

Type: Types/bool

Default: false

If save is not given and this is true, a map gets generated by the game for use in the simulation.

checkboard

Type: Types/bool

Default: true

If this is true, the map of the simulation is set to be a lab-tile checkerboard in the area of {{-20, -15},{20, 15}} when the scenario is first initialized (before init/init_file run).

volume_modifier

Type: Types/float

Multiplier for the simulation volume set by the player in the sound settings.

override_volume

Type: Types/bool

If true, overrides the simulation volume set by the player in the sound settings, simply setting the volume modifier to 1.