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

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
wodzu93
Inserter
Inserter
Posts: 22
Joined: Thu Apr 20, 2017 3:57 pm
Contact:

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

Post by wodzu93 » Mon Sep 03, 2018 7:05 pm

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 544 times
DiagonalTurretCrash2.png
DiagonalTurretCrash2.png (2.96 MiB) Viewed 544 times
Log file:
factorio-current.log
(16.77 KiB) Downloaded 29 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 22 times
IT student that likes modding in his free time.

Shameless self-promotion:
http://steamcommunity.com/sharedfiles/f ... =555765765
http://steamcommunity.com/sharedfiles/f ... =575758597

posila
Factorio Staff
Factorio Staff
Posts: 3653
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila » Mon Sep 03, 2018 10:09 pm

Hi, technically not a bug, just unsupported configuration
But I implemented support for diagonal direction for InRangePredicate for 0.17

User avatar
wodzu93
Inserter
Inserter
Posts: 22
Joined: Thu Apr 20, 2017 3:57 pm
Contact:

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

Post by wodzu93 » Tue Sep 04, 2018 3:50 pm

That was quick, thanks! Now to wait for 0.17...
IT student that likes modding in his free time.

Shameless self-promotion:
http://steamcommunity.com/sharedfiles/f ... =555765765
http://steamcommunity.com/sharedfiles/f ... =575758597

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: No registered users