Code: Select all
game.get_surface(1).request_path{
bounding_box = {
left_top = {
x = -8.5625,
y = 11.34765625
},
right_bottom = {
x = -7.1640625,
y = 12.74609375
}
},
collision_mask = {"player-layer"},
start = {-20, 0},
goal = {70, 0},
force = game.players[1].force,
radius = 1,
pathfind_flags = {},
can_open_gates = true,
path_resolution_modifier = -2
}
running the above script on the map below (any map with enough water between the 2 positions works) will crash the game.
the bounding box placed in the code above, was retrieved using
bounding_box from a
Unit prototype entity
full prototype data code below
Code: Select all
local car_base = util.copy(data.raw.car.car)
local gun_base = util.copy(data.raw["gun"]["vehicle-machine-gun"])
local ammo_base = util.copy(data.raw["ammo"]["piercing-rounds-magazine"])
gun_base.attack_parameters.ammo_type = ammo_base.ammo_type
gun_base.attack_parameters.animation = car_base.animation
local name = names.units.car
local car_unit = {
type = "unit",
name = name,
localised_name = {name},
icon = car_base.icon,
icon_size = car_base.icon_size,
flags = util.unit_flags(),
map_color = {b = 0.5, g = 1},
enemy_map_color = {r = 1},
max_health = 315,
radar_range = 2,
order="i-c",
subgroup = "transport",
healing_per_tick = 0,
collision_box = {{-0.7, -0.7}, {0.7, 0.7}},
selection_box = {{-1.2, -1.2}, {1.2, 1.2}},
collision_mask = util.ground_unit_collision_mask(),
max_pursue_distance = 64,
min_persue_time = (60 * 15),
--sticker_box = {{-0.2, -0.2}, {0.2, 0.2}},
distraction_cooldown = (30),
move_while_shooting = true,
can_open_gates = true,
resistances =
{
{
type = "acid",
decrease = 8,
percent = 60
}
},
ai_settings =
{
do_separation = true
},
minable = {result = name, mining_time = 2},
attack_parameters = gun_base.attack_parameters,
vision_distance = 40,
has_belt_immunity = true,
movement_speed = 1,
distance_per_frame = 0.15,
pollution_to_join_attack = 1000,
destroy_when_commands_fail = false,
--corpse = name.." Corpse",
dying_explosion = car_base.explosion,
vehicle_impact_sound = car_base.vehicle_impact_sound,
working_sound = car_base.working_sound,
run_animation = car_base.animation
}