I think I can answer your questions one by one, but not very detail to avoid making the answers complicated. Tell us if you want to know more.
Marcus Aseth wrote:Noone?
Well my only guess is that my question is just too vague for anyone to answer or too long to answer, so I'll try asking something more specific and split it up.
Because this board isn't that famous. Most modders are busy on their mods. May need some time before someone actually read your post.
But it is great that you can break your question into smaller ones.
Marcus Aseth wrote:1) I've read another topic/tutorial here on the forum and if I got it correctly, my artillery item would have to fall under a prototype. If current prototype would prove not suitable for it, it is possible to add prototypes to the game trough mods? Also, if it is, do I have access to the code of current vanilla prototype so that I can see how it is and what it does?
Unfortunately, no. You have to use the prototypes provided by the game. You can use scripts to do something special on top of the existing prototypes, but you can't change their default behaviours, and it is also limited by the APIs. For example, you can teleport a player to another location, but you can't do this to walls, because
LuaControl::teleport doesn't allow it.
Yes, it sucks, but it is mainly due to the heavy optimization in Factorio. These limitations allow the game to run fast.
Marcus Aseth wrote:2)I just started watching some Lua tutorials, apparently a Table is a collection of variables, and one of each artillery will eventually be just a variable in the game, right? If so, if I want to group them together it means I need to have some kind of "manager" that can keep adding and removing N tables of N artillery variables in it?
Yes, you can do it. The "manager" you are looking for is the
global table, which is persistent for the save.
Each mod has its own global table, you can do anything to it without affecting other mods.
Marcus Aseth wrote:3)About opening a minimap and designating the tager area, can this be easily achieved? Meaning the code that currently convert all the entities in the game into a map can just be copy-pasted to have the same functionality in my minimap? Do I have access to that code? What about clicking on said minimap to translate that in coordinates in the world relative from artillery group? There is any obvious obstacles to such feature? Or even opening a tab for the minimap to go in and to manage the groups, does that present some obvious obstacle?
Theoretically, you can make your own minimap by using the find_entities APIs in
LuaSurface, and then represent the minimap using a matrix of tiny buttons. But I wonder the performance will be good. If the search area is large, the process will be sloooooow. And making so many GUI elements at a time will definitely make the game lag. That's why you don't see any existing mod with these features.
However, things may change in the coming v0.15, as there will be some new APIs.
By the way, besides the two mods mentioned by Adil, I think you will also be interested at these two:
https://mods.factorio.com/mods/Superche ... %20Station
https://mods.factorio.com/mods/Superche ... n%20Cannon
Orbital Ion Cannon lets you fire an area on the map. You mark the target area on the map (not minimap) using a special item. So the range is limited by your reach distance.
You can eliminate the range limit with Satellite Uplink Station. By entering the station, just like entering a vehicle, you will be turned into god mode, which is like playing the sandbox scenario.
Marcus Aseth wrote:I played a bit few months ago with C++ out of curiosity
You said you are not a programmer, but you have learnt C++. hm......
C++ is hard to learn, so I don't think lua will be a problem for you. My advice is, don't waste your time on reading generic books about lua. Just pick a small mod and learn from it. You are free to look at the contents of any mod and change its scripts to see the effect (as long as you don't publish it as your own mod of course
).
If you have something not sure about lua, just ask Google. It is what I did when I made Creative Mode, which was my first time to program in lua.
And I am still doing it now.
Oh, and we don't say "pointer" in lua, because it cannot be used in lua (and many other languages). We say "reference". E.g. the reference to a turret.