Covert Ops Chance/difficulty

lilgamefreek

Warlord
Joined
Oct 30, 2014
Messages
229
I need some guidance. I'm relatively new to civ modding. I've grasped the .XML and SQL structures for adding to the game's databases fairly quickly, but I'm a little more confused about LUA.

The requirements I'm looking to satisfy is to modify covert ops stats, dependent on the faction the op is against. I'm trying to make certain factions inherently weak/resistant to covertops against them. It can be through modifying the difficulty of the ops, the success rate or effective rank of the spy, how many turns the op takes to complete, I don't particularly mind.

I wanna start small and have this apply only to a single faction for now. Once I get my bearings with the language, I'll can look into it more. I'm wondering whether there are any decent examples of operations like this from Civ5 mods, or what's like a good first step? What would be most helpful is understanding how to surface the information I want to modify, namely which cities covert agents are in, and the statistics of their current operation.


Haha, holy . I found the CovertOperationsSystem.lua, so things are WAAAAY more clear to me now. I can ask far more precise questions, namely how does a mod go about modifying the code that is in the source files? For example, say I wanted to have "function GetOperationTurns(playerID, agentIndex, operationType)" modified to perform a few more checks and modifications before returning the number of turns for the operation, what's the best way to go about that?

Okay, so I've looked around at some examples and good practices. It seems like overwriting the game's Lua's, while not ideal, is acceptable enough that people do it. I've gone in and coded my function and tested it for correctness, but I've done so directly in the original file (I made a copy first). How do I format .MODINFO file so that the game uses my modified CovertOperationsSystem.lua rather than it's own?

Any help would be overwhelmingly appreciated!


Nevermind it all. I found figured it out! Hoping progress keeps going strong and I'm able to show off my work in a bit!
 
Top Bottom