[WIP] Customizable/modular tanks

Topics and discussion about specific mods
Post Reply
ForFoxAche
Burner Inserter
Burner Inserter
Posts: 19
Joined: Tue Aug 19, 2014 12:47 pm
Contact:

[WIP] Customizable/modular tanks

Post by ForFoxAche »

I made a mod that allows you to assemble tanks out of parts. Right now I only added 2 chassis, 2 engines, and 2 weapons for the proof of concept. Any property can be modified since it modifies the recipies/parts rather than changing the entities at runtime.

I figured I would start a thread to get input and ideas. I don't know well this scales, but as long as Factorio can deal with a large amount of recipes with somewhat long names it should work a-ok.

Here is an imgur album which explains how it works

I like the current way of selecting the recipe, but since smart inserters only allow 5 filters it doesn't scale all that well...

Obviously it would be a huge undertaking to create all the tanks and the recipes by hand, so I made a program to create the items and the recipes from the given parts. To give you an idea of how it works here is the config file I used to generate the imgur example. Only the tanks are generated though, the engines, chassis, and all the other parts are made by hand and then used as input for the program.

Code: Select all

[templates]
recipe = D:/LuaDev/TankMod/recipe.lua
entity = D:/LuaDev/TankMod/tank.lua
item = D:/LuaDev/TankMod/item.lua

[base]
graphics = "__TankMod__/graphics/items/"
format = ".png"
entityout = D:\Win8\Spel\Factorio\mods\TankMod_1.0.0\prototypes\entities\tanks.lua
recipeout = D:\Win8\Spel\Factorio\mods\TankMod_1.0.0\prototypes\recipes\tanks.lua
itemout = D:\Win8\Spel\Factorio\mods\TankMod_1.0.0\prototypes\items\tanks.lua

[preconvertsettings]
--$chassis name = 1$name

[exportsettings]
minable result = $name

[engine]
name = +"tmengine1"
weight = +1000
consumption = "100kW"
effectivity = 1.0
burner effectivity = 1.0
--fuel_inventory_size?

[engine]
name = +"tmengine2"
weight = +2000
consumption = "600kW"
effectivity = 1.0
burner effectivity = 1.0

[chassis]
$weaponcount = 1
name = +"tmchassis1"
weight = 1000
collision_box = {{-0.9, -1.3}, {0.9, 1.3}}
max_health = 1000
resistances =
{
    {
		type = "fire",
		decrease = 100,
		percent = 100
    },
},
--fuel_inventory_size?
--inventory_size?

[chassis]
$weaponcount = 3
name = +"tmchassis2"
weight = 2000
collision_box = {{-0.9, -1.3}, {0.9, 1.3}}
max_health = 2000

[weapon]
name = +"tmminigun"
weight = +500
+guns =
{
	"tmminigun"
}

[weapon]
name = +"tmcannon"
weight = +500
+guns =
{
	"tmcannon"
}
Which generates a rather large (96KB) recipe file. That is with 2 chassis, 2 engines, and 2 weapons. Chassis1 can hold 1 weapon and Chassis3 can hold up to 3 weapons. After compressing the whole mod is only 22KB though.

What do you think? Worth working on?

andreiosu
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Jun 23, 2016 4:55 pm
Contact:

Re: [WIP] Customizable/modular tanks

Post by andreiosu »

Yes Its sounds good I'll test it out and see. Just update it to 0.13

Post Reply

Return to “Mods”