Question About Modtools

tman2000

Prince
Joined
Feb 11, 2025
Messages
480
When people talk about Firaxis eventually releasing modtools, do they mean things like the script tuner and so forth? And, is a script tuner the type of thing where you can unpack game events live to see what scripts are handling them and what database entries are affected? Am I correct in thinking that it's almost impossible to deeply modify the game right now since we aren't aware of how certain game events are handled, but if we somehow did know, then we could still modify them just with JS, lua and XML today? So, are people waiting for modtools so we can have visibility into the game scripts? Am I understanding all this correctly?

For instance, I'd like to make a civ that only has one settlement, but commanders will have an option when they are on top of an independent power to convert it into a settlement by disappearing, and in the settlement production menu there's a button for the commander to vacate the settlement, where it would revert to a friendly city-state and the commander would reappear. If I knew what scripts and database entries handled the conversion of independent powers into a friendly city-state, I could write a script to implement this feature by controlling these events through added UI functionality? Or is there somewhere deeper in the game code where this happens where I'd be unlikely to be able to modify it?

And, is there transparency on this kind of thing now, even without modtools? Would it be a brute force review of game scripts, and how do I access them to read? Where are they located?
 
ModTools will probably look a lot like what we have now in ModBuddy and Asset Editor for Civ VI. Which is nothing to do with the underlying game engine, and more about packaging and importing new 3d assets for custom leaders/civs/units.

There are definite limits on what we can do right now, we are basically limited by the existing Modifier and GameEffects system for database modding, and the API the JavaScript side uses to communicate with the engine.

It would seem likely we are always limited by that system, and as we don’t have (and are likely never to have) documentation on the API, we can only really ape the methods Firaxis are using in their own JavaScript files.

Rather intentionally, a lot of the underlying engine code is compiled, meaning it is not readable by a human. This is partly so people don’t pirate the game, and partly so people can’t make a mod that installs a keylogger in your computer or other nastiness.

The source (human readable) code for Civ V was released, so it’s possible they will release it for VII, but I wouldn’t bet on it, they didn’t for Civ VI, and there has been speculation it was due in part to having proprietary software from third parties handling Lua (HavokScript).

As the new game uses a third party JavaScript software framework for UI, called Coherent, it is likely the case again.

Some excellent work was done by WildW to look at and reverse engineer a human-readable form of the Civ VI engine code, but it’s 10x harder to understand than normal human readable code, so any progress is very slow. As well as this, it relied on Firaxis accidentally posting a set of keys that allowed mapping that compiled code to a sort of human readable form
 
Your mod idea is very ambitious and cool! There are some elements I could see being very possible from my experience in VI and VII. For example having an extra button for a certain civ to convert that settlement to a commander, that would be possible. You would probably have to do it by having a JavaScript store all the information on the city, and all the information on the commander, and delete the city and make the commander, then assign it the information like the promotions the commander has. And the other way around for converting the commander to a city.

There are some concerns though, such as I am not sure if it is possible to place a city using JS scripting (but I haven’t looked at it).

I am also not sure if it is possible to bring back a civ after it has died, which removing the IP city would do. You can look into city transferring, there should be some kind of API for it, as it happens in peace deals.

You also might need to ban AI from playing it, or become an AI expert, because they will not know what’s going on I suspect
 
I am also not sure if it is possible to bring back a civ after it has died, which removing the IP city would do. You can look into city transferring, there should be some kind of API for it, as it happens in peace deals.

You also might need to ban AI from playing it, or become an AI expert, because they will not know what’s going on I suspect
It's for a "Medes" civilization where you only have one city and go around becoming suzerain of city states by conquering them. But, with the caveat that you can inhabit the IPs with a commander to get a free city, but which you can give up to go use your commander.

Anyway it's a good case study for modding. Civ VII has some event which converts an IP into a city-state. There are events which spawn IPs. An event which raizes a city. So, why couldn't I: raize my city, spawn an IP, trigger a city-state conversion as a way to convert back from a settlement to a city-state? I just need to know how to tell Civ 7 to do those events and provide parameters (although ideally it retains its improvements, I mean, when IP conquers a player city it gets raized but exists as a city state for a few turns in the process and the game is keeping track that it's owned by a power which might have a second settlement).

I'm guessing though that these features are hidden behind a wall of some kind.

Like, isn't there a difference between the game engine and gameplay cause-consequence tree scripts that modify database entries? The only core element should be a settlement object with name, improvements list, trade node status, etc.

I was hoping there were a bunch of scripts you could unpack that govern these events, not necessarily the engine itself which is rendering and so forth.
 
you can use civ6 firetuner with civ7, but it's still limited, the tools should allow to compile mods directly (currently one need to write its own modinfo) ,should open access to 3D assets, and should give a civ7 version of the tuner.

Note there are no confirmation from Firaxis for all of this, just a mention that modding should be quite similar to civ6.

For the tuner and exposed functions, see:

Scripting Runtime Information

How to connect civ6 Live Tuner to civ7 (and launch an Autoplay game)
 
you can use civ6 firetuner with civ7, but it's still limited, the tools should allow to compile mods directly (currently one need to write its own modinfo) ,should open access to 3D assets, and should give a civ7 version of the tuner.

Note there are no confirmation from Firaxis for all of this, just a mention that modding should be quite similar to civ6.

For the tuner and exposed functions, see:

Scripting Runtime Information

How to connect civ6 Live Tuner to civ7 (and launch an Autoplay game)
Thanks.

One thing I want to do is modify town specializations. People have modded the UI in ways where there has to be a game file that will specify where town specialization is being handled. I'll check out the firetuner, and I'm also looking into mods others have done to see what they're interacting with.
 
A bit off topic but...
It would seem likely we are always limited by that system, and as we don’t have (and are likely never to have) documentation on the API, we can only really ape the methods Firaxis are using in their own JavaScript files.
I don't really know anything about embedding javascript. I assumed the mysterious and important globals not defined by any *.js file, like engine, were injected into the namespace by the binaries. Are you saying those are actually defined in compiled JavaScript files? Either way they could provide a class definition for those objects even if they stripped all the code from it. It makes no practical difference, but it does imply some things about implementation.

Back on topic, I believe the Roman unique commander can found cities. So it's certainly possible.
 
Back
Top Bottom