异星工厂怎么制作mod呢,还有很多玩家还不知道的,下面小编为玩家们带来了异星工厂制作mod方法介绍,希望对玩家们有所帮助,一起来看看吧。
异星工厂制作mod方法介绍
首先,游戏目录下有个【mods】文件夹,
在【mods】文件夹下面再建一个【MyMods】文件夹,
在【MyMods】文件夹里面用记事本之类的编辑器新建一个【info.json】文件,
【info.json】文件的内容是:
{
"name":"MyMods",
"author":"MyMods",
"version":"0.0.1",
"title":"MyMods",
"homepage":"http://www..com",
"description":"MyMods",
"dependencies": ["base"]
}
然后再新建一个目录【Items】,什么名称的目录都可以,
把【Factoriodatabaseprototypesitemdemo-mining-tools.lua】这个官方文件复制到【Items】文件夹里面,
好了,回到【MyMods】文件夹,新建一个【data.lua】文件
【data.lua】文件的内容是:
-- Items 这里是注释
require("Items.demo-mining-tools ")
这里解释一下,require("目录.文件名"),就是启用这个文件里面的物品啦。
好了,抛砖引玉,举一反三,大伙疯狂的制作Mod吧,顺便有时间也写个跟详细的教程出来,谢谢~~
官方【demo-mining-tools.lua】文件的内容是:
data:extend(
{
{
type = "mining-tool",
name = "iron-axe",
icon = "__base__/graphics/icons/iron-axe.png",
flags = {"goes-to-main-inventory"},
action =
{
type="direct",
action_delivery =
{
type = "instant",
target_effects =
{
type = "damage",
damage = { amount = 5 , type = "physical"}
}
}
},
durability = 4000,
subgroup = "tool",
order = "a[mining]-a[iron-axe]",
speed = 2.5,
stack_size = 32
}
}
)
durability = 4000 这里是耐久度。 speed=2.5 这里是采矿速度。
知道怎么改了吧,呵呵~~
这里是添加新物品的教程:
新建了一个【MyModsItemsMineralResource.lua】文件,专门放原料物品;
data:extend(
{
{
-- 这里是原版煤矿的内容;
type = "item",
name = "coal",
icon = "__base__/graphics/icons/coal.png",
flags = {"goes-to-main-inventory"},
fuel_value = "8MJ",
subgroup = "raw-material", -- 这里表示原材料;
order = "b[coal]",
stack_size = 64
},
{
-- 这里是新建物品的内容;
type = "item",
name = "PrimaryCompressCoal",
icon = "__base__/graphics/icons/coal.png", -- 这里表示物品的图片,自己美化也行的;
flags = {"goes-to-main-inventory"}, -- 这里表示放入物品栏,不是武器栏;
fuel_value = "16MJ", -- 这里表示燃烧值;
subgroup = "intermediate-product", -- 这里表示手工制品,当然工厂也可以制造;
order = "b[coal]",
stack_size = 128 -- 这里表示堆积数量;
},
{
-- 这里是新建物品的内容;
type = "item",
name = "AdvancedCompressCoal",
icon = "__base__/graphics/icons/coal.png",
flags = {"goes-to-main-inventory"},
fuel_value = "32MJ",
subgroup = "intermediate-product",
order = "b[coal]",
stack_size = 256
},
{
-- 这里是新建物品的内容;
type = "item",
name = "Coke",
icon = "__base__/graphics/icons/coal.png",
flags = {"goes-to-main-inventory"},
fuel_value = "64MJ",
subgroup = "intermediate-product",
order = "b[coal]",
stack_size = 256
}
}
)
新物品要有名称吧,新建【MyModslocalechItemNames.cfg】文件;
[item-name]
#这里是原版翻译,可以自己润色;#
coal=煤矿
#这里是新建物品的名称翻译;#
PrimaryCompressCoal=初压煤
AdvancedCompressCoal=高压煤
Coke=焦煤
新物品要有配方,新建【MyModsRecipeItemRecipe.lua】
data:extend(
{
{
type = "recipe",
name = "PrimaryCompressCoal",
ingredients = {{"coal", 1}}, -- 这里是原料以及数量;
result = "PrimaryCompressCoal" -- 这里是产品;
},
{
type = "recipe",
name = "AdvancedCompressCoal",
ingredients = {{"PrimaryCompressCoal", 1}},
result = "AdvancedCompressCoal"
},
{
type = "recipe",
name = "Coke",
ingredients = {{"AdvancedCompressCoal", 1}},
result = "Coke"
}
}
)
完成之后记得在【MyModsdata.lua】里面添加信息,否则不起作用的~~
-- Items
require("Items.MineralResource")
--
require("Recipe.ItemRecipe")
好了,进游戏玩自己的去吧~
以上就是异星工厂制作mod方法介绍,希望对玩家们有所帮助,一起来看看吧。