Page 1 of 1
Scripts ? How do you start making mods ?
Posted: Thu Jun 28, 2018 11:59 pm
by quake513
I am wanting to make a custom scenario but trying to understand how to write script for Factorio, and i thought that the modding community would be able to help me.
Does Factorio use the same scripting style/type for the mods as for the scenario? I know that the scenario uses .lua script.
What I am trying to do is to use some features that the campaign uses. Like talking to player through text, and highlight an area or item on the map to interact with the player.
Thing is that I am new to scripting and so trying to understand how to do this. all help is welcome.
Thank you.
Re: Scripts ? How do you start making mods ?
Posted: Fri Jun 29, 2018 10:02 am
by darkfrei
Yes, control.lua by mods is the same as by scenarios.
Re: Scripts ? How do you start making mods ?
Posted: Fri Jun 29, 2018 1:12 pm
by eradicator
Let me write out the unwritten rule:
"How do i mod" is far too broad a question. Nobody is going to write you a personal modding tutorial, use google to find already existing ones. Use forum search to find old posts. In short: Show that you did your own research. Learning is not something other people can do for you. And if you have a sufficently specific/interesting question, then you can come back here and be far more likely to get an answer.
Re: Scripts ? How do you start making mods ?
Posted: Fri Jun 29, 2018 2:15 pm
by Ranakastrasz
Assuming you are already a programmer. If not, you really should learn some programming first.
The basics is that you find a mod that looks simple. Download it, unzip it, and look at all the files in Notepad++.
Find a second simple mod. Download it, unzip it, look at it in notepad++
Try to guess what each part does, based on differences between the two mods.
Use those guesses to make modifications.
Ask specific questions on the forums, like "Why doesn't this value, when changed to this, do this other thing I expected", but only if you cannot find solutions by searching (Search feature on the forum)
That's pretty much how I learn every new programming language.
The base game itself is a mod (you can literally disable it)
And each scenario has some kind of script associated with it in the install directory. So, those starting places are where you want to look.
Re: Scripts ? How do you start making mods ?
Posted: Fri Jun 29, 2018 3:40 pm
by quake513
Ok thank you
Re: Scripts ? How do you start making mods ?
Posted: Mon Jul 02, 2018 8:32 am
by bobingabout
Ranakastrasz wrote:Assuming you are already a programmer. If not, you really should learn some programming first.
The basics is that you find a mod that looks simple. Download it, unzip it, and look at all the files in Notepad++.
Find a second simple mod. Download it, unzip it, look at it in notepad++
Try to guess what each part does, based on differences between the two mods.
Use those guesses to make modifications.
Ask specific questions on the forums, like "Why doesn't this value, when changed to this, do this other thing I expected", but only if you cannot find solutions by searching (Search feature on the forum)
That's pretty much how I learn every new programming language.
The base game itself is a mod (you can literally disable it)
And each scenario has some kind of script associated with it in the install directory. So, those starting places are where you want to look.
Sounds like how I started, Except I'm hardcore, and use wordpad to look at and edit files.
Also, my advice is not to start with scripts, start with data.lua and it's relatives, and try adding some assets before getting into the nitty gritty of scripting. (I'm like, the author of the most popular set of mods, and of my dozen and a half+ mods, only 4 of them even have and real scripting in them.(and a couple others might have a script with a few lines in it.) Clock, Inserters, Logistics(which has a cut down copy of some of the inserter scripts) and Classes(mostly to handle the body swapping stuff))