pub struct LuaSurfaceRequestPathParams {
pub bounding_box: BoundingBox,
pub can_open_gates: bool,
pub collision_mask: CollisionMask,
pub entity_to_ignore: LuaEntity,
pub force: LuaAny,
pub goal: MapPosition,
pub max_attack_distance: f64,
pub max_gap_size: i32,
pub path_resolution_modifier: i32,
pub pathfind_flags: PathfinderFlags,
pub radius: f64,
pub start: MapPosition,
}Expand description
Generates a path with the specified constraints (as an array of PathfinderWaypoints) using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit entities, such as vehicles. If you want to command actual units (such as biters or spitters) to move, use LuaCommandable::set_command via LuaEntity::commandable instead.
The resulting path is ultimately returned asynchronously via on_script_path_request_finished.
Fields§
§bounding_box: BoundingBoxThe dimensions of the object that’s supposed to travel the path.
can_open_gates: boolWhether the path request can open gates. Defaults to false.
collision_mask: CollisionMaskThe collision mask the bounding_box collides with.
entity_to_ignore: LuaEntityMakes the pathfinder ignore collisions with this entity if it is given.
force: LuaAnyThe force for which to generate the path, determining which gates can be opened for example.
goal: MapPositionThe position to find a path to.
max_attack_distance: f64Defines the maximum allowed distance between the last traversable path waypoint and an obstacle entity to be destroyed. Only used when finding a discontiguous path, i.e. when max_gap_size > 0. This field filters out paths that are blocked by obstacles that are outside the entity’s attack range. Allowed values are 0 or greater. Defaults to max_gap_size.
max_gap_size: i32Defines the maximum allowed distance between path waypoints. 0 means that paths must be contiguous (as they are for biters). Values greater than 0 will produce paths with “gaps” that are suitable for spiders. Allowed values are from 0 to 31. Defaults to 0.
path_resolution_modifier: i32Defines how coarse the pathfinder’s grid is, where smaller values mean a coarser grid. Defaults to 0, which equals a resolution of 1x1 tiles, centered on tile centers. Values range from -8 to 8 inclusive, where each integer increment doubles/halves the resolution. So, a resolution of -8 equals a grid of 256x256 tiles, and a resolution of 8 equals 1/256 of a tile.
pathfind_flags: PathfinderFlagsFlags that affect pathfinder behavior.
radius: f64How close the pathfinder needs to get to its goal (in tiles). Defaults to 1.
start: MapPositionThe position from which to start pathfinding.
Trait Implementations§
Source§impl Clone for LuaSurfaceRequestPathParams
impl Clone for LuaSurfaceRequestPathParams
Source§fn clone(&self) -> LuaSurfaceRequestPathParams
fn clone(&self) -> LuaSurfaceRequestPathParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more