Where can I find the source for the base-mod?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Where can I find the source for the base-mod?

Post by adamwong246 »

I am getting into modding but it would be helpful if I could see the lua code for the vanilla game. I'm not sure if Wube is withholding that code or perhaps I simply haven't found it. It just would be much easier to make mods if I could see some examples "from the horses mouth".

I found this but I'm not sure it's what I'm looking for https://github.com/wube/factorio-data

So, I'm not looking for the engine code, just all the prototype implementation for vanilla entities. Am I asking for something ludicrous or no?

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Where can I find the source for the base-mod?

Post by Xorimuth »

Yes that's the base and core mods. Very useful for tracking changes between versions. You can also find them on your computer inside your game install (exact location depends on platform).
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Where can I find the source for the base-mod?

Post by DaveMcW »


User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Where can I find the source for the base-mod?

Post by adamwong246 »

That IS very helpful, but I'm looking for the code which governs an items behavior, not just it's configuration.

My goal is this post: viewtopic.php?f=16&t=94954

What I'd like to achieve is making my power sources "dumb"- as in, they don't scale with the grid's satisfaction. So steam engines just burn coal continuously and it's up to the player to use signals to scale as needed. The same with nuclear reactors- I want them to run 100% all the time.

So what I'm looking for is the code that affects this behavior. The link you posted is what you'd find in `data.lua`. I'm looking for the base version of `control.lua`

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Where can I find the source for the base-mod?

Post by Xorimuth »

adamwong246 wrote:
Tue Jan 26, 2021 11:56 pm
That IS very helpful, but I'm looking for the code which governs an items behavior, not just it's configuration.

My goal is this post: viewtopic.php?f=16&t=94954

What I'd like to achieve is making my power sources "dumb"- as in, they don't scale with the grid's satisfaction. So steam engines just burn coal continuously and it's up to the player to use signals to scale as needed. The same with nuclear reactors- I want them to run 100% all the time.

So what I'm looking for is the code that affects this behavior. The link you posted is what you'd find in `data.lua`. I'm looking for the base version of `control.lua`
Ah, there's no such thing. The base game does all of its runtime logic in C++, which is not visible, but far quicker.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Where can I find the source for the base-mod?

Post by adamwong246 »

I found what I am looking for. On a mac, the base and core can be found within the game itself, at ~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents

Post Reply

Return to “Modding discussion”