Production from kills

Finium

Chieftain
Joined
Aug 8, 2012
Messages
1
First of all, I have never modded before.

However, I like to think I am clever, so I decided to have a go at the modding business. In honor of my nerdly pleasure--Star Trek--I decided that I would try to build a Borg sponsor for BE. I took a look at several other sponsor/leader mods and built the foundation (i.e. it now says Borg instead of PAC etc), which is not all together too interesting.

If you are not familiar with the Borg, they are a cybernetic race that assimilates technological and biological matter into a hive mind. The application of this would be to generate production whenever the Borg destroy an enemy unit, much like absorbing the tech/bio material into the collective to create new drones etc. I presumed that this would probably scale over time, maxing out at ten or so production per kill and staring at one or two.

I know that it is possible for kills to generate culture and I know that workers can generate one-time production boosts from chopping down forests, so I have presumed that there is fact a way to produce production from kills. The trouble is, having glanced amateurishly at the code, I am no closer to creating a solution to this conundrum.

Thus I am here at the Civ Guru temple, where I hope to gain some insights.
 
I'm no expert as i just started modding myself about a week ago and don't have much to show for it yet. But what i think your looking for is something along the lines of this.

Code:
function OnUnitDestroyed( playerID, unitID )
    if( playerID == Game.GetActivePlayer() ) then
        RequestYieldDisplay();
    end
end
Events.SerialEventUnitDestroyed.Add( OnUnitDestroyed );

that was copied and doesn't add any production, it's just registering a function to be called when the unit has been killed. You'll need to dig through the existing LUA files and find the rest of what you need. That would replace the guts of the function.

An easy way to dig through it is to go download Sublime Text, it's a free text editor. Once you get it installed then go to the projects menu item and select "add folder to project" then select the Civ BE lua folder normally something along the lines of SteamLibrary\SteamApps\common\Sid Meier's Civilization Beyond Earth\assets and then click ok. the left menu will populate with all the files and folders from that directory. The press Shift + Control + F and enter something like "Production" and click find. it will search the entire directory you've added and all it's children for any use of the word production. Just don't EVER click the "replace" button and if you happen too don't save anything just close sublime and click no to all the "do you want to save" messages lol

Sorry i can't be more help, but again i'm still fumbling my way through myself. Good luck with the borg.
 
Back
Top Bottom