Page 1 of 1

[0.16.51] Mod-Error: "InRangePredicate only accepts direction without diagonals."

Posted: Mon Sep 03, 2018 7:05 pm
by wodzu93
Game quits to main menu when a turret placed diagonally engages enemies.

I've made a custom turret for a mod that has limited firing arc. It has a flag "building-direction-8-way" that allows for 8 angles of rotation when placing it.
When biters come within its prepare range, game throws an exception if that turret was placed aiming diagonally.
DiagonalTurretCrash1.png
DiagonalTurretCrash1.png (2.81 MiB) Viewed 3388 times
DiagonalTurretCrash2.png
DiagonalTurretCrash2.png (2.96 MiB) Viewed 3388 times
Log file:
factorio-current.log
(16.77 KiB) Downloaded 183 times
Turret prototype:

Code: Select all

{
	type = "ammo-turret",
	name = "w93-dcannon-turret",
	icon = "__scattergun_turret__/graphics/icons/dcannon-turret.png",
    	icon_size = 64,
	flags = {"placeable-player", "player-creation", "building-direction-8-way"},
	minable = {mining_time = 0.5, result = "w93-dcannon-turret"},
	max_health = 1500,
	corpse = "medium-remnants",
	collision_box = {{-1.2, -1.2 }, {1.2, 1.2}},
	selection_box = {{-1.3, -1.3 }, {1.3, 1.3}},
	rotation_speed = 0.003,
	preparing_speed = 0.8,
	folding_speed = 0.8,
	dying_explosion = "medium-explosion",
	inventory_size = 1,
	automated_ammo_count = 5,
	turret_base_has_direction = true,
	resistances =
	{
		{
			type = "physical",
			decrease = 5,
			percent = 15
		},
		{
			type = "explosion",
			decrease = 80,
			percent = 50,
		},
		{
			type = "acid",
			decrease = 0,
			percent = 35,
		},
		{
			type = "fire",
			decrease = 0,
			percent = 80,
		}
	},
	folded_animation = cannon_turret_attack{},
	preparing_animation = cannon_turret_attack{},
	prepared_animation = cannon_turret_attack{},
	attacking_animation = cannon_turret_attack{},
	folding_animation = cannon_turret_attack{run_mode = "backward"},

	base_picture =
	{
		layers =
		{
			{
				filename = "__scattergun_turret__/graphics/entity/modular-turret-base.png",
				priority = "high",
				width = 88,
				height = 68,
				axially_symmetrical = false,
				direction_count = 1,
				frame_count = 1,
				shift = {0.0, 0.0},
			},
			{
				filename = "__scattergun_turret__/graphics/entity/modular-turret-base-mask.png",
				flags = { "mask" },
				line_length = 1,
				width = 88,
				height = 68,
				frame_count = 1,
				axially_symmetrical = false,
				direction_count = 1,
				shift = {0.0, 0.0},
				apply_runtime_tint = true
			}
		}
	},

	vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
	prepare_range = 35,
	shoot_in_prepare_state = false,
	attack_parameters =
	{
		type = "projectile",
		ammo_category = "cannon-shell",
		cooldown = 30,
		projectile_creation_distance = 1.5,
		projectile_center = {0.0, 0.4},
		min_range = 12,
		range = 30,
		turn_range = 0.25,
		sound = 
		{
			{
				filename = "__scattergun_turret__/sound/lcannon-turret-fire.wav",
				volume = 1.25
			}
		}
	},
	call_for_help_radius = 40
},
Mod:
scattergun_turret_3.6.0.zip
(2.02 MiB) Downloaded 179 times

Re: [0.16.51] Mod-Error: "InRangePredicate only accepts direction without diagonals."

Posted: Mon Sep 03, 2018 10:09 pm
by posila
Hi, technically not a bug, just unsupported configuration
But I implemented support for diagonal direction for InRangePredicate for 0.17

Re: [0.16.51] Mod-Error: "InRangePredicate only accepts direction without diagonals."

Posted: Tue Sep 04, 2018 3:50 pm
by wodzu93
That was quick, thanks! Now to wait for 0.17...