Page 1 of 1

Fishy Question

Posted: Thu Dec 24, 2015 9:41 pm
by KTobias
Ok, so I added a new fish to a mod I'm working on. It populates in the world just fine, and it displays as expected. But now the normal fish are gone in world. I would like to have both fish (and others) populated in the world.

I think it has something to do with autoplace. Does it have to have a different influence value or what? I can't seem to find where the normal fish are generated in the base code.

Could someone point me in the right direction?

Thanks,

Re: Fishy Question

Posted: Mon Dec 28, 2015 12:33 am
by SirRichie
Would you mind sharing your code that defines your new fish?

Re: Fishy Question

Posted: Mon Dec 28, 2015 9:29 am
by KTobias
I manage to figure out how to get both types of fish to appear in the game but it definitely favors populating the catfish. I can't seem to make it balance out or have the catfish to appear only in deeper water. Hope the code below shows up alright. I'm new to this forum thing so forgive my noobyisms here. ;) I didn't add the naming.cfg I use in the game but that not hard to do so I didn't add it.

items.lua

Code: Select all

data:extend
(
	{  
		{
			type = "capsule",
			name = "catfish",
			icon = "__Tobias__/graphics/fish/icons/catfish.png",
			flags = {"goes-to-quickbar"},
			subgroup = "raw-resource",
			capsule_action =
				{
					type = "use-on-self",
					attack_parameters =
						{
							type = "projectile",
							ammo_category = "capsule",
							cooldown = 30,
							range = 0,
							ammo_type =
							{
								category = "capsule",
								target_type = "position",
								action =
									{
										type = "direct",
										action_delivery =
											{
												type = "instant",
												target_effects =
													{
														type = "damage",
														damage = {type = "physical", amount = -40}
													}
											}
									}
							}
						}
				},
			order = "f-e-a",
			stack_size = 100
		}
	}
)
entities.lua

Code: Select all

data:extend
(
	{  
		{
			type = "fish",
			name = "catfish",
			icon = "__Tobias__/graphics/fish/icons/catfish.png",
			flags = {"placeable-neutral", "not-on-map"},
			minable = {mining_time = 1, result = "catfish"},
			max_health = 40,
			subgroup = "creatures",
			order = "b-a",
			collision_box = {{-0.4, -0.2}, {0.4, 0.2}},
			selection_box = {{-0.5, -0.3}, {0.5, 0.3}},
			pictures =
				{
					{
						filename = "__Tobias__/graphics/fish/icons/catfish-1.png",
						priority = "extra-high",
						width = 22,
						height = 36
					},
					{
						filename = "__Tobias__/graphics/fish/icons/catfish-2.png",
						priority = "extra-high",
						width = 32,
						height = 32
					}
				},
			autoplace = 
				{
					peaks = 
						{
							{
								influence = 0.01,
								starting_area_weight_optimal = 0,
								starting_area_weight_range = 0,
								starting_area_weight_max_range = 2,
							},
							{
								influence = 0.1,
								noise_layer = "catfish",
								noise_octaves_difference = -1,
								noise_persistence = 0.2,
								starting_area_weight_optimal = 0,
								starting_area_weight_range = 0,
								starting_area_weight_max_range = 2,
							}
						}
				}
		}
	}
)
noise-layers.lua

Code: Select all

data:extend
(
	{		
                {
			type = "noise-layer",
			name = "catfish"
		}
	}
)