Page 1 of 1

Scenario in a mod?

Posted: Tue Aug 09, 2016 2:19 pm
by SusiQ
Hello!

I am trying to make a mod out of something: a beautiful story and map my teacher made for us to play with in factorio. However he didn't do it by making a mod, he did it by changing the game files. So now that I'm trying to make a mod out of it so that more people can play it.
I expect I will have many questions along the way.

My first question that I haven't been able to find: is there any way to add scenario's to a mod? So that people that download it can just add the mods folder and don't have to go adding things anywhere else?

My second question: Is there a way to change existing items in the game through a mod? I see that it is possible to add new items fairly easily but can you change how existing things work? Like for example change the recipe for red science?

Re: Scenario in a mod?

Posted: Wed Aug 10, 2016 3:51 am
by aubergine18
For scenario stuff, investigate "story_table" - you can find example in base/scenarios/sandbox/control.lua or search for scripts that contain text (require "story") without the parentheses, I just added those to make it clear what text to search. Also, check out the base/campaigns folder. You can find source code to `story` stuff in core/lualib/story.lua

Existing items, techs, recipes, etc., can be changed via a mod - they can be found in the 'data' global - a lot of the balancing mods do that sort of thing so you can look at their code to see how it's done.

Re: Scenario in a mod?

Posted: Wed Aug 10, 2016 11:41 am
by daniel34
Just make a folder called scenarios in the mod folder and put the scenario in there. It will show up in your game under Custom scenario:
factorio-scenario.png
factorio-scenario.png (71.5 KiB) Viewed 1824 times
For the second question:
Mod request - please change flamethrower ammo recipe
Change a recipe
[HELP] Edit the data of only one entity

Re: Scenario in a mod?

Posted: Tue Aug 16, 2016 4:50 pm
by SusiQ
Thanks! You guys are awesome :D