Page 1 of 1
add researh, change item
Posted: Mon Jan 20, 2014 10:00 am
by linainverse
Hello. I'm the visual type of person, I better understand if I see something rather then read. So I'm asking for a bit of an example help. I want to add a technology (e.g. "Personal Enhancer"), completely new, which is enabled after researching the personal laser turret, and which adds 2 points of laser damage to the personal laser turret, and it gives access to another research ("Personal Enhancer 2") which adds 2 points more.I think I can do this alone but the "order" thingy and some else confuses me a bit. Can some make me this example? Hope it's not too much.
Thanks.
Re: add researh, change item
Posted: Mon Jan 20, 2014 10:27 am
by FreeER
Because the personal laser defense uses an 'electric' type ammo (see data\base\prototypes\equipment\equipment.lua, line 218) what you would do is create a technology using the "ammo-damage" modifier (see data\base\prototypes\laser-turret-upgrades.lua for use and
Wiki Technology-Modifier for a list of other available modifiers) and specify the ammo_category as "electric".
Here is an example data.lua file for the tech
Code: Select all
data:extend({
{
type = "technology",
name = "basic-laser-defense-equipment-damage-1",
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects =
{
{
type = "ammo-damage",
ammo_category = "electric",
modifier = "0.1"
}
},
prerequisites = {"basic-laser-defense-equipment"},
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 30
},
upgrade = "true",
order = "e-n-a"
},
{
type = "technology",
name = "basic-laser-defense-equipment-damage-2",
icon = "__base__/graphics/technology/laser-turret-damage.png",
effects =
{
{
type = "ammo-damage",
ammo_category = "electric",
modifier = "0.2"
}
},
prerequisites = {"basic-laser-defense-equipment-damage-1"},
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 30
},
upgrade = "true",
order = "e-n-a"
},
})
The "prerequisites" state which technologies must already be researched before the one being defined can be researched (in the first, the personal laser defense, in the second the first damage upgrade). "upgrade" will hide future technologies (upgrade 2 in this example, but if you had a damage-36 it would hide all 37) until the previous upgrade has been researched. "order" is simply a string (aka text) that is used to determine which technology should be shown first in the Research menu (based on alphabetical order, a before b and c after b, when compared to other order strings). Note: I copied the laser turret damage tech for this example and only changed the names, prerequisites, and effects (so icons, research cost and time, and the order are the same).
at least I'm 90% certain that would work, I haven't actually tried this particular code
Should it give you any issues or you have any other questions just make another post here, I'll be happy to help
Re: add researh, change item
Posted: Mon Jan 20, 2014 5:23 pm
by linainverse
ok, i'll try
in between, my second question is - are there limits for the armors' "grid"?
Re: add researh, change item
Posted: Mon Jan 20, 2014 5:43 pm
by ficolas
The limit is the screen.
Also adding a modifier to electric will also increase laser turret damage, same as the laser turret damage tech increases the personal laser damage
Re: add researh, change item
Posted: Tue Jan 21, 2014 9:17 am
by linainverse
somehow I can't see the "vanilla" damage of the turrets, or am I blind...
Re: add researh, change item
Posted: Tue Jan 21, 2014 9:50 am
by Dysoch
linainverse wrote:somehow I can't see the "vanilla" damage of the turrets, or am I blind...
you can, check in dytech/prototype/entity/base-edits.lua in my mod.
that will show you the easy way to modify the vanilla items and entities.
basicly you copy the base settings, and modify them to your wishes. the game will then override the base game content on load of the game
Re: add researh, change item
Posted: Tue Jan 21, 2014 2:42 pm
by ficolas
Dysoch wrote:linainverse wrote:somehow I can't see the "vanilla" damage of the turrets, or am I blind...
you can, check in dytech/prototype/entity/base-edits.lua in my mod.
that will show you the easy way to modify the vanilla items and entities.
basicly you copy the base settings, and modify them to your wishes. the game will then override the base game content on load of the game
Thats nit what he means I think...
There is a laser shooting speed and laser damage but I think it is only shown when laser turrets are researched.
Re: add researh, change item
Posted: Mon Feb 17, 2014 6:21 pm
by linainverse
It's not working.
And
Also adding a modifier to electric will also increase laser turret damage, same as the laser turret damage tech increases the personal laser damage
is not
((