abstract question about modding, file structure

A place for discussion of making game modifications.
akkamaddi
Posts: 147
Joined: Tue Sep 26, 2017 5:11 am

abstract question about modding, file structure

Postby akkamaddi » Fri Oct 06, 2017 2:00 pm

I want to make a quick reference to what I said elsewhere.... This is LOW priority by my own admission. Get to it when you get to it, and thank you for your work.

So...

My little modding experience in a "real" programming language was with Minecraft, using Java. In Java, everything is a class file, where you start with some declarations and then all the code stuff is bound in the class itself. Basically:

.class.SuperOre (
stuff stuff stuff
)

Anything outside the bounding of the class declaration was a call to another class, or comments.

Lua doesn't seem to do have bounding for what makes the file itself.

So, in theory, if Lua just scans through everything and runs everything and anything it crosses, do specific kinds of functions have to be in specifically named files?

What I am getting at is, in the Modding folder, could we create a file "zZzZz_PlayerFiles", and then pack as much as possible into one or a few well structured (from a person reading it point of view) .lua files with the contents of our mods? If so, is could make modding much easier, as we are minimizing editing core files, which could then be updated.

I know for some things, that would not work.

Something that I don't have any idea how to design, but mentioned in (viewtopic.php?f=3&t=582) my post where I discussed table hooks (item #6), I think in the long run it would really pay off if there was some way to design a system like:

@@epic_systems.lua@APPEND@epic_systems = {
{New System Data}
}

And the game knows to point to epic_systems.lua, knows to append to the end of the function, and knows the function is "local epic_systems", and then appends {New System Data} to the end of the epic_systems. This way, going with what I wrote above, I could make a race, and then for their home planet or system just make a hook call to the epic planets or epic systems table and append my system/world table entry into the end, without editing the system files.

Similarly, though this may be worse to design:

@@epic_systems.lua@SUPERCEDE@epic_systems = {
{Tyl, new data}
}

Where I could identify the section {Tyl system data} and overwrite/supercede that with {Tyl new data}. This would be good for a mod that changes core items, but may be more difficult to design, and would make conflicts between multiple mods a potential issue.

I'm just leaving these on the table. Thank you for your time. :)

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 20 guests

cron