Scripts ? How do you start making mods ?

Place to get help with not working mods / modding interface.
User avatar
quake513
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Feb 05, 2017 5:38 pm
Contact:

Scripts ? How do you start making mods ?

Post 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.
Attachments
Factorio Interact.jpg
Factorio Interact.jpg (448.38 KiB) Viewed 1645 times
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Scripts ? How do you start making mods ?

Post by darkfrei »

Yes, control.lua by mods is the same as by scenarios.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Scripts ? How do you start making mods ?

Post 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.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2174
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Scripts ? How do you start making mods ?

Post 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.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
quake513
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Feb 05, 2017 5:38 pm
Contact:

Re: Scripts ? How do you start making mods ?

Post by quake513 »

Ok thank you
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Scripts ? How do you start making mods ?

Post 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))
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”