pub struct LuaForce;Expand description
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).
Implementations§
Source§impl LuaForce
impl LuaForce
Sourcepub fn ai_controllable(&self) -> bool
pub fn ai_controllable(&self) -> bool
Enables 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.
pub fn artillery_range_modifier(&self) -> f64
pub fn beacon_distribution_modifier(&self) -> f64
Sourcepub fn belt_stack_size_bonus(&self) -> u32
pub fn belt_stack_size_bonus(&self) -> u32
Belt stack size bonus.
Sourcepub fn bulk_inserter_capacity_bonus(&self) -> u32
pub fn bulk_inserter_capacity_bonus(&self) -> u32
Number of items that can be transferred by bulk inserters. When writing to this value, it must be >= 0 and <= 254.
Sourcepub fn cargo_landing_pad_limit(&self) -> u32
pub fn cargo_landing_pad_limit(&self) -> u32
The maximum cargo landing pads that can be built per surface by this force.
pub fn character_build_distance_bonus(&self) -> u32
pub fn character_health_bonus(&self) -> f64
Sourcepub fn character_inventory_slots_bonus(&self) -> u32
pub fn character_inventory_slots_bonus(&self) -> u32
The number of additional inventory slots the character main inventory has.
pub fn character_item_drop_distance_bonus(&self) -> u32
pub fn character_item_pickup_distance_bonus(&self) -> f64
Sourcepub fn character_logistic_requests(&self) -> bool
pub fn character_logistic_requests(&self) -> bool
true if character requester logistics is enabled.
pub fn character_loot_pickup_distance_bonus(&self) -> f64
pub fn character_reach_distance_bonus(&self) -> u32
pub fn character_resource_reach_distance_bonus(&self) -> f64
Sourcepub fn character_running_speed_modifier(&self) -> f64
pub fn character_running_speed_modifier(&self) -> f64
Modifies 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.
Sourcepub fn character_trash_slot_count(&self) -> f64
pub fn character_trash_slot_count(&self) -> f64
Number of character trash slots.
pub fn circuit_network_enabled(&self) -> bool
Sourcepub fn cliff_deconstruction_enabled(&self) -> bool
pub fn cliff_deconstruction_enabled(&self) -> bool
When true, cliffs will be marked for deconstruction when trying to force-build things that collide.
Sourcepub fn connected_players(&self) -> Vec<LuaPlayer>
pub fn connected_players(&self) -> Vec<LuaPlayer>
The 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.
Sourcepub fn create_ghost_on_entity_death(&self) -> bool
pub fn create_ghost_on_entity_death(&self) -> bool
When an entity dies, a ghost will be placed for automatic reconstruction.
Sourcepub fn current_research(&self) -> LuaTechnology
pub fn current_research(&self) -> LuaTechnology
The currently ongoing technology research, if any.
Sourcepub fn custom_color(&self) -> Color
pub fn custom_color(&self) -> Color
Custom 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}.
Sourcepub fn deconstruction_time_to_live(&self) -> u32
pub fn deconstruction_time_to_live(&self) -> u32
The time, in ticks, before a deconstruction order is removed.
Sourcepub fn following_robots_lifetime_modifier(&self) -> f64
pub fn following_robots_lifetime_modifier(&self) -> f64
Additional lifetime for following robots.
Sourcepub fn friendly_fire(&self) -> bool
pub fn friendly_fire(&self) -> bool
If friendly fire is enabled for this force.
Sourcepub fn index(&self) -> u32
pub fn index(&self) -> u32
This 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.
Sourcepub fn inserter_stack_size_bonus(&self) -> f64
pub fn inserter_stack_size_bonus(&self) -> f64
The inserter stack size bonus for non stack inserters
Sourcepub fn items_launched(&self) -> HashMap<String, u32>
pub fn items_launched(&self) -> HashMap<String, u32>
All of the items that have been launched in rockets.
pub fn laboratory_productivity_bonus(&self) -> f64
pub fn laboratory_speed_modifier(&self) -> f64
Sourcepub fn logistic_networks(&self) -> HashMap<String, Vec<Box<LuaLogisticNetwork>>>
pub fn logistic_networks(&self) -> HashMap<String, Vec<Box<LuaLogisticNetwork>>>
List of logistic networks, grouped by surface.
Sourcepub fn manual_crafting_speed_modifier(&self) -> f64
pub fn manual_crafting_speed_modifier(&self) -> f64
Multiplier of the manual crafting speed. Default value is 0. The actual crafting speed will be multiplied by 1 + manual_crafting_speed_modifier.
Sourcepub fn manual_mining_speed_modifier(&self) -> f64
pub fn manual_mining_speed_modifier(&self) -> f64
Multiplier of the manual mining speed. Default value is 0. The actual mining speed will be multiplied by 1 + manual_mining_speed_modifier.
Sourcepub fn max_cargo_bay_unloading_distance(&self) -> f64
pub fn max_cargo_bay_unloading_distance(&self) -> f64
Maximum distance between cargo bay from its connected cargo landing pad that allows unloading. Only relevant for cargo bays that have both LuaEntityPrototype::allow_unloading and LuaEntityPrototype::use_unloading_distance_limit set to true.
pub fn max_failed_attempts_per_tick_per_construction_queue(&self) -> u32
pub fn max_successful_attempts_per_tick_per_construction_queue(&self) -> u32
Sourcepub fn maximum_following_robot_count(&self) -> u32
pub fn maximum_following_robot_count(&self) -> u32
Maximum number of follower robots.
pub fn mining_drill_productivity_bonus(&self) -> f64
pub fn mining_with_fluid(&self) -> bool
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The 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.
Sourcepub fn platforms(&self) -> LuaAny
pub fn platforms(&self) -> LuaAny
The space platforms that belong to this force mapped by their index value.
This will include platforms that are pending deletion.
Sourcepub fn previous_research(&self) -> LuaTechnology
pub fn previous_research(&self) -> LuaTechnology
The previous research, if any.
pub fn rail_planner_allow_elevated_rails(&self) -> bool
pub fn rail_support_on_deep_oil_ocean(&self) -> bool
Sourcepub fn recipes(&self) -> HashMap<String, Box<LuaRecipe>>
pub fn recipes(&self) -> HashMap<String, Box<LuaRecipe>>
Recipes available to this force, indexed by name.
Sourcepub fn research_enabled(&self) -> bool
pub fn research_enabled(&self) -> bool
Whether research is enabled for this force, see LuaForce::enable_research and LuaForce::disable_research.
Sourcepub fn research_progress(&self) -> f64
pub fn research_progress(&self) -> f64
Progress of current research, as a number in range [0, 1].
Sourcepub fn research_queue(&self) -> Vec<LuaAny>
pub fn research_queue(&self) -> Vec<LuaAny>
The 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.
Sourcepub fn rockets_launched(&self) -> u32
pub fn rockets_launched(&self) -> u32
The number of rockets launched.
If sharing chart data is enabled for this force.
Sourcepub fn technologies(&self) -> HashMap<String, Box<LuaTechnology>>
pub fn technologies(&self) -> HashMap<String, Box<LuaTechnology>>
Technologies owned by this force, indexed by name.
pub fn train_braking_force_bonus(&self) -> f64
Sourcepub fn unlock_logistic_network(&self) -> bool
pub fn unlock_logistic_network(&self) -> bool
When true, a “connect to logistic network” button will become enabled for entities that can connect to a logistic network.
Sourcepub fn unlock_travel_to_space_platforms(&self) -> bool
pub fn unlock_travel_to_space_platforms(&self) -> bool
Whether traveling to space platforms via rockets is unlocked.
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is 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.
Sourcepub fn vehicle_logistics(&self) -> bool
pub fn vehicle_logistics(&self) -> bool
When true, cars/tanks that support logistics will be able to use them.
pub fn worker_robots_battery_modifier(&self) -> f64
pub fn worker_robots_speed_modifier(&self) -> f64
pub fn worker_robots_storage_bonus(&self) -> f64
Sourcepub fn add_alert(&self, entity: LuaEntity, type: &str)
pub fn add_alert(&self, entity: LuaEntity, type: &str)
Adds an alert to every connected player on this force.
Sourcepub fn add_chart_tag(
&self,
surface: LuaAny,
tag: ChartTagSpec,
) -> Option<LuaCustomChartTag>
pub fn add_chart_tag( &self, surface: LuaAny, tag: ChartTagSpec, ) -> Option<LuaCustomChartTag>
Adds 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.
Sourcepub fn add_custom_alert(
&self,
entity: LuaEntity,
icon: SignalID,
message: &str,
show_on_map: bool,
)
pub fn add_custom_alert( &self, entity: LuaEntity, icon: SignalID, message: &str, show_on_map: bool, )
Adds a custom alert to every connected player on this force.
Sourcepub fn add_research(&self, technology: LuaAny) -> bool
pub fn add_research(&self, technology: LuaAny) -> bool
Add this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to be researched now.
Sourcepub fn cancel_charting(&self, surface: Option<LuaAny>)
pub fn cancel_charting(&self, surface: Option<LuaAny>)
Cancels pending chart requests for the given surface or all surfaces.
Sourcepub fn cancel_current_research(&self)
pub fn cancel_current_research(&self)
Stop the research currently in progress. This will remove any dependent technologies from the research queue.
Sourcepub fn chart(&self, area: BoundingBox, surface: LuaAny)
pub fn chart(&self, area: BoundingBox, surface: LuaAny)
Chart 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.
Sourcepub fn clear_chart(&self, surface: Option<LuaAny>)
pub fn clear_chart(&self, surface: Option<LuaAny>)
Erases chart data for this force.
Sourcepub fn copy_chart(
&self,
destination_surface: LuaAny,
source_force: LuaAny,
source_surface: LuaAny,
)
pub fn copy_chart( &self, destination_surface: LuaAny, source_force: LuaAny, source_surface: LuaAny, )
Copies the given surface’s chart from the given force to this force.
Sourcepub fn copy_from(&self, force: LuaAny)
pub fn copy_from(&self, force: LuaAny)
Copies all of the given changeable values (except charts) from the given force to this force.
Sourcepub fn create_logistic_group(&self, name: &str, type: Option<&str>)
pub fn create_logistic_group(&self, name: &str, type: Option<&str>)
Creates the given group if it doesn’t already exist.
Sourcepub fn create_space_platform(
&self,
params: LuaForceCreateSpacePlatformParams,
) -> Option<LuaSpacePlatform>
pub fn create_space_platform( &self, params: LuaForceCreateSpacePlatformParams, ) -> Option<LuaSpacePlatform>
Creates a new space platform on this force.
Sourcepub fn delete_logistic_group(&self, name: &str, type: Option<&str>)
pub fn delete_logistic_group(&self, name: &str, type: Option<&str>)
Deletes the given logistic group if it exists.
Sourcepub fn disable_all_prototypes(&self)
pub fn disable_all_prototypes(&self)
Disable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point.
Sourcepub fn disable_research(&self)
pub fn disable_research(&self)
Disable research for this force.
Sourcepub fn enable_all_prototypes(&self)
pub fn enable_all_prototypes(&self)
Enables all recipes and technologies. The opposite of LuaForce::disable_all_prototypes.
Sourcepub fn enable_all_recipes(&self)
pub fn enable_all_recipes(&self)
Unlock all recipes.
Sourcepub fn enable_all_technologies(&self)
pub fn enable_all_technologies(&self)
Unlock all technologies.
Sourcepub fn enable_research(&self)
pub fn enable_research(&self)
Enable research for this force.
Finds 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.
pub fn find_logistic_network_by_position( &self, position: MapPosition, surface: LuaAny, ) -> Option<LuaLogisticNetwork>
pub fn get_ammo_damage_modifier(&self, ammo: &str) -> f64
Sourcepub fn get_cease_fire(&self, other: LuaAny) -> bool
pub fn get_cease_fire(&self, other: LuaAny) -> bool
Is other force in this force’s cease fire list?
Sourcepub fn get_chunk_chart(
&self,
chunk_position: ChunkPosition,
surface: LuaAny,
) -> Option<&str>
pub fn get_chunk_chart( &self, chunk_position: ChunkPosition, surface: LuaAny, ) -> Option<&str>
Gets 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.
Sourcepub fn get_entity_build_count_statistics(
&self,
surface: LuaAny,
) -> LuaFlowStatistics
pub fn get_entity_build_count_statistics( &self, surface: LuaAny, ) -> LuaFlowStatistics
The entity build statistics for this force (built and mined) for the given surface.
Sourcepub fn get_entity_count(&self, name: LuaAny) -> u32
pub fn get_entity_count(&self, name: LuaAny) -> u32
Count entities of given type.
This function has O(1) time complexity as entity counts are kept and maintained in the game engine.
Sourcepub fn get_evolution_factor(&self, surface: Option<LuaAny>) -> f64
pub fn get_evolution_factor(&self, surface: Option<LuaAny>) -> f64
Fetches the evolution factor of this force on the given surface.
Sourcepub fn get_evolution_factor_by_killing_spawners(
&self,
surface: Option<LuaAny>,
) -> f64
pub fn get_evolution_factor_by_killing_spawners( &self, surface: Option<LuaAny>, ) -> f64
Fetches the spawner kill part of the evolution factor of this force on the given surface.
Sourcepub fn get_evolution_factor_by_pollution(&self, surface: Option<LuaAny>) -> f64
pub fn get_evolution_factor_by_pollution(&self, surface: Option<LuaAny>) -> f64
Fetches the pollution part of the evolution factor of this force on the given surface.
Sourcepub fn get_evolution_factor_by_time(&self, surface: Option<LuaAny>) -> f64
pub fn get_evolution_factor_by_time(&self, surface: Option<LuaAny>) -> f64
Fetches the time part of the evolution factor of this force on the given surface.
Sourcepub fn get_fluid_production_statistics(
&self,
surface: LuaAny,
) -> LuaFlowStatistics
pub fn get_fluid_production_statistics( &self, surface: LuaAny, ) -> LuaFlowStatistics
The fluid production statistics for this force for the given surface.
Sourcepub fn get_friend(&self, other: LuaAny) -> bool
pub fn get_friend(&self, other: LuaAny) -> bool
Is other force in this force’s friends list.
pub fn get_gun_speed_modifier(&self, ammo: &str) -> f64
Sourcepub fn get_hand_crafting_disabled_for_recipe(&self, recipe: LuaAny) -> bool
pub fn get_hand_crafting_disabled_for_recipe(&self, recipe: LuaAny) -> bool
Gets if the given recipe is explicitly disabled from being hand crafted.
Sourcepub fn get_item_launched(&self, item: LuaAny) -> u32
pub fn get_item_launched(&self, item: LuaAny) -> u32
Gets the count of a given item launched in rockets.
Sourcepub fn get_item_production_statistics(
&self,
surface: LuaAny,
) -> LuaFlowStatistics
pub fn get_item_production_statistics( &self, surface: LuaAny, ) -> LuaFlowStatistics
The item production statistics for this force for the given surface.
Sourcepub fn get_kill_count_statistics(&self, surface: LuaAny) -> LuaFlowStatistics
pub fn get_kill_count_statistics(&self, surface: LuaAny) -> LuaFlowStatistics
The kill counter statistics for this force for the given surface.
Sourcepub fn get_linked_inventory(
&self,
link_id: u32,
prototype: LuaAny,
) -> Option<LuaInventory>
pub fn get_linked_inventory( &self, link_id: u32, prototype: LuaAny, ) -> Option<LuaInventory>
Gets the linked inventory for the given prototype and link ID if it exists or nil.
Sourcepub fn get_logistic_group(
&self,
name: &str,
type: Option<&str>,
) -> Option<LogisticGroup>
pub fn get_logistic_group( &self, name: &str, type: Option<&str>, ) -> Option<LogisticGroup>
Gets the information about the given logistic group.
Sourcepub fn get_logistic_groups(&self, type: Option<&str>) -> Vec<&str>
pub fn get_logistic_groups(&self, type: Option<&str>) -> Vec<&str>
Gets the names of the current logistic groups.
Sourcepub fn get_script_visible(&self, unlockable: UnlockableID) -> Option<bool>
pub fn get_script_visible(&self, unlockable: UnlockableID) -> Option<bool>
Gets the unlockable script state for the given ID.
pub fn get_spawn_position(&self, surface: LuaAny) -> MapPosition
pub fn get_turret_attack_modifier(&self, turret: LuaAny) -> f64
Sourcepub fn is_chunk_charted(
&self,
chunk_position: ChunkPosition,
surface: LuaAny,
) -> bool
pub fn is_chunk_charted( &self, chunk_position: ChunkPosition, surface: LuaAny, ) -> bool
Has a chunk been charted?
Sourcepub fn is_chunk_requested_for_charting(
&self,
chunk_position: ChunkPosition,
surface: LuaAny,
) -> bool
pub fn is_chunk_requested_for_charting( &self, chunk_position: ChunkPosition, surface: LuaAny, ) -> bool
Has a chunk been requested for charting?
Sourcepub fn is_chunk_visible(
&self,
chunk_position: ChunkPosition,
surface: LuaAny,
) -> bool
pub fn is_chunk_visible( &self, chunk_position: ChunkPosition, surface: LuaAny, ) -> bool
Is the given chunk currently charted and visible (not covered by fog of war) on the map.
Sourcepub fn is_enemy(&self, other: LuaAny) -> bool
pub fn is_enemy(&self, other: LuaAny) -> bool
Is 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.
Sourcepub fn is_friend(&self, other: LuaAny) -> bool
pub fn is_friend(&self, other: LuaAny) -> bool
Is 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.
Sourcepub fn is_pathfinder_busy(&self) -> bool
pub fn is_pathfinder_busy(&self) -> bool
Is pathfinder busy? When the pathfinder is busy, it won’t accept any more pathfinding requests.
Sourcepub fn is_quality_unlocked(&self, quality: LuaAny)
pub fn is_quality_unlocked(&self, quality: LuaAny)
Is the specified quality unlocked for this force?
Sourcepub fn is_space_location_unlocked(&self, name: LuaAny)
pub fn is_space_location_unlocked(&self, name: LuaAny)
Is the specified planet unlocked for this force?
Sourcepub fn is_space_platforms_unlocked(&self) -> bool
pub fn is_space_platforms_unlocked(&self) -> bool
Are the space platforms unlocked? This basically just controls the availability of the space platforms button.
Sourcepub fn is_visible(&self, unlockable: UnlockableID) -> bool
pub fn is_visible(&self, unlockable: UnlockableID) -> bool
Is the given unlockable ID visible either through computed technologies or script set state.
Sourcepub fn kill_all_units(&self)
pub fn kill_all_units(&self)
Kill all units and flush the pathfinder.
Sourcepub fn lock_quality(&self, quality: LuaAny)
pub fn lock_quality(&self, quality: LuaAny)
Locks the quality to not be accessible to this force.
Sourcepub fn lock_space_location(&self, name: LuaAny)
pub fn lock_space_location(&self, name: LuaAny)
Locks the planet to not be accessible to this force.
Sourcepub fn lock_space_platforms(&self)
pub fn lock_space_platforms(&self)
Locks the space platforms, which disables the space platforms button
Sourcepub fn play_music(&self, music_specification: PlayMusicSpecification)
pub fn play_music(&self, music_specification: PlayMusicSpecification)
Play a music track for every player in this force.
Sourcepub fn play_sound(&self, sound_specification: PlaySoundSpecification)
pub fn play_sound(&self, sound_specification: PlaySoundSpecification)
Play a sound for every player in this force.
The sound is not played if its location is not charted for this force.
Sourcepub fn print(&self, message: &str, print_settings: Option<PrintSettings>)
pub fn print(&self, message: &str, print_settings: Option<PrintSettings>)
Print 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.
Sourcepub fn remove_alert(&self, filter: AlertFilter)
pub fn remove_alert(&self, filter: AlertFilter)
For every connected player on this force - removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.
Sourcepub fn research_all_technologies(
&self,
include_disabled_prototypes: Option<bool>,
)
pub fn research_all_technologies( &self, include_disabled_prototypes: Option<bool>, )
Research all technologies.
Sourcepub fn reset(&self)
pub fn reset(&self)
Reset everything. All technologies are set to not researched, all modifiers are set to default values.
Sourcepub fn reset_evolution(&self)
pub fn reset_evolution(&self)
Resets evolution for this force to zero.
Sourcepub fn reset_recipes(&self)
pub fn reset_recipes(&self)
Load the original version of all recipes from the prototypes.
Sourcepub fn reset_technologies(&self)
pub fn reset_technologies(&self)
Load the original versions of technologies from prototypes. Preserves research, enabled and visible_when_disabled state of technologies.
Sourcepub fn reset_technology_effects(&self)
pub fn reset_technology_effects(&self)
Reapplies all possible research effects, including unlocked recipes. Any custom changes are lost. Preserves research state of technologies.
Sourcepub fn script_trigger_research(&self, technology: LuaAny)
pub fn script_trigger_research(&self, technology: LuaAny)
Trigger the “scripted” research trigger of a technology, researching it. Does nothing if the technology does not have a “scripted” research trigger.
pub fn set_ammo_damage_modifier(&self, ammo: &str, modifier: f64)
Sourcepub fn set_cease_fire(&self, cease_fire: bool, other: LuaAny)
pub fn set_cease_fire(&self, cease_fire: bool, other: LuaAny)
Add other force to this force’s cease fire list. Forces on the cease fire list won’t be targeted for attack.
Sourcepub fn set_evolution_factor(&self, factor: f64, surface: Option<LuaAny>)
pub fn set_evolution_factor(&self, factor: f64, surface: Option<LuaAny>)
Sets the evolution factor of this force on the given surface.
Sourcepub fn set_evolution_factor_by_killing_spawners(
&self,
factor: f64,
surface: Option<LuaAny>,
)
pub fn set_evolution_factor_by_killing_spawners( &self, factor: f64, surface: Option<LuaAny>, )
Sets the spawner kill part of the evolution factor of this force on the given surface.
Sourcepub fn set_evolution_factor_by_pollution(
&self,
factor: f64,
surface: Option<LuaAny>,
)
pub fn set_evolution_factor_by_pollution( &self, factor: f64, surface: Option<LuaAny>, )
Sets the pollution part of the evolution factor of this force on the given surface.
Sourcepub fn set_evolution_factor_by_time(&self, factor: f64, surface: Option<LuaAny>)
pub fn set_evolution_factor_by_time(&self, factor: f64, surface: Option<LuaAny>)
Sets the time part of the evolution factor of this force on the given surface.
Sourcepub fn set_friend(&self, friend: bool, other: LuaAny)
pub fn set_friend(&self, friend: bool, other: LuaAny)
Add other force to this force’s friends list. Friends have unrestricted access to buildings and turrets won’t fire at them.
pub fn set_gun_speed_modifier(&self, ammo: &str, modifier: f64)
Sourcepub fn set_hand_crafting_disabled_for_recipe(
&self,
hand_crafting_disabled: bool,
recipe: LuaAny,
)
pub fn set_hand_crafting_disabled_for_recipe( &self, hand_crafting_disabled: bool, recipe: LuaAny, )
Sets 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.
Sourcepub fn set_item_launched(&self, count: u32, item: LuaAny)
pub fn set_item_launched(&self, count: u32, item: LuaAny)
Sets the count of a given item launched in rockets.
Sourcepub fn set_script_visible(&self, unlockable: UnlockableID, value: Option<bool>)
pub fn set_script_visible(&self, unlockable: UnlockableID, value: Option<bool>)
Sets the given unlockable ID state. When set to explicitly hidden or visible the value overrides the state computed through technologies.
pub fn set_spawn_position(&self, position: MapPosition, surface: LuaAny)
pub fn set_turret_attack_modifier(&self, modifier: f64, turret: LuaAny)
pub fn unchart_chunk(&self, chunk_position: ChunkPosition, surface: LuaAny)
Sourcepub fn unlock_quality(&self, quality: LuaAny)
pub fn unlock_quality(&self, quality: LuaAny)
Unlocks the quality to be accessible to this force.
Sourcepub fn unlock_space_location(&self, name: LuaAny)
pub fn unlock_space_location(&self, name: LuaAny)
Unlocks the planet to be accessible to this force.
Sourcepub fn unlock_space_platforms(&self)
pub fn unlock_space_platforms(&self)
Unlocks the space platforms, which enables the space platforms button