How to build a Mod Mod in detail?

Rifler

Chieftain
Joined
Dec 13, 2009
Messages
54
Location
Germany
Good Morning folks,

my modpack is progressing. I'm at the point were I want to divide the edited files from the CBP build, and make the project dependend on CBP/CPP. Everything is working fine, except .lua's. It appears I can't manage to override .lua's from the mother project inside my customized modpack. Trying so renders the game broken. The problem with that is, right now I can release my mod package in combination with CBP only, so I have to release any single CBP file with my package. An alternative option would be to simply release the modified files, but then I can't upload it on the Workshop, because there is not an option to replace files inside a Mod with my own files.

So what I want to ask here, is it even possible to edit .lua's from "mother" mods and put them inside my own package. I'm also editing .xml's and .sql's. I'm refering to this post of whoward69...

http://forums.civfanatics.com/threa...t-vfs-ingameuiaddin-or-updatedatabase.487846/

...but this isn't the source of my problems I feel.
 
Sounds like you're not using Associations (a tab in the same menu where you add mod files).

Set the main mod as a Dependency, that way the main mod is guaranteed be loaded first, and then your mod-mod, properly overriding the files added by the main mod.
 
I do use associations, that's not the problem. It's specifically related to the edited .lua's I think. Usually you'd include in a .lua which other .lua scripts they should adress, but without the adressed .lua script, the adress will run into empty. Applying true to VFS is done as well.
 
Every InGameUIAddin lua is its own context. And for lua-scripts that are not replacers for standard game files (such as UnitPanel.lua) there's really no method for you to alter the original script in lua file "Cheeseburgers.lua" if "Cheeseburgers.lua" is set to run as its own InGameUIAddin as like this
Code:
  <EntryPoints>
    <EntryPoint type="InGameUIAddin" file="Cheeseburgers.lua">
      <Name>Cheeseburgers</Name>
      <Description>Cheeseburgers</Description>
    </EntryPoint>
 </EntryPoints>
Regardless of Dependancies and References, even if two mods both have a file called Cheeseburgers.lua, the second mod to load will not "wipe" the code within the 1st mod's "Cheeseburgers.lua".

ImportIntoVFS will not affect this.

--------------------------------------

Mutliple mods all loading a file called "Cheeseburgers.lua" into the VFS system it does not seem to follow (as you would expect) that the last mod to load will always in all cases be the one whose "Cheeseburgers.lua" gets used. I have not experienced this myself but other forum members have reported it. This last issue is aside from the issues involved with using
Code:
include("Cheeseburgers.lua")
within your main lua script when there are multiple different versions of "Cheeseburgers.lua" floating around the Civ5-ModUniverse, or where there are versions called "MyCheeseburgers.lua", "JONS_Cheeseburgers.lua", and "HenryCheeseburgers.lua".
 
Thank you for your exact expression of what I'm trying to do, it was hard for me to describe it in detail.

So in return this means there is absolutely no way to edit .lua's from a mother mod and use them in a mod mod? I couldn't even copy those edited lua's into the original CBP? Like, divide the package into two parts, the one with my own files, and one with the files editeed inside CBP. How would you release something like this on the Workshop?

There has to be another way, I can't upload TTBC inside the complete CBP package. This is copyright infriction per excellence plus I'd upload tons of files I do not even need for my modifications.
 
About the only thing you can do is make your altered version of file "XYZ.lua" and add it to your ModMod in Modbuddy, but give the file no actions or settings. Then you have to give instructions that users of your mod will have to copy file "XYZ.lua" from your mod and paste it over the existing file in the CBP mod.

Not optimum, but doable.

Otherwise you'd have to figure out what file "XYZ.lua" in the CBP mod does and make your mod's lua exactly cancel the effect you do not like. So for a PlayerDoTurn event in CBP, "XYZ.lua" might alter a player's culture by "X" amount depending on data taken from the game, and then your mod would have an lua script which would exactly cancel this change made by CBP. Otherwise I can't think of a good way to attempt such a thing.
 
Back
Top Bottom