pub struct LuaSurfaceCreateSegmentedUnitParams {
pub force: Option<ForceID>,
pub name: EntityID,
pub quality: Option<QualityID>,
pub territory: Option<LuaTerritory>,
pub body_nodes: Option<Vec<MapPosition>>,
pub direction: Option<String>,
pub extended: Option<bool>,
pub position: Option<MapPosition>,
}Expand description
Create a segmented unit on the surface. This differs from creating an entity with type "segmented-unit" in that this method can create the entity in non-generated chunks and with any arbitrary body shape and pre-assigned to a territory.
Fields§
§force: Option<ForceID>Force of the segmented unit. Defaults to enemy.
name: EntityIDThe segmented-unit prototype name to create. Must be of type "segmented-unit".
quality: Option<QualityID>Quality of the entity to be created. Defaults to normal.
territory: Option<LuaTerritory>The territory that the segmented unit is assigned to. If nil, the segmented unit will patrol around its spawn location. Must be located on this same surface.
body_nodes: Option<Vec<MapPosition>>The body nodes that define the shape of the body. The array must contain at least one value and should have no more than SegmentEngineSpecification::max_body_nodes. The nodes should be about 1 tile apart from each other, but it is not strictly required.
direction: Option<String>The initial orientation of the head. Defaults to defines.direction.north.
extended: Option<bool>If true, will create the segmented unit so that the entire body is stretches in a straight line behind the head. If false, then only the head segment will be created and the remainder of the body segments will be created over time as the head moves forward. Defaults to false.
position: Option<MapPosition>The head position.
Trait Implementations§
Source§impl Clone for LuaSurfaceCreateSegmentedUnitParams
impl Clone for LuaSurfaceCreateSegmentedUnitParams
Source§fn clone(&self) -> LuaSurfaceCreateSegmentedUnitParams
fn clone(&self) -> LuaSurfaceCreateSegmentedUnitParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more