![]() So all global variables must be stored in that table, otherwise the game will desync. One thing that slowed me down a lot is the fact that if you want saves (and therefore multiplayer) to work you need to note that only variables in "global" table are saved. The best way to debug is in my opinion using game.write_file(,, true) but I am probably heavily biased since I do massively multi-threaded applications for a living where breakpoints are not possible. Setting up autocomplete would probably take me longer than developing my whole mod. You just need to accept this and use a workaround if possible.ĥ. You can't do many things even if they seem trivial. Especially for the things that are just weird in lua like foreach loops.Ĥ. ![]() Also if you want to do something try to download a mod that does it and analyze the code. Google query for "Factorio lua API" unfortunately does not point at this page which made me lose some time. You should start, there are just a few top level objects, explore from there. I don't like it, I'd prefer a C++ or Java API but it is how it is.ģ. Using lua to call methods on C++ objects is complicated enough. Adding language conversion is just another obstacle. I edit the files directly in the mod folder, control script changes don't even need restart of the whole game, data and typing errors fail during game start so they're quite fast to fix.Ģ. For a dev environment simple text editor (like Notepad++) is sufficient. The points below are just my personal opinion.ġ. My goal is to get my mod done not setup myself for working as a mod developer. I'm developing my 1st mod now and it's almost done so I'll try to answer some questions and give some advice. I've dove quite far off the deep end, and I'm really really wanting to get started on my first mod, but sheesh, this is not the easiest thing to do. Intellisense - I like visual studio code and I shouldn't have to guess exactly what a particular object is or does.ĭebug/Breakpoints/Stepping - Again, inspecting variables on the fly would be sweet. I would like to know if there's any way to get the following information, either in LUA or TS/JS or whatever format possible. The main issue that I'm having is, what's best? Should I just embrace the suck, and develop using LUA? I don't know anything about the API, checking through documentation just shows an absolutely MASSIVE API for which to interact with, but even something as simple as trying to get a blueprint from a users "my blueprint" section seems like an absolute chore. but that doesn't work all that well with TypeScriptToLua, and instead it's just better to build mods natively in lua. I've also setup the Factorio Mod Toolkit that includes the Debug Adapter, Profiler, etc. I have successfully setup the following dev environments "TypeScriptToLua" using "Typed-Factorio" npm package, as well as several build scripts to successfully deploy the mod to the appropriate folder for faster iteration. Guys, I'm trying to get started working with mods for this game, however I keep running into problem, after problem, after problem trying to just setup a dev environment.
0 Comments
Leave a Reply. |