How do I get started with using the API

Place to get help with not working mods / modding interface.
Anti-Antidote
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 27, 2016 9:35 pm
Contact:

How do I get started with using the API

Post by Anti-Antidote »

I have been playing Factorio for about 3 months, and I have been modding for 2. I have been studying lots of different mods, and I have the whole adding new stuff down. However, I cannot begin to fathom how to begin fathoming about how to script. The whole API makes no sense to me. Does anyone have a way that they learned how to make sense of it? Thanks, all!
User avatar
cbrx
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 06, 2016 9:48 pm
Contact:

Re: How do I get started with using the API

Post by cbrx »

Well, first of all, since I don't know about your general programming knowledge, or especially knowledge of LUA, I would say, definitely see that you understand the language before you go any further.
I personally think this site is the easiest to get started: http://tylerneylon.com/a/learn-lua/

Secondly, keep the Factorio API documentation ready. Mainly the main and classes page. Whenever you see an event or function used in the script, just search for it in the docs with your browser search functionality and you will see what it does. (Mostly, the docs are not perfect imo)

Lastly, I would suggest look into some easy mods in order to get the concept. Don't try to tackle something like misanthrope but something with very limited functionality. My current project (+zythum sorter) uses barely any API functions but contains the knowledge about how item prototypes are assigned to groups/subgroups for example.

Since you want to go for ingame scripting, you should probably rather look at mods that implement really basic event based behaviour. But it really all boils down to what you want to achieve. If you give us a more specific direction or an idea of what you want to do, we mighr be able to help you better.

Also, check the pinned topics in this forum, especially the video lesson could be helpful for you.
Post Reply

Return to “Modding help”