Need help with my first mod
Need help with my first mod
Hey Guys
First my english is not thaaaaaat good i think
A short discribtion
My mod is in the mod folder (the game does not crash) so i think i missed somethink
but I cant find what is missing xD
I would be happy if anyone can have a look at it
The mod just should decrase item costs for the circuits
with the best greetings
iCamper
DL Link:
http://www.file-upload.net/download-114 ... 0.rar.html
First my english is not thaaaaaat good i think
A short discribtion
My mod is in the mod folder (the game does not crash) so i think i missed somethink
but I cant find what is missing xD
I would be happy if anyone can have a look at it
The mod just should decrase item costs for the circuits
with the best greetings
iCamper
DL Link:
http://www.file-upload.net/download-114 ... 0.rar.html
Re: Need help with my first mod
Did you take a look at the modding tutorial? If everything is set up correctly, you should just be able to add a "recipe.lua" and add this code to it:
replace "YOUR_ITEM_NAME" with the item you want. (see the item.lua file under D:\Steam\steamapps\common\Factorio\data\base\prototypes\item)
all you need to do then is to require it in the "data.lua" file
Code: Select all
data:extend({
{
type = "recipe",
name = "YOUR_ITEM_NAME",
enabled = "true",
ingredients =
{
{"steel-plate", 1},
},
result = "YOUR_ITEM_NAME"
},
})
all you need to do then is to require it in the "data.lua" file
Re: Need help with my first mod
Add this to the data.lua file:
Code: Select all
require ("prototypes.recipe")
Re: Need help with my first mod
Thanks for youre answer
I did what u say but my mod isnt running yet ._.
This is entity
and this is my locale
I did what u say but my mod isnt running yet ._.
Code: Select all
require ("prototypes.demo-item")
require ("prototypes.item")
require ("prototypes.entity")
require ("prototypes.recipe")
require ("prototypes.technology")
Code: Select all
"name": "Advanced_Item_Costs"
"version": "0.1.1",
"title": "Advanced_Item_Costs"
"author": "iCamper"
"contact": "",
"homepage": "",
"description": "This mod reduces costs of some items like the prosessing unit"
}
Code: Select all
data:extend({
{
type = "item",
name = "electronic-circuit",
icon = "__base__/graphics/icons/electronic-circuit.png",
flags = {"goes-to-main-inventory"},
subgroup = "intermediate-product",
order = "c[electronic-circuit]",
stack_size = 200
},
)}
Code: Select all
data:extend({
})
Code: Select all
data:extend({
{
type = "item",
name = "advanced-circuit",
icon = "__base__/graphics/icons/advanced-circuit.png",
flags = {"goes-to-main-inventory"},
subgroup = "intermediate-product",
order = "d[advanced-circuit]",
stack_size = 200
},
{
type = "item",
name = "processing-unit",
icon = "__base__/graphics/icons/processing-unit.png",
flags = {"goes-to-main-inventory"},
subgroup = "intermediate-product",
order = "e[processing-unit]",
stack_size = 100
}
)}
Code: Select all
data:extend({
{
type = "recipe",
name = "electronic-circuit",
ingredients =
{
{"iron-plate", 1},
{"copper-cable", 1},
},
result = "electronic-circuit"
},
{
type = "recipe",
name = "advanced-circuit",
enabled = false,
energy_required = 4,
ingredients =
{
{"electronic-circuit", 1},
{"plastic-bar", 1},
{"copper-cable", 1},
},
result = "advanced-circuit"
},
{
type = "recipe",
name = "processing-unit",
category = "crafting-with-fluid",
enabled = false,
energy_required = 8,
ingredients =
{
{"electronic-circuit", 1},
{"advanced-circuit", 1},
{type="fluid", name = "sulfuric-acid", amount = 0.1},
},
result = "processing-unit"
}
)}
Code: Select all
data:extend({
{
type = "technology",
name = "advanced-electronics-3",
icon = "__base__/graphics/technology/advanced-electronics.png",
effects =
{
{
type = "unlock-recipe",
recipe = "advanced-advanced-circuit"
},
{
type = "unlock-recipe",
recipe = "advanced-processing-unit"
}
},
prerequisites = {"advanced-electronics-2"},
unit =
{
count = 200,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 45
},
order = "a-d-b",
}
)}
Code: Select all
[item-name]
advanced-electronic-circuit = Electronic circuit
advanced-advanced-circuit = Advanced circuit
advanced-processing-unit = Processing-unit
[technology-name]
advanced-electronics-3 = Advanced-electronics-3
[entity-name]
advanced-electronic-circuit = Electronic circuit
advanced-advanced-circuit = Advanced-circuit
advanced-processing-unit = Processing-unit
[item-description]
[recipe-name]
advanced-electronic-circuit = Electronic-circuit
advanced-advanced-circuit = Advanced-circuit
advanced-processing-unit = Processing-unit
Re: Need help with my first mod
Are you overwriting some recipes? If you want to do that, its better to use control.lua instead of using data:extend...
Re: Need help with my first mod
Yes thats i want to do
how i have to configurate the control.lua ?
how i have to configurate the control.lua ?
Re: Need help with my first mod
I don't have an example right now since I have never done this, but there are many tools available.
There's an example to modify the recipes in this thread, and for technologies, you should just need to change data.raw.recipes to data.raw.technology or something like that.
viewtopic.php?f=25&t=1221
Factorio API page:
http://lua-api.factorio.com/0.12.30/LuaTechnology.html
There's an example to modify the recipes in this thread, and for technologies, you should just need to change data.raw.recipes to data.raw.technology or something like that.
viewtopic.php?f=25&t=1221
Factorio API page:
http://lua-api.factorio.com/0.12.30/LuaTechnology.html
Re: Need help with my first mod
Ok
i tryed all what u say guys but the mod dont want to work
when i click on modifications (main menu)
i cant find my mod there ._.
i tryed all what u say guys but the mod dont want to work
when i click on modifications (main menu)
i cant find my mod there ._.
Re: Need help with my first mod
Oh you can't even find your mod? Are you sure the folder is in /mods and it has a info.json file?
Re: Need help with my first mod
Yeah I have that
Thats why i am a bit confused ._.
If u want to have a look at the things i've tryed here is the dl link with my mod
http://www.file-upload.net/download-114 ... s.rar.html
Code: Select all
{
"name": "Advanced_Item_Crafting_Costs",
"version": "0.1.1",
"title": "Advanced_Item_Crafting_Costs",
"author": "iCamper",
"contact": "",
"homepage": "",
"description": "This mod reduces costs of some items like the prosessing unit"
}
If u want to have a look at the things i've tryed here is the dl link with my mod
http://www.file-upload.net/download-114 ... s.rar.html
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: Need help with my first mod
You need to have it in .zip format not in .rar format.
if you change recipes/items/etc via data.raw...it needs to be in the data phase, so best be put into data-updates.lua which loads second after data.lua or even data-final-fixes.lua which loads last in the data phase.
if you change recipes/items/etc via data.raw...it needs to be in the data phase, so best be put into data-updates.lua which loads second after data.lua or even data-final-fixes.lua which loads last in the data phase.
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
Re: Need help with my first mod
Ok
Thanks ;D ;D
but now it says JSON parser error: expected object name
You sayed it would be better to do it in another way ?
Im just a beginner in modding could you give me an example ?
but this mod is running
http://www.file-upload.net/download-114 ... 1.zip.html
buuuuut it didnt change the costs after all
Thanks ;D ;D
but now it says JSON parser error: expected object name
Code: Select all
{
"name": "Advanced_Item_Costs",
"version": "0.1.1",
"title": "Advanced_Item_Costs",
"author": "iCamper",
"contact": "",
"homepage": "",
"description": "This mod reduces costs of some items like the prosessing unit",
}
Im just a beginner in modding could you give me an example ?
but this mod is running
http://www.file-upload.net/download-114 ... 1.zip.html
buuuuut it didnt change the costs after all
Re: Need help with my first mod
That's not valid JSON, the last element in an object or array must not be followed by a comma. Also you might want to add a dependency on a certain version of the base game that the mod is known to work with, like "dependencies": ["base >= 0.12.30"].iCamper wrote:but now it says JSON parser error: expected object nameCode: Select all
{ "name": "Advanced_Item_Costs", "version": "0.1.1", "title": "Advanced_Item_Costs", "author": "iCamper", "contact": "", "homepage": "", "description": "This mod reduces costs of some items like the prosessing unit", }
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Need help with my first mod
Well thanks....
I watched the tutorials i found..... but i dont understand it I need more help ._.
I watched the tutorials i found..... but i dont understand it I need more help ._.
Re: Need help with my first mod
Fixed your code, there was multiple mistakes. Extract this in your mods folder.
Though I haven't tested your mod yet.
for example
data:extend({}) is correct, you wrote data:extend({)}, which is not.
And the info.json, all items in the list has to finish with a "," which you forgot multiple times.
And don't forget, your mods have to be each individually packed in a different .zip, otherwise the user has to extract them.
http://s000.tinyupload.com/index.php?fi ... 8925238557
Though I haven't tested your mod yet.
for example
data:extend({}) is correct, you wrote data:extend({)}, which is not.
And the info.json, all items in the list has to finish with a "," which you forgot multiple times.
And don't forget, your mods have to be each individually packed in a different .zip, otherwise the user has to extract them.
http://s000.tinyupload.com/index.php?fi ... 8925238557
Re: Need help with my first mod
Thank you very much ^^
so now i have a last problem
i have another mod (5dim) and it changes this recipes too so how could i make it not load for this items ?
so now i have a last problem
i have another mod (5dim) and it changes this recipes too so how could i make it not load for this items ?
Re: Need help with my first mod
Nvm its running
Re: Need help with my first mod
Ok i have one more question
How can i change it that i can put a productive chip in the assambling machine when i want to create advanced circuits and prossesing units ?
How can i change it that i can put a productive chip in the assambling machine when i want to create advanced circuits and prossesing units ?