Modding problem with Starbase Defenses

I'm creating an improved starbase defense mod, but one think keeps bothering me:

I'm creating Battle Stations and Defense Systems modules in different versions, whereby
each improved version requires the previous one before it can be built (using Required module). So I want to make it so that you can't build a Battle Stations II before you have built a Battle Stations I.

However, when all techs are researched I can build a Battle Stations II, while I have not
yet built Battle Stations I! I can't however build a Defense Systems II without having built Defense Systems I (like it should be). I created these modules in exactly the same way, what's causing the difference??

I hope someone can help me out here.
6,239 views 6 replies
Reply #1 Top
Are you using Tech_Requirement or Module_Requirement?
Reply #2 Top
I am using both Tech_Requirements and Module_Requirements.

So my Battle Stations module requires only the Space Weapons Tech,
but Battle Stations II requires the Space Weapons Tech and the Battle Stations module.

Despite these requirements, in Battle Of The Gods both the Battle Stations and the Battle Stations II module show up in the available modules list at the same time.

In the same way I created Defense Systems modules, however they seem to function normally.

I've been checking and changing endlessly the module Inner_names, the Techs_Requirements and Module_Requirements, but to no avail.

Now I'm thinking about it, I've seen empty Module_Requirement fields, but I deleted them, because I thought you didn't have to include fields if you don't use them. I might re-include them (for instance for the Battle Stations module) to see if that makes a difference..
Reply #3 Top
Try it in a sandbox game and see if it works the same way.

Doesn't 'Battle of the Gods' give you all techs to begin with?
It may give all modules as well.
Reply #4 Top
I have only tried it in sandbox games. It is correct that 'Battle of the Gods' gives you all the techs. I also tried it in a normal sandbox game, but with cheats enabled to research the techs one by one and I got the same result.

When I have time (during the weekend) I think I'll just make two brand new modules named testblah I and testblah II or something, and if that works rename them to Battle Stations. I might have overlooked some tiny detail. The strange thing is that it does seem to work with my Defense Systems modules whereby the main difference is that it is a Starbase Defense whereas the Battle Stations are Starbase Attack modules, but that seems irrelevant.

It's driving me nuts! I thought I could just redesign the starbase fortification in a couple of hours, but this is taking me much longer. But in the end it will be worth it. I have redesigned the system to use 15 instead of 28 fortification modules which are in the end much stronger than the old ones. There are five new modules and a new Tech at the end of the Fortification branch. Although balancing is hard, because the relative strenght of the modules depends on the players galaxy settings (the modules don't scale) this mod will allow players to create powerful starbases at a cost, but with less micromanagement.
Reply #5 Top
By exhaustive trial and error I discovered that the order of definitions in the xml file created the problem. The first fortification module cannot be the first definition in the xml file or its successor is also immediately available in the game.
If you take a look at the original xml file you can see that it starts with advanced fortification definitions instead of the Battle Stations module, thereby evading the problem.

Reply #6 Top
One other problem, which I think has been mentioned before, is that the sum of the Starbase attack and defense values is incorrect on the main screen. Can I do something about it? What are the true attack and defense values, the numbers on the main screen or the numbers (as I defined them) on the Starbase overview screen?