pub struct LuaSurfaceCreateEntityParams {Show 23 fields
pub burner_fuel_inventory: BlueprintInventoryWithFilters,
pub cause: LuaAny,
pub character: LuaEntity,
pub create_build_effect_smoke: bool,
pub direction: String,
pub fast_replace: bool,
pub force: LuaAny,
pub item: LuaItemStack,
pub mirror: bool,
pub move_stuck_players: bool,
pub name: LuaAny,
pub player: LuaAny,
pub position: MapPosition,
pub preserve_ghosts_and_corpses: bool,
pub quality: LuaAny,
pub raise_built: bool,
pub register_plant: bool,
pub snap_to_grid: bool,
pub source: LuaAny,
pub spawn_decorations: bool,
pub spill: bool,
pub target: LuaAny,
pub undo_index: u32,
}Expand description
Create an entity on this surface.
Fields§
§burner_fuel_inventory: BlueprintInventoryWithFiltersUsed by entities with a burner energy source.
cause: LuaAnyCause entity / force. The entity or force that triggered the chain of events that led to this entity being created. Used for beams, projectiles, stickers, etc. so that the damage receiver can know which entity or force to retaliate against. Defaults to the value of source.
character: LuaEntityIf fast_replace is true simulate fast replace using this character.
create_build_effect_smoke: boolIf false, the building effect smoke will not be shown around the new entity. Defaults to true.
direction: StringDesired orientation of the entity after creation.
fast_replace: boolIf true, building will attempt to simulate fast-replace building. Defaults to false.
force: LuaAnyForce of the entity, default is enemy.
item: LuaItemStackIf provided, the entity will attempt to pull stored values from this item (for example; creating a spidertron from a previously named and mined spidertron)
mirror: boolWhether this entity is mirrored. Defaults to false.
move_stuck_players: boolIf true, any characters that are in the way of the entity are teleported out of the way.
name: LuaAnyThe entity prototype name to create.
player: LuaAnyIf given set the last_user to this player. If fast_replace is true simulate fast replace using this player. Also the player whose undo queue this action should be added to.
position: MapPositionWhere to create the entity.
preserve_ghosts_and_corpses: boolIf true, colliding ghosts and corpses will not be removed by the creation of some entity types. Defaults to false.
quality: LuaAnyQuality of the entity to be created. Defaults to normal.
raise_built: boolIf true; defines.events.script_raised_built will be fired on successful entity creation. Defaults to false.
register_plant: boolIf true, plants created will register in any in-range agricultural towers.
snap_to_grid: boolIf false the exact position given is used to instead of snapping to the normal entity grid. This only applies if the entity normally snaps to the grid.
source: LuaAnySource entity. Used for beams, projectiles, and highlight-boxes.
spawn_decorations: boolIf true, entity types that have spawn_decoration property will apply triggers defined in the property. Defaults to false.
spill: boolIf false while fast_replace is true and player is nil any items from fast-replacing will be deleted instead of dropped on the ground. Defaults to true.
target: LuaAnyEntity with health for the new entity to target.
undo_index: u32The index of the undo item to add this action to. An index of 0 creates a new undo item for it. Defaults to putting it into the appropriate undo item automatically if not specified.
Trait Implementations§
Source§impl Clone for LuaSurfaceCreateEntityParams
impl Clone for LuaSurfaceCreateEntityParams
Source§fn clone(&self) -> LuaSurfaceCreateEntityParams
fn clone(&self) -> LuaSurfaceCreateEntityParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more