Skip to main content

LuaSurfaceCreateEntityParams

Struct LuaSurfaceCreateEntityParams 

Source
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: BlueprintInventoryWithFilters

Used by entities with a burner energy source.

§cause: LuaAny

Cause 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: LuaEntity

If fast_replace is true simulate fast replace using this character.

§create_build_effect_smoke: bool

If false, the building effect smoke will not be shown around the new entity. Defaults to true.

§direction: String

Desired orientation of the entity after creation.

§fast_replace: bool

If true, building will attempt to simulate fast-replace building. Defaults to false.

§force: LuaAny

Force of the entity, default is enemy.

§item: LuaItemStack

If 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: bool

Whether this entity is mirrored. Defaults to false.

§move_stuck_players: bool

If true, any characters that are in the way of the entity are teleported out of the way.

§name: LuaAny

The entity prototype name to create.

§player: LuaAny

If 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: MapPosition

Where to create the entity.

§preserve_ghosts_and_corpses: bool

If true, colliding ghosts and corpses will not be removed by the creation of some entity types. Defaults to false.

§quality: LuaAny

Quality of the entity to be created. Defaults to normal.

§raise_built: bool

If true; defines.events.script_raised_built will be fired on successful entity creation. Defaults to false.

§register_plant: bool

If true, plants created will register in any in-range agricultural towers.

§snap_to_grid: bool

If 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: LuaAny

Source entity. Used for beams, projectiles, and highlight-boxes.

§spawn_decorations: bool

If true, entity types that have spawn_decoration property will apply triggers defined in the property. Defaults to false.

§spill: bool

If 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: LuaAny

Entity with health for the new entity to target.

§undo_index: u32

The 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

Source§

fn clone(&self) -> LuaSurfaceCreateEntityParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LuaSurfaceCreateEntityParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LuaSurfaceCreateEntityParams

Source§

fn default() -> LuaSurfaceCreateEntityParams

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.