LuaForce encapsulates data local to each "force" or "faction" of the game. Default forces are player, enemy and neutral. Players and mods can create additional forces (up to 64 total).
stringunknownfalseName of the force.
LuaCustomTable<string, LuaTechnology>unknownfalseTechnologies owned by this force, indexed by name.
LuaCustomTable<string, LuaRecipe>unknownfalseRecipes available to this force, indexed by name.
doubledoublefalseMultiplier of the manual mining speed. Default value is 0. The actual mining speed will be multiplied by 1 + manual_mining_speed_modifier.
doubledoublefalseMultiplier of the manual crafting speed. Default value is 0. The actual crafting speed will be multiplied by 1 + manual_crafting_speed_modifier.
doubledoublefalsedoubledoublefalsedoubledoublefalsedoubledoublefalsedoubledoublefalseLuaTechnologyunknowntrueThe currently ongoing technology research, if any.
doubledoublefalseProgress of current research, as a number in range [0, 1].
LuaTechnologyLuaTechnologytrueThe previous research, if any.
doubledoublefalseThe inserter stack size bonus for non stack inserters
uint32uint32falseNumber of items that can be transferred by bulk inserters. When writing to this value, it must be >= 0 and <= 254.
uint32uint32falseBelt stack size bonus.
doubledoublefalseNumber of character trash slots.
uint32uint32falseMaximum number of follower robots.
doubledoublefalseAdditional lifetime for following robots.
booleanbooleanfalseWhen an entity dies, a ghost will be placed for automatic reconstruction.
booleanbooleanfalsebooleanbooleanfalseWhen true, cliffs will be marked for deconstruction when trying to force-build things that collide.
booleanbooleanfalsebooleanbooleanfalsebooleanbooleanfalsebooleanbooleanfalseWhen true, cars/tanks that support logistics will be able to use them.
Array<LuaPlayer>unknownfalsePlayers belonging to this force.
booleanbooleanfalseEnables some higher-level AI behaviour for this force. When set to true, biters belonging to this force will automatically expand into new territories, build new spawners, and form unit groups. By default, this value is true for the enemy force and false for all others.
Setting this to false does not turn off biters' AI. They will still move around and attack players who come close.
It is necessary for a force to be AI controllable in order to be able to create unit groups or build bases from scripts.
Dict<string, Array<LuaLogisticNetwork>>unknownfalseList of logistic networks, grouped by surface.
doubledoublefalseModifies the running speed of all characters in this force by the given value as a percentage. Setting the running modifier to 0.5 makes the character run 50% faster. The minimum value of -1 reduces the movement speed by 100%, resulting in a speed of 0.
doubledoublefalsedoubledoublefalseuint32uint32falseuint32uint32falseuint32uint32falsedoubledoublefalsedoubledoublefalsedoubledoublefalseuint32uint32falseThe number of additional inventory slots the character main inventory has.
uint32uint32falseThe time, in ticks, before a deconstruction order is removed.
doubledoublefalseuint32uint32falseuint32uint32falsebooleanbooleanfalsetrue if character requester logistics is enabled.
uint32uint32falseThe number of rockets launched.
Dict<string, ItemCountType>unknownfalseAll of the items that have been launched in rockets.
Array<LuaPlayer>unknownfalseThe connected players belonging to this force.
This is primarily useful when you want to do some action against all online players of this force.
This does *not* index using player index. See LuaPlayer::index on each player instance for the player index.
doubledoublefalsedoubledoublefalsebooleanbooleanfalseIf friendly fire is enabled for this force.
booleanbooleanfalseIf sharing chart data is enabled for this force.
uint32unknownfalseThis force's index in LuaGameScript::forces (unique ID). It is assigned when a force is created, and remains so until it is merged (ie. deleted). Indexes of merged forces can be reused.
Array<TechnologyID>Array<TechnologyID>falseThe research queue of this force. The first technology in the array is the currently active one. Reading this attribute gives an array of LuaTechnology.
To write to this, the entire table must be written. Providing an empty table or nil will empty the research queue and cancel the current research. Writing to this when the research queue is disabled will simply set the last research in the table as the current research.
This only allows mods to queue research that this force is able to research in the first place. As an example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but dropped silently instead.
booleanunknownfalseWhether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research.
Dict<uint32, LuaSpacePlatform>unknownfalseThe space platforms that belong to this force mapped by their index value.
This will include platforms that are pending deletion.
ColorColortrueCustom color for this force. If specified, will take priority over other sources of the force color. Writing nil clears custom color. Will return nil if it was not specified or if was set to {0,0,0,0}.
ColorunknownfalseEffective color of this force.
booleanunknownfalseIs this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
LuaForce.get_entity_count(name: EntityID) -> uint32
force.get_entity_count("name")
takes_table: falsetable_optional: falseCount entities of given type.
This function has O(1) time complexity as entity counts are kept and maintained in the game engine.
name: EntityID — Prototype name of the entity.uint32 — Number of entities of given prototype belonging to this force.LuaForce.disable_research()
force.disable_research()
takes_table: falsetable_optional: falseDisable research for this force.
LuaForce.enable_research()
force.enable_research()
takes_table: falsetable_optional: falseEnable research for this force.
LuaForce.disable_all_prototypes()
force.disable_all_prototypes()
takes_table: falsetable_optional: falseDisable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point.
LuaForce.enable_all_prototypes()
force.enable_all_prototypes()
takes_table: falsetable_optional: falseEnables all recipes and technologies. The opposite of LuaForce::disable_all_prototypes.
LuaForce.reset_recipes()
force.reset_recipes()
takes_table: falsetable_optional: falseLoad the original version of all recipes from the prototypes.
LuaForce.enable_all_recipes()
force.enable_all_recipes()
takes_table: falsetable_optional: falseUnlock all recipes.
LuaForce.enable_all_technologies()
force.enable_all_technologies()
takes_table: falsetable_optional: falseUnlock all technologies.
LuaForce.research_all_technologies(include_disabled_prototypes?: boolean)
force.research_all_technologies()
takes_table: falsetable_optional: falseResearch all technologies.
include_disabled_prototypes?: boolean — Whether technologies that are explicitly disabled in the prototype should also be researched. Defaults to false.LuaForce.reset_technologies()
force.reset_technologies()
takes_table: falsetable_optional: falseLoad the original versions of technologies from prototypes. Preserves research state of technologies.
LuaForce.reset()
force.reset()
takes_table: falsetable_optional: falseReset everything. All technologies are set to not researched, all modifiers are set to default values.
LuaForce.reset_technology_effects()
force.reset_technology_effects()
takes_table: falsetable_optional: falseReapplies all possible research effects, including unlocked recipes. Any custom changes are lost. Preserves research state of technologies.
LuaForce.chart(surface: SurfaceIdentification, area: BoundingBox)
force.chart(surface, area)
takes_table: falsetable_optional: falseChart a portion of the map. The chart for the given area is refreshed; it creates chart for any parts of the given area that haven't been charted yet.
surface: SurfaceIdentificationarea: BoundingBox — The area on the given surface to chart.LuaForce.clear_chart(surface?: SurfaceIdentification)
force.clear_chart()
takes_table: falsetable_optional: falseErases chart data for this force.
surface?: SurfaceIdentification — Which surface to erase chart data for or if not provided all surfaces charts are erased.LuaForce.rechart(surface?: SurfaceIdentification)
force.rechart()
takes_table: falsetable_optional: falseForce a rechart of the whole chart.
surface?: SurfaceIdentification — Which surface to rechart or all if not given.LuaForce.chart_all(surface?: SurfaceIdentification)
force.chart_all()
takes_table: falsetable_optional: falseChart all generated chunks.
surface?: SurfaceIdentification — Which surface to chart or all if not given.LuaForce.copy_from(force: ForceID)
force.copy_from(force)
takes_table: falsetable_optional: falseCopies all of the given changeable values (except charts) from the given force to this force.
force: ForceID — The force to copy from.LuaForce.copy_chart(source_force: ForceID, source_surface: SurfaceIdentification, destination_surface: SurfaceIdentification)
force.copy_chart(source_force, source_surface, destination_surface)
takes_table: falsetable_optional: falseCopies the given surface's chart from the given force to this force.
source_force: ForceID — The force to copy fromsource_surface: SurfaceIdentification — The surface to copy from.destination_surface: SurfaceIdentification — The surface to copy to.LuaForce.is_chunk_charted(surface: SurfaceIdentification, chunk_position: ChunkPosition) -> boolean
force.is_chunk_charted(surface, chunk_position)
takes_table: falsetable_optional: falseHas a chunk been charted?
surface: SurfaceIdentificationchunk_position: ChunkPosition — Position of the chunk.booleanLuaForce.is_chunk_visible(surface: SurfaceIdentification, chunk_position: ChunkPosition) -> boolean
force.is_chunk_visible(surface, chunk_position)
takes_table: falsetable_optional: falseIs the given chunk currently charted and visible (not covered by fog of war) on the map.
surface: SurfaceIdentificationchunk_position: ChunkPositionbooleanLuaForce.is_chunk_requested_for_charting(surface: SurfaceIdentification, chunk_position: ChunkPosition) -> boolean
force.is_chunk_requested_for_charting(surface, chunk_position)
takes_table: falsetable_optional: falseHas a chunk been requested for charting?
surface: SurfaceIdentificationchunk_position: ChunkPosition — Position of the chunk.booleanLuaForce.cancel_charting(surface?: SurfaceIdentification)
force.cancel_charting()
takes_table: falsetable_optional: falseCancels pending chart requests for the given surface or all surfaces.
surface?: SurfaceIdentificationLuaForce.get_ammo_damage_modifier(ammo: string) -> double
force.get_ammo_damage_modifier(ammo)
takes_table: falsetable_optional: falseammo: string — Ammo categorydoubleLuaForce.set_ammo_damage_modifier(ammo: string, modifier: double)
force.set_ammo_damage_modifier(ammo, modifier)
takes_table: falsetable_optional: falseammo: string — Ammo categorymodifier: doubleLuaForce.get_gun_speed_modifier(ammo: string) -> double
force.get_gun_speed_modifier(ammo)
takes_table: falsetable_optional: falseammo: string — Ammo categorydoubleLuaForce.set_gun_speed_modifier(ammo: string, modifier: double)
force.set_gun_speed_modifier(ammo, modifier)
takes_table: falsetable_optional: falseammo: string — Ammo categorymodifier: doubleLuaForce.get_turret_attack_modifier(turret: EntityID) -> double
force.get_turret_attack_modifier(turret)
takes_table: falsetable_optional: falseturret: EntityID — Turret prototype namedoubleLuaForce.set_turret_attack_modifier(turret: EntityID, modifier: double)
force.set_turret_attack_modifier(turret, modifier)
takes_table: falsetable_optional: falseturret: EntityID — Turret prototype namemodifier: doubleLuaForce.set_cease_fire(other: ForceID, cease_fire: boolean)
force.set_cease_fire(other, true)
takes_table: falsetable_optional: falseAdd other force to this force's cease fire list. Forces on the cease fire list won't be targeted for attack.
other: ForceIDcease_fire: booleanLuaForce.get_cease_fire(other: ForceID) -> boolean
force.get_cease_fire(other)
takes_table: falsetable_optional: falseIs other force in this force's cease fire list?
other: ForceIDbooleanLuaForce.set_friend(other: ForceID, friend: boolean)
force.set_friend(other, true)
takes_table: falsetable_optional: falseAdd other force to this force's friends list. Friends have unrestricted access to buildings and turrets won't fire at them.
other: ForceIDfriend: booleanLuaForce.get_friend(other: ForceID) -> boolean
force.get_friend(other)
takes_table: falsetable_optional: falseIs other force in this force's friends list.
other: ForceIDbooleanLuaForce.is_pathfinder_busy() -> boolean
force.is_pathfinder_busy()
takes_table: falsetable_optional: falseIs pathfinder busy? When the pathfinder is busy, it won't accept any more pathfinding requests.
booleanLuaForce.kill_all_units()
force.kill_all_units()
takes_table: falsetable_optional: falseKill all units and flush the pathfinder.
LuaForce.find_logistic_network_by_position(position: MapPosition, surface: SurfaceIdentification) -> LuaLogisticNetwork?
force.find_logistic_network_by_position(position, surface)
takes_table: falsetable_optional: falseposition: MapPosition — Position to find a network forsurface: SurfaceIdentification — Surface to search onLuaLogisticNetwork? — The found network or nil.LuaForce.set_spawn_position(position: MapPosition, surface: SurfaceIdentification)
force.set_spawn_position(position, surface)
takes_table: falsetable_optional: falseposition: MapPosition — The new position on the given surface.surface: SurfaceIdentification — Surface to set the spawn position for.LuaForce.get_spawn_position(surface: SurfaceIdentification) -> MapPosition
force.get_spawn_position(surface)
takes_table: falsetable_optional: falsesurface: SurfaceIdentificationMapPositionLuaForce.set_surface_hidden(surface: SurfaceIdentification, hidden: boolean)
force.set_surface_hidden(surface, true)
takes_table: falsetable_optional: falsesurface: SurfaceIdentification — Surface to set hidden for.hidden: boolean — Whether to hide the surface or not.LuaForce.get_surface_hidden(surface: SurfaceIdentification) -> boolean
force.get_surface_hidden(surface)
takes_table: falsetable_optional: falsesurface: SurfaceIdentificationbooleanLuaForce.unchart_chunk(chunk_position: ChunkPosition, surface: SurfaceIdentification)
force.unchart_chunk(chunk_position, surface)
takes_table: falsetable_optional: falsechunk_position: ChunkPosition — The chunk position to unchart.surface: SurfaceIdentification — Surface to unchart on.LuaForce.get_item_launched(item: ItemID) -> uint32
force.get_item_launched(item)
takes_table: falsetable_optional: falseGets the count of a given item launched in rockets.
item: ItemID — The item to getuint32 — The count of the item that has been launched.LuaForce.set_item_launched(item: ItemID, count: uint32)
force.set_item_launched(item, count)
takes_table: falsetable_optional: falseSets the count of a given item launched in rockets.
item: ItemID — The item to setcount: uint32 — The count to setLuaForce.print(message: LocalisedString, print_settings?: PrintSettings)
force.print(message, print_settings)
takes_table: falsetable_optional: falsePrint text to the chat console of all players on this force.
By default, messages that are identical to a message sent in the last 60 ticks are not printed again.
message: LocalisedStringprint_settings?: PrintSettingsLuaForce.add_chart_tag(surface: SurfaceIdentification, tag: ChartTagSpec) -> LuaCustomChartTag?
force.add_chart_tag(surface, tag)
takes_table: falsetable_optional: falseAdds a custom chart tag to the given surface and returns the new tag or nil if the given position isn't valid for a chart tag.
The chunk must be charted for a tag to be valid at that location.
surface: SurfaceIdentification — Which surface to add the tag to.tag: ChartTagSpec — The tag to add.LuaCustomChartTag?LuaForce.find_chart_tags(surface: SurfaceIdentification, area?: BoundingBox) -> Array<LuaCustomChartTag>
force.find_chart_tags(surface, area)
takes_table: falsetable_optional: falseFinds all custom chart tags within a given area on the given surface. If no area is given all custom chart tags on the surface are returned.
surface: SurfaceIdentificationarea?: BoundingBoxArray<LuaCustomChartTag>LuaForce.reset_evolution()
force.reset_evolution()
takes_table: falsetable_optional: falseResets evolution for this force to zero.
LuaForce.play_sound(sound_specification: PlaySoundSpecification)
force.play_sound(sound_specification)
takes_table: falsetable_optional: falsePlay a sound for every player in this force.
The sound is not played if its location is not charted for this force.
sound_specification: PlaySoundSpecification — The sound to play.LuaForce.get_hand_crafting_disabled_for_recipe(recipe: RecipeID) -> boolean
force.get_hand_crafting_disabled_for_recipe(recipe)
takes_table: falsetable_optional: falseGets if the given recipe is explicitly disabled from being hand crafted.
recipe: RecipeIDbooleanLuaForce.set_hand_crafting_disabled_for_recipe(recipe: RecipeID, hand_crafting_disabled: boolean)
force.set_hand_crafting_disabled_for_recipe(recipe, true)
takes_table: falsetable_optional: falseSets if the given recipe can be hand-crafted. This is used to explicitly disable hand crafting a recipe - it won't allow hand-crafting otherwise not hand-craftable recipes.
recipe: RecipeIDhand_crafting_disabled: booleanLuaForce.add_research(technology: TechnologyID) -> boolean
force.add_research(technology)
takes_table: falsetable_optional: falseAdd this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to be researched now.
technology: TechnologyIDboolean — Whether the technology was successfully added.LuaForce.cancel_current_research()
force.cancel_current_research()
takes_table: falsetable_optional: falseStop the research currently in progress. This will remove any dependent technologies from the research queue.
LuaForce.get_linked_inventory(prototype: EntityID, link_id: uint32) -> LuaInventory?
force.get_linked_inventory(prototype, link_id)
takes_table: falsetable_optional: falseGets the linked inventory for the given prototype and link ID if it exists or nil.
prototype: EntityIDlink_id: uint32LuaInventory?LuaForce.is_friend(other: ForceID) -> boolean
force.is_friend(other)
takes_table: falsetable_optional: falseIs this force a friend? This differs from get_friend in that it is always true for neutral force. This is equivalent to checking the friend ForceCondition.
other: ForceIDbooleanLuaForce.is_enemy(other: ForceID) -> boolean
force.is_enemy(other)
takes_table: falsetable_optional: falseIs this force an enemy? This differs from get_cease_fire in that it is always false for neutral force. This is equivalent to checking the enemy ForceCondition.
other: ForceIDbooleanLuaForce.lock_space_location(name: SpaceLocationID)
force.lock_space_location("name")
takes_table: falsetable_optional: falseLocks the planet to not be accessible to this force.
name: SpaceLocationID — Name of the planet.LuaForce.unlock_space_location(name: SpaceLocationID)
force.unlock_space_location("name")
takes_table: falsetable_optional: falseUnlocks the planet to be accessible to this force.
name: SpaceLocationID — Name of the planet.LuaForce.is_space_location_unlocked(name: SpaceLocationID)
force.is_space_location_unlocked("name")
takes_table: falsetable_optional: falseIs the specified planet unlocked for this force?
name: SpaceLocationID — Name of the planet.LuaForce.lock_quality(quality: QualityID)
force.lock_quality(quality)
takes_table: falsetable_optional: falseLocks the quality to not be accessible to this force.
quality: QualityID — Name of the quality.LuaForce.unlock_quality(quality: QualityID)
force.unlock_quality(quality)
takes_table: falsetable_optional: falseUnlocks the quality to be accessible to this force.
quality: QualityID — Name of the quality.LuaForce.is_quality_unlocked(quality: QualityID)
force.is_quality_unlocked(quality)
takes_table: falsetable_optional: falseIs the specified quality unlocked for this force?
quality: QualityID — Name of the quality.LuaForce.lock_space_platforms()
force.lock_space_platforms()
takes_table: falsetable_optional: falseLocks the space platforms, which disables the space platforms button
LuaForce.unlock_space_platforms()
force.unlock_space_platforms()
takes_table: falsetable_optional: falseUnlocks the space platforms, which enables the space platforms button
LuaForce.is_space_platforms_unlocked() -> boolean
force.is_space_platforms_unlocked()
takes_table: falsetable_optional: falseAre the space platforms unlocked? This basically just controls the availability of the space platforms button.
booleanLuaForce.create_space_platform{ name?: string, planet: SpaceLocationID, starter_pack: ItemWithQualityID } -> LuaSpacePlatform?
force.create_space_platform{ planet=planet, starter_pack=starter_pack }
takes_table: truetable_optional: falseCreates a new space platform on this force.
name?: string — The platform name. If not provided, a random name will be used.planet: SpaceLocationID — The planet that the platform will orbit.starter_pack: ItemWithQualityID — The starter pack required to build the platform.LuaSpacePlatform?LuaForce.get_evolution_factor(surface?: SurfaceIdentification) -> double
force.get_evolution_factor()
takes_table: falsetable_optional: falseFetches the evolution factor of this force on the given surface.
surface?: SurfaceIdentification — Defaults to "nauvis".doubleLuaForce.get_evolution_factor_by_pollution(surface?: SurfaceIdentification) -> double
force.get_evolution_factor_by_pollution()
takes_table: falsetable_optional: falseFetches the pollution part of the evolution factor of this force on the given surface.
surface?: SurfaceIdentification — Defaults to "nauvis".doubleLuaForce.get_evolution_factor_by_time(surface?: SurfaceIdentification) -> double
force.get_evolution_factor_by_time()
takes_table: falsetable_optional: falseFetches the time part of the evolution factor of this force on the given surface.
surface?: SurfaceIdentification — Defaults to "nauvis".doubleLuaForce.get_evolution_factor_by_killing_spawners(surface?: SurfaceIdentification) -> double
force.get_evolution_factor_by_killing_spawners()
takes_table: falsetable_optional: falseFetches the spawner kill part of the evolution factor of this force on the given surface.
surface?: SurfaceIdentification — Defaults to "nauvis".doubleLuaForce.set_evolution_factor(factor: double, surface?: SurfaceIdentification)
force.set_evolution_factor(factor, surface)
takes_table: falsetable_optional: falseSets the evolution factor of this force on the given surface.
factor: doublesurface?: SurfaceIdentification — Defaults to "nauvis".LuaForce.set_evolution_factor_by_pollution(factor: double, surface?: SurfaceIdentification)
force.set_evolution_factor_by_pollution(factor, surface)
takes_table: falsetable_optional: falseSets the pollution part of the evolution factor of this force on the given surface.
factor: doublesurface?: SurfaceIdentification — Defaults to "nauvis".LuaForce.set_evolution_factor_by_time(factor: double, surface?: SurfaceIdentification)
force.set_evolution_factor_by_time(factor, surface)
takes_table: falsetable_optional: falseSets the time part of the evolution factor of this force on the given surface.
factor: doublesurface?: SurfaceIdentification — Defaults to "nauvis".LuaForce.set_evolution_factor_by_killing_spawners(factor: double, surface?: SurfaceIdentification)
force.set_evolution_factor_by_killing_spawners(factor, surface)
takes_table: falsetable_optional: falseSets the spawner kill part of the evolution factor of this force on the given surface.
factor: doublesurface?: SurfaceIdentification — Defaults to "nauvis".LuaForce.get_item_production_statistics(surface: SurfaceIdentification) -> LuaFlowStatistics
force.get_item_production_statistics(surface)
takes_table: falsetable_optional: falseThe item production statistics for this force for the given surface.
surface: SurfaceIdentificationLuaFlowStatisticsLuaForce.get_fluid_production_statistics(surface: SurfaceIdentification) -> LuaFlowStatistics
force.get_fluid_production_statistics(surface)
takes_table: falsetable_optional: falseThe fluid production statistics for this force for the given surface.
surface: SurfaceIdentificationLuaFlowStatisticsLuaForce.get_kill_count_statistics(surface: SurfaceIdentification) -> LuaFlowStatistics
force.get_kill_count_statistics(surface)
takes_table: falsetable_optional: falseThe kill counter statistics for this force for the given surface.
surface: SurfaceIdentificationLuaFlowStatisticsLuaForce.get_entity_build_count_statistics(surface: SurfaceIdentification) -> LuaFlowStatistics
force.get_entity_build_count_statistics(surface)
takes_table: falsetable_optional: falseThe entity build statistics for this force (built and mined) for the given surface.
surface: SurfaceIdentificationLuaFlowStatisticsLuaForce.get_logistic_groups(type?: defines.logistic_group_type) -> Array<string>
force.get_logistic_groups()
takes_table: falsetable_optional: falseGets the names of the current logistic groups.
type?: defines.logistic_group_type — Defaults to defines.logistic_group_type.with_trash.Array<string>LuaForce.get_logistic_group(name: string, type?: defines.logistic_group_type) -> LogisticGroup?
force.get_logistic_group(name, type)
takes_table: falsetable_optional: falseGets the information about the given logistic group.
name: stringtype?: defines.logistic_group_type — Defaults to defines.logistic_group_type.with_trash.LogisticGroup?LuaForce.create_logistic_group(name: string, type?: defines.logistic_group_type)
force.create_logistic_group(name, type)
takes_table: falsetable_optional: falseCreates the given group if it doesn't already exist.
name: stringtype?: defines.logistic_group_type — Defaults to defines.logistic_group_type.with_trash.LuaForce.delete_logistic_group(name: string, type?: defines.logistic_group_type)
force.delete_logistic_group(name, type)
takes_table: falsetable_optional: falseDeletes the given logistic group if it exists.
name: stringtype?: defines.logistic_group_type — Defaults to defines.logistic_group_type.with_trash.LuaForce.get_chunk_chart(surface: SurfaceIdentification, chunk_position: ChunkPosition) -> string?
force.get_chunk_chart(surface, chunk_position)
takes_table: falsetable_optional: falseGets the raw chart data for a given chunk as a binary string.
The pixel data is returned in RGB565 format (2 bytes per pixel).
Returns nil if the chunk has not been charted for this force.
surface: SurfaceIdentificationchunk_position: ChunkPositionstring? — The raw pixel data.LuaForce.script_trigger_research(technology: TechnologyID)
force.script_trigger_research(technology)
takes_table: falsetable_optional: falseTrigger the "scripted" research trigger of a technology, researching it. Does nothing if the technology does not have a "scripted" research trigger.
technology: TechnologyID