[1.0] Replacing base game textures

Place to get help with not working mods / modding interface.
User avatar
DofD
Inserter
Inserter
Posts: 24
Joined: Thu Jun 18, 2015 10:16 am
Contact:

[1.0] Replacing base game textures

Post by DofD »

Hello there

So i tried replacing the nuclear scorch mark files with transparent 10x10px files.
I created the base mod and it is recognized by the game.
But the textures arent replaced.

I replaced the following files with the 10x10 px .png file :

Code: Select all

nonukescorch_0.5.0\data\base\graphics\terrain\hr-nuclear-ground.png
nonukescorch_0.5.0\data\base\graphics\terrain\nuclear-ground.png

All files in
nonukescorch_0.5.0\data\base\graphics\decorative\nuclear-ground-patch\
I created the config.lua and wrote the following in it:

Code: Select all

return {
	resource_pack_name = "nonukescorch",

	-- textures defined to replace
	data = {
			base = {
					graphics = {
								terrain = {
										["hr-nuclear-ground.png"] = { },
										["nuclear-ground.png"] = { },
										},
								decorative ={
											nuclear-ground-patch = {
											
											},
											
										},
					},
			},
		
	}
}
Did i make a syntax error or did i just miss something important?

Thanks for your help and have a nice weekend!
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.0] Replacing base game textures

Post by Deadlock989 »

DofD wrote: Sat Nov 28, 2020 7:31 pm I created the config.lua and wrote the following in it:
config.lua isn't a thing in vanilla Factorio. Are you doing this with some other mod that replaces textures?

Either way you can't just replace terrain graphics with a transparent sprite. If it had worked you would have gotten pure black tiles like the "out of map" tiling.

It would work with the decorative but the more efficient way would be to just not place the decorative.
User avatar
DofD
Inserter
Inserter
Posts: 24
Joined: Thu Jun 18, 2015 10:16 am
Contact:

Re: [1.0] Replacing base game textures

Post by DofD »

Ok got it
So if i want to supply a new atomic-bomb.lua in a mod, do is just supply a new atomic-bomb.lua in the mod under the same file structure as the original one or do i have to define it in a seperate file like data.lua, data-updates.lua or data-final-fixes.lua

And again, thanks for the help.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.0] Replacing base game textures

Post by Deadlock989 »

DofD wrote: Sun Nov 29, 2020 6:04 pmSo if i want to supply a new atomic-bomb.lua in a mod, do is just supply a new atomic-bomb.lua in the mod under the same file structure as the original one or do i have to define it in a seperate file like data.lua, data-updates.lua or data-final-fixes.lua
The names of files doesn't matter apart from the ones required by mod structure. If you want to override something, what matters is that you override the prototype in Factorio's data.raw table. I recommend you work through the tutorials, the one by Gangsir talks about how to modify existing data.raw prototypes or make your own new ones based on existing ones.
User avatar
DofD
Inserter
Inserter
Posts: 24
Joined: Thu Jun 18, 2015 10:16 am
Contact:

Re: [1.0] Replacing base game textures

Post by DofD »

Thanks Deadlock989

That really helped me geting in to that stuff.
And i actually got it to work. But i hit another problem on my way.
I also want this effect to be placed on the mod Atmoic Artillery.
Now i went ahead and added it in a if function:

Code: Select all

if mods ["AtomicArtillery"] then

	table.insert(data.raw.projectile["atomic-artillery-projectile"].action =
	
	{
			type = "direct",
			action_delivery =
			{
			  type = "instant",
			  target_effects =
			  {
				--Damage effects				
				{
					type = "nested-result",
					action = 
					{
						radius = 35, --same size as the shockwave to follow, needed to get auto-targeting to space shots correctly. Switched to fire because the thermal pulse is also a thing on nukes.
						--Finally, by having this here, you get the radar update with everything dying like you expect with a nuke.
						type = "area",
						action_delivery = {
							type = "instant",
							target_effects = {
								{
									type = "damage",
									damage = { amount = 1500, type = "fire" },
								},
							},
						},
					},
				},
				{
				  type = "destroy-cliffs",
				  radius = 9,
				  explosion = "explosion"
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 35,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave",
					  starting_speed = 0.5 * 0.7,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 7,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-ground-zero-projectile",
					  starting_speed = 0.6 * 0.8,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				--Sound effects
				{
				  type = "play-sound",
				  sound = sounds.nuclear_explosion_aftershock(0.4),
				  play_on_target_position = false,
				  -- min_distance = 200,
				  max_distance = 1000,
				  -- volume_modifier = 1,
				  audible_distance_modifier = 3
				},
				{
				  type = "play-sound",
				  sound = sounds.nuclear_explosion(0.9),
				  play_on_target_position = false,
				  -- min_distance = 200,
				  max_distance = 1000,
				  -- volume_modifier = 1,
				  audible_distance_modifier = 3
				},
				--Graphical effects
				{
				  type = "create-entity",
				  entity_name = "nuke-explosion"
				},
				{
				  type = "camera-effect",
				  effect = "screen-burn",
				  duration = 60,
				  ease_in_duration = 5,
				  ease_out_duration = 60,
				  delay = 0,
				  strength = 6,
				  full_strength_max_distance = 200,
				  max_distance = 800
				},
				{
				  type = "invoke-tile-trigger",
				  repeat_count = 1,
				},
				{
				  type = "destroy-decoratives",
				  include_soft_decoratives = true, -- soft decoratives are decoratives with grows_through_rail_path = true
				  include_decals = true,
				  invoke_decorative_trigger = true,
				  decoratives_with_trigger_only = false, -- if true, destroys only decoratives that have trigger_effect set
				  radius = 14 -- large radius for demostrative purposes
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 26,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-cluster-nuke-explosion",
					  starting_speed = 0.5 * 0.7,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 700,
					radius = 4,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-fire-smoke-explosion",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 8,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-nuke-shockwave-explosion",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 300,
					radius = 26,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-nuclear-smoke",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 10,
					radius = 8,
					action_delivery =
					{
					  type = "instant",
					  target_effects =
					  {
						{
						  type = "create-entity",
						  entity_name = "nuclear-smouldering-smoke-source",
						  tile_collision_mask = { "water-tile" }
						}
					  }
					}
				  }
				}
			  }
			}
		})
end
And here is my complete file that made no nuke scorches with the above code:

Code: Select all

local sounds = require("__base__.prototypes.entity.demo-sounds")


data.raw.projectile["atomic-rocket"].action =
{
      type = "direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
          {
            type = "destroy-cliffs",
            radius = 9,
            explosion = "explosion"
          },
          {
            type = "create-entity",
            entity_name = "nuke-explosion"
          },
          {
            type = "camera-effect",
            effect = "screen-burn",
            duration = 60,
            ease_in_duration = 5,
            ease_out_duration = 60,
            delay = 0,
            strength = 6,
            full_strength_max_distance = 200,
            max_distance = 800
          },
		  {
            type = "play-sound",
            sound = sounds.nuclear_explosion(0.9),
            play_on_target_position = false,
            -- min_distance = 200,
            max_distance = 1000,
            -- volume_modifier = 1,
            audible_distance_modifier = 3
          },
          {
            type = "play-sound",
            sound = sounds.nuclear_explosion_aftershock(0.4),
            play_on_target_position = false,
            -- min_distance = 200,
            max_distance = 1000,
            -- volume_modifier = 1,
            audible_distance_modifier = 3
          },
          {
            type = "damage",
            damage = {amount = 400, type = "explosion"}
          },
          {
            type = "invoke-tile-trigger",
            repeat_count = 1,
          },
          {
            type = "destroy-decoratives",
            include_soft_decoratives = true, -- soft decoratives are decoratives with grows_through_rail_path = true
            include_decals = true,
            invoke_decorative_trigger = true,
            decoratives_with_trigger_only = false, -- if true, destroys only decoratives that have trigger_effect set
            radius = 14 -- large radius for demostrative purposes
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 1000,
              radius = 7,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-ground-zero-projectile",
                starting_speed = 0.6 * 0.8,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 1000,
              radius = 35,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave",
                starting_speed = 0.5 * 0.7,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              show_in_tooltip = false,
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 1000,
              radius = 26,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave-spawns-cluster-nuke-explosion",
                starting_speed = 0.5 * 0.7,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              show_in_tooltip = false,
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 700,
              radius = 4,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave-spawns-fire-smoke-explosion",
                starting_speed = 0.5 * 0.65,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              show_in_tooltip = false,
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 1000,
              radius = 8,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave-spawns-nuke-shockwave-explosion",
                starting_speed = 0.5 * 0.65,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              show_in_tooltip = false,
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 300,
              radius = 26,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave-spawns-nuclear-smoke",
                starting_speed = 0.5 * 0.65,
                starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
              }
            }
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              show_in_tooltip = false,
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 10,
              radius = 8,
              action_delivery =
              {
                type = "instant",
                target_effects =
                {
                  {
                    type = "create-entity",
                    entity_name = "nuclear-smouldering-smoke-source",
                    tile_collision_mask = { "water-tile" }
                  }
                }
              }
            }
          }
        }
      }
    }


if mods ["AtomicArtillery"] then

	table.insert(data.raw.projectile["atomic-artillery-projectile"].action =
	
	{
			type = "direct",
			action_delivery =
			{
			  type = "instant",
			  target_effects =
			  {
				--Damage effects				
				{
					type = "nested-result",
					action = 
					{
						radius = 35, --same size as the shockwave to follow, needed to get auto-targeting to space shots correctly. Switched to fire because the thermal pulse is also a thing on nukes.
						--Finally, by having this here, you get the radar update with everything dying like you expect with a nuke.
						type = "area",
						action_delivery = {
							type = "instant",
							target_effects = {
								{
									type = "damage",
									damage = { amount = 1500, type = "fire" },
								},
							},
						},
					},
				},
				{
				  type = "destroy-cliffs",
				  radius = 9,
				  explosion = "explosion"
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 35,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave",
					  starting_speed = 0.5 * 0.7,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 7,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-ground-zero-projectile",
					  starting_speed = 0.6 * 0.8,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				--Sound effects
				{
				  type = "play-sound",
				  sound = sounds.nuclear_explosion_aftershock(0.4),
				  play_on_target_position = false,
				  -- min_distance = 200,
				  max_distance = 1000,
				  -- volume_modifier = 1,
				  audible_distance_modifier = 3
				},
				{
				  type = "play-sound",
				  sound = sounds.nuclear_explosion(0.9),
				  play_on_target_position = false,
				  -- min_distance = 200,
				  max_distance = 1000,
				  -- volume_modifier = 1,
				  audible_distance_modifier = 3
				},
				--Graphical effects
				{
				  type = "create-entity",
				  entity_name = "nuke-explosion"
				},
				{
				  type = "camera-effect",
				  effect = "screen-burn",
				  duration = 60,
				  ease_in_duration = 5,
				  ease_out_duration = 60,
				  delay = 0,
				  strength = 6,
				  full_strength_max_distance = 200,
				  max_distance = 800
				},
				{
				  type = "invoke-tile-trigger",
				  repeat_count = 1,
				},
				{
				  type = "destroy-decoratives",
				  include_soft_decoratives = true, -- soft decoratives are decoratives with grows_through_rail_path = true
				  include_decals = true,
				  invoke_decorative_trigger = true,
				  decoratives_with_trigger_only = false, -- if true, destroys only decoratives that have trigger_effect set
				  radius = 14 -- large radius for demostrative purposes
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 26,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-cluster-nuke-explosion",
					  starting_speed = 0.5 * 0.7,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 700,
					radius = 4,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-fire-smoke-explosion",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 1000,
					radius = 8,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-nuke-shockwave-explosion",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 300,
					radius = 26,
					action_delivery =
					{
					  type = "projectile",
					  projectile = "atomic-bomb-wave-spawns-nuclear-smoke",
					  starting_speed = 0.5 * 0.65,
					  starting_speed_deviation = nuke_shockwave_starting_speed_deviation,
					}
				  }
				},
				{
				  type = "nested-result",
				  action =
				  {
					type = "area",
					show_in_tooltip = false,
					target_entities = false,
					trigger_from_target = true,
					repeat_count = 10,
					radius = 8,
					action_delivery =
					{
					  type = "instant",
					  target_effects =
					  {
						{
						  type = "create-entity",
						  entity_name = "nuclear-smouldering-smoke-source",
						  tile_collision_mask = { "water-tile" }
						}
					  }
					}
				  }
				}
			  }
			}
		})
end
I am no pro ad lua so i guess i made some mistake with the syntax but i cannot pinpoint it.
All help is again appreciated :)
Post Reply

Return to “Modding help”