Scenario in a mod?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
SusiQ
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jan 19, 2015 12:45 pm
Contact:

Scenario in a mod?

Post 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?

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Scenario in a mod?

Post 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.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Scenario in a mod?

Post 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 1484 times
For the second question:
Mod request - please change flamethrower ammo recipe
Change a recipe
[HELP] Edit the data of only one entity
quick links: log file | graphical issues | wiki

User avatar
SusiQ
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jan 19, 2015 12:45 pm
Contact:

Re: Scenario in a mod?

Post by SusiQ »

Thanks! You guys are awesome :D

Post Reply

Return to “Modding help”