View unanswered posts | View active topics It is currently Sun Sep 22, 2019 11:49 am



Reply to topic  [ 6 posts ] 
Conflicting Mods - Regions.lua 
Author Message
User avatar

Joined: Sat Jun 06, 2015 3:04 am
Posts: 457
Reply with quote
Apparently other faction mods are conflicting with my mod. I'm a little confused as to why this is happening.

I edited the default regions.lua file to increase spawns in the vanilla game, but for some reason other factions are not being loaded unless my mod is loaded last.

Arthur's notes state "Mods that completely redefine the (regions) file are subject to extension by additive mods but two mods can not simultaneously redefine the file."

So two mods cannot edit the default regions, but other faction mods region definitions should still get added on.


If my mod loads first, shouldn't someone elses faction placement get loaded if it's below it in the load order?

_________________
https://discord.gg/BM4eeqS
http://reassemblyerect.site


Wed Jun 24, 2015 8:18 pm
Profile
User avatar

Joined: Sat Jun 06, 2015 3:04 am
Posts: 457
Reply with quote
Hiya,

I want to document what I found with the Regions.lua file for anyone else that runs into this problem.

If you look at the file:

{
totalSize = 300000,
color = 0x404040,


fleets = { { 3, { { 0, 5000 }, {1, 300} } },
{ 2, { { 0.5, 0}, { 0.51, 3000 }, {1, 500}}},
{ 4, { { 0.5, 0}, {0.7, 2000}, {0.9, 0} } } },

ambient = { 2, 1, 0 },
ident = 2,

subregions = {

{
ident = 200,
count = 8,
radius = { 0.1, 0.15 },
position = { 0.1, 1.0 },
fleets = { { 8, { { 0, 3500}, {1, 1000} } } },
fleetCount = { { 4, 8 } }
ambient = { 0 },
}
(I'm not going to list all the other subregion indent #'s. You get the point. Yaddda yadda to end of file.)
}
{


What I did for the mod was just duplicate the file, then edit the Subregion fleet values, and the global fleet values at the top.

What I did not realize is that having this document exist complete in the mod would prevent additional factions from being found. -- So other mods that added factions would not work when my mod was above them.

So I edited the file several different ways and found that the outside brackets closed out the file, so I removed those. I also removed the Subregion brackets because I wanted to make sure other factions would be added properly.

Then I found that the game world would not Regenerate. It just froze the game. So I removed the totalSize line at the top, and that fixed that problem.

After cleaning everything up and testing the new file, this is what I have:

Code:
fleets = { { 3, { { 0, 5000 }, {1, 300} } },
      { 2, { { 0.5, 0}, { 0.51, 3000 }, {1, 500}}},
      { 4, { { 0.5, 0}, {0.7, 2000}, {0.9, 0} } } },

   ambient = { 2, 1, 0 },
   ident = 2,

      {
         ident = 200,             
         count = 8,               
         radius = { 0.1, 0.15 }, 
         position = { 0.1, 1.0 },
         fleets = { { 8, { { 0, 3500}, {1, 1000} } } },
         fleetCount = { { 4, 8 } }                   
         ambient = { 0 },                             
      },

(Etc., etc. etc. all the way down with the rest of the indent numbers)

So all the default Fleet settings can be edited, The global fleet settings at the top can be edited, and there is no conflict with other faction mods no matter what the load order is.

Ta-da. - Hope that helps anyone else messing with this file.

_________________
https://discord.gg/BM4eeqS
http://reassemblyerect.site


Sat Jun 27, 2015 3:44 am
Profile

Joined: Mon May 04, 2015 10:08 am
Posts: 97
Reply with quote
That's awesome work Sumplkrum, very nicely discovered and explained. I feel like you should add this information to a "I bet you didn't know...: repository of information somewhere on the forums...

-Ha11uc1n0g3n
Unabashedly promoting my recently uploaded guide to cannons @ http://steamcommunity.com/sharedfiles/f ... =484801919


Mon Jul 20, 2015 12:30 am
Profile
User avatar

Joined: Sat Jun 06, 2015 3:04 am
Posts: 457
Reply with quote
Thanks!

At some point I'll document it all in one place. I keep finding new things though, so for now it's just one item on my to-do list. :)

_________________
https://discord.gg/BM4eeqS
http://reassemblyerect.site


Mon Jul 20, 2015 4:37 am
Profile
Site Admin
User avatar

Joined: Thu Jan 16, 2014 2:45 pm
Posts: 561
Location: Los Angeles
Reply with quote
There is a note on this in the "Map - regions.lua" second on the modding docs: http://www.anisopteragames.com/docs/

Quote:
The regions.lua file parses a single recursive Region definition structure. If the top level
region defines the totalSize parameter, it will replace the whole region definition. Region mods
that do not define totalSize will be merged with the existing region.


There isn't really a clean way for multiple mods to modify the base definition - I'm thinking of just making mods always add subregions because it is confusing when one of 20 or so mods silently overwrites a bunch of others.

The load order is a little confusing - regions are loaded in "merge order" which is backwards - the last mod is loaded first, and consecutive mods are merged with it - this way the top mod can overwrite everything else.


Tue Jul 21, 2015 4:51 pm
Profile
User avatar

Joined: Sat Jun 06, 2015 3:04 am
Posts: 457
Reply with quote
Aye. And I did read that.

It makes sense that only one mod can define the base file (everything above the Subregions).
When I first started messing with the file, I just sort of assumed subregions from other mods would be extended onto it.

So yes, it makes sense that only one mod can define the base attributes. And I guess if two mods happen to use the same indent id, one would override the other.

What I was originally going after were the Fleet settings at the top of the file because I was messing with populations. I wanted to increase the P count for those pieces so more and large ships would spawn.

In my testing I found that if I increased the P count for say faction 4, I got a lot more faction 4 spaces spawning on the map.
fleets = { { 3, { { 0, 5000 }, {1, 300} } },
{ 2, { { 0.5, 0}, { 0.51, 3000 }, {1, 500}}},
{ 4, { { 0.5, 0}, {0.7, 2000}, {0.9, 0} } } },

I don't really understand how these lines work. Whether they define 'ambient' spawns, or if they somehow amplify the subregions. But it its cool that they are editable. Someone could create a mod that created a totally fresh world by overriding both the Fleet settings at the top of the file, and all the default subregions.

_________________
https://discord.gg/BM4eeqS
http://reassemblyerect.site


Tue Jul 21, 2015 6:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software