Can we edit mod, build, mid-game without quitting and then reactivating the mod?

g02703

Chieftain
Joined
Apr 2, 2016
Messages
33
As far as I know, any changes we make in ModBuddy, both the LUA and the XML are not going to be reflected in the on-going game test.

So, in the middle of testing my mod, I realize I need to change something (like text) or add a new graphical asset (like an icon atlas). I make the changes, then I clean the project (which automatically removes the mod), quit the current game test, go back to main menu, build/rebuild the project, re-enable the mod, then start a new game (which takes so long). I am thinking that there has got to be a better and more efficient workflow than I just described - maybe my workflow has unnecessary steps, so what do I need to do?

Looking at the modinfo file, it seems like the code there tells the game what assets to load and how to interpret them, which can only happen when you activate that mod.

But when that modinfo file already let the game be aware of a lua script, I figure that we should be able to edit the lua script, build our mod (which I believe copies the lua script to where the game reads it from), and see the changes immediately without quitting and restarting another game. After all, lua scripts have a content type of OnGameUIAddin, which to me sounds like a runtime thing, not compile time.

Can more experienced modders shed some light on their actual development workflow? I only guessed on mine - it works, but it's way too tedious and time-consuming, and I hope there's a better way.
 
@G I had the same issue, make a minor change which only appears way down the tech tree and you have to play half a game just to test it.

So I developed a mod for that reason (Developer Test Mod)
https://steamcommunity.com/sharedfiles/filedetails/?id=649317504

What it allows you to do is buy a Build a building in 1 turn(start of game) which grants you 1000+ science, I also have a building which grants you 1000+ energy. With these two buildings I can walk to almost any part of the tech tree in 3-4 turns.

It also has a Spacecraft which gives you retro thruster so you can better adjust your drops.

Things I still want to add,
  • building which boosts production (mainly for workers) as they need to build improvements which I have to wait for.
  • Technology with a super high cost (no affinity) so I can basically eat up those research points

Some other thoughts while writing this, would be a building to reset (or consume) the 1000+ science to bring it back to normal so you can test things at a normal pace after getting to the tech you want.

Problem is with the slow build time of worker (as it is) once you reach a tech, you then need to spend 10 turns building some things, which with 1000+ science means you have to keep advancing the tech tree. That is what the new tech would be for, so you can just set it to this tech, which would take forever even at 1000+ per turn.
 
@Syrkres - that's a good mod to know about, and I plan to check it out.

I would use this mod, though, to earn enough energy and technology as soon as possible to be able to build a Command Center (in Communication) - because I may want to test a script that would award the civilization some culture amount equal to 3 * total current global health if current global health > 0, upon building a Command Center. While this mod will get me there quickly, I will still need to restart a game, rebuild the mod, and then reactivate the mod to see the changes I have made in a piece of lua code. (I don't think there is such a property in PlayerPerks or related table that lets me do the culture award as described above). I'm trying to avoid restarting just to test changes made on lua code.
 
Mod files are only loaded into the database when a new game is started (or when a saved game is loaded), so it's not possible to load in new scripts or make changes to existing scripts during the game. There's no way around rebuilding and restarting.

I generally work on other stuff parallel to testing/fixing scripts which lowers the overall downtime but that does of course require some multitasking that not everyone is willing to endure.
 
Back
Top Bottom