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.
Scripts ? How do you start making mods ?
Scripts ? How do you start making mods ?
- Attachments
-
- Factorio Interact.jpg (448.38 KiB) Viewed 1645 times
Re: Scripts ? How do you start making mods ?
Yes, control.lua by mods is the same as by scenarios.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Scripts ? How do you start making mods ?
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.
"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.
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Scripts ? How do you start making mods ?
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.
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.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Scripts ? How do you start making mods ?
Ok thank you
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Scripts ? How do you start making mods ?
Sounds like how I started, Except I'm hardcore, and use wordpad to look at and edit files.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.
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))