Help with research damage boost
Posted: Mon May 22, 2017 7:33 pm
Hello potentially helpful mod dev / reader. I have a little problem I haven't been able to solve.
I'm trying to increase the damage of a poison cloud that is created by one of my custom rockets via research just like you can with laser and gun turrets. The custom rocket I made acts just like a capsule minus the throwing part. I simply told the rocket to create and entity called "rocket-poison-cloud" at the same time it damages something, which is just the regular poison cloud renamed, scaled down, and duration reduced.
Here is the code for the rocket that creates the cloud (stored in projectiles.lua):
Here is the code for the rocket-poison-cloud entity in entities.lua:
First I tried giving it a damage boost the same way laser turrets get their damage boost.
Laser Code:
This is where it gets tricky.
The entity I am creating doesn't have an ammo_category. So I followed the example of the laser-turret and give it a category, and added categories.lua to my mod, and put the code in, changed the names, made them match the rocket-poison-cloud entity and so forth. I booted up factorio, the tech shows up and everything but when researched, it still does not change the damage of the rocket-poison-cloud.
What I tried is below, but this did not work
The second and third tries I did just kept the mod from loading, and it pretty much involved just moving the name to type = "poison-rocket-cloud", and the same for ammo_category, etc.
I pretty much just confused the heck out of myself trying to do this, so some help would be greatly appreciated.
I'm trying to increase the damage of a poison cloud that is created by one of my custom rockets via research just like you can with laser and gun turrets. The custom rocket I made acts just like a capsule minus the throwing part. I simply told the rocket to create and entity called "rocket-poison-cloud" at the same time it damages something, which is just the regular poison cloud renamed, scaled down, and duration reduced.
Here is the code for the rocket that creates the cloud (stored in projectiles.lua):
Code: Select all
{
type = "projectile",
name = "poison-rocket",
flags = {"not-on-map"},
acceleration = 0.003,
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
{
type = "create-entity",
entity_name = "explosion"
},
{
type = "damage",
damage = {amount = 75, type = "explosion"}
},
{
type = "create-entity",
show_in_tooltip = true,
entity_name = "rocket-poison-cloud"
},
{
type = "create-entity",
entity_name = "small-scorchmark",
check_buildability = true
}
}
}
},
light = {intensity = 0.5, size = 4},
animation =
{
filename = "__base__/graphics/entity/rocket/rocket.png",
frame_count = 8,
line_length = 8,
width = 9,
height = 35,
shift = {0, 0},
priority = "high"
},
shadow =
{
filename = "__base__/graphics/entity/rocket/rocket-shadow.png",
frame_count = 1,
width = 7,
height = 24,
priority = "high",
shift = {0, 0}
},
smoke =
{
{
name = "smoke-fast",
deviation = {0.15, 0.15},
frequency = 1,
position = {0, -1},
slow_down_factor = 1,
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5
}
}
},
Code: Select all
{
type = "smoke-with-trigger",
name = "rocket-poison-cloud",
flags = {"not-on-map"},
show_when_smoke_off = true,
animation =
{
filename = "__base__/graphics/entity/cloud/cloud-45-frames.png",
flags = { "compressed" },
priority = "low",
width = 256,
height = 256,
frame_count = 45,
animation_speed = 0.5,
line_length = 7,
scale = 2,
},
slow_down_factor = 0,
affected_by_wind = false,
cyclic = true,
duration = 60 * 10,
fade_away_duration = 2 * 60,
spread_duration = 10,
color = { r = 0.2, g = 0.9, b = 0.2 },
action =
{
type = "direct",
action_delivery =
{
type = "instant",
target_effects =
{
type = "nested-result",
action =
{
type = "area",
perimeter = 8,
entity_flags = {"breaths-air"},
action_delivery =
{
type = "instant",
target_effects =
{
type = "damage",
damage = { amount = 15, type = "poison"}
}
}
}
}
}
},
action_cooldown = 30
}
Laser Code:
Code: Select all
{
type = "technology",
name = "laser-turret-damage-1",
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects =
{
{
type = "ammo-damage",
ammo_category = "laser-turret",
modifier = 0.1
}
},
prerequisites = {"laser-turrets"},
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1},
{"military-science-pack", 1}
},
time = 30
},
upgrade = true,
order = "e-n-a"
Code: Select all
{
type = "ammo-damage",
ammo_category = "laser-turret",
modifier = 0.1
}
What I tried is below, but this did not work
Code: Select all
{
type = "ammo-damage",
ammo_category = "rocket-poison-cloud",
modifier = 0.1
}
I pretty much just confused the heck out of myself trying to do this, so some help would be greatly appreciated.