Page 1 of 1

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

Posted: Tue Jan 26, 2021 11:37 pm
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?

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

Posted: Tue Jan 26, 2021 11:41 pm
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).

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

Posted: Tue Jan 26, 2021 11:42 pm
by DaveMcW

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

Posted: Tue Jan 26, 2021 11:56 pm
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`

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

Posted: Tue Jan 26, 2021 11:57 pm
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.

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

Posted: Sun Jan 31, 2021 7:24 pm
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