Extra Pillage Mod (BTS 3.19)

stolenrays

Deity
Joined
Aug 2, 2009
Messages
2,061
Extra Pillage Mod v1.6 (BTS 3.19)

This mod was created by isolating the source code of Extra Pillage Code from Dom Pedro II's Conquerer's Delight Mod. This mod only includes Extra Pillage Snippets and none of the other features in that mod. I have updated the code so it is now compatible with BTS 3.19.

From old thread:

This mod adds several new features to pillaging improvements:
  1. Pillaged gold is now modified by the bonus underneath it if the pillaged improvement connected that bonus.
  2. Yields from a pillaged improvement are now sent to the nearest friendly city.
  3. Pillaged improvements now have a commerce value that is given to the pillaging player.
  4. Some pillaged improvements (such as Forts) have a chance of giving a map of some surrounding enemy territory.

----Details----
Spoiler :

  1. Pillaged improvements with a yield amount (excluding Commerce) give the total amount of yield from the tile if the improvement gives any bonus to that yield.
  2. Pillaged yields do not vary, and they are not modified by any other factors.
  3. Pillaged gold is factored separately from the other commerces.
  4. pillaged commerces are randomly selected.
  5. If you set a positive value for gold in the PillageCommerces you will have a random chance of getting additional gold.
  6. Improvements that can give research will give research points towards a random tech owned by the pillaged player. If there are no available techs, you will be prompted that there was nothing of value to be pillaged from the tile.
  7. Culture is determined by the friendly city and enemy city closest to the pillaged plot. Example: a Roman unit pillages a Village around Paris. The culture goes back to Ravenna. Paris has a high culture level while Ravenna a very low culture level, so Ravenna will get more than the base culture. If, on the other hand, a French unit pillaged a Village around Ravenna, they'd get less than the base culture.
  8. Espionage acquired goes immediately toward the owner of the tile that you have just pillaged.
  9. pillaging will be more profitable for the weaker player than the stronger player to avoid a situation where the rich get richer and the poor get poorer.
---XML Additions---
Spoiler :

CIV4TraitInfos.xml
PillageCommerceModifiers - This increases the total amount of commerce a player could get from an improvement.

CIV4BonusInfos.xml
iPillageGoldModifier - This modifies the amount of pillaged gold. Note: This does not affect potential extra gold

CIV4CultureLevelInfos.xml
iPillageCultureModifier - This modifier helps determine the total amount of culture a city can get from a pillaged tile. The higher the culture level of the receiving city, the less culture the city gets from the improvement.

CIV4HandicapInfos.xml
iPillageCommercePercent - Modifies the amount of commerce an improvement can give.
iAIPillageCommercePercent - Modifies the amount of commerce an AI civ will get.

CIV4WorldInfos.xml
iPillageCommercePercent - Modifies the amount of commerce an improvement can give.

CIV4GameSpeedInfo.xml
iPillageCommercePercent - Modifies the amount of commerce an improvement can give.

CIV4EraInfos.xml
iPillageCommercePercent - Modifies the amount of commerce an improvement can give in the current (not based on the STARTING ERA of the game as some values in this file are).

CIV4ImprovementInfos.xml
iPillageMapProb - probability of getting a map from the improvement. A value of 100 gives 100% chance.
iPillageMapRange - range of the revealed map.
PillageCommerces - Base amount of commerce given by the improvement.


--Pillaging Bonuses--
PIllaging improvements now gives you :espionage: pts, :gold:, :food:, :science:, and/or :hammers: instantly.

-----Note to Modmakers-----
Changed SDK files are included in the download.
In the SDK files DPII has added// < EXTRAPILLAGE DPII > and
in all of the places tha the have made changes to the original files.

Thanks to: DPII, & Lib Spi't for fixes.
-----Version History-----

Spoiler :
Version 1.6
-Added PillageYieldModifier & PillageYieldPercent variable to traits, Handicap, Worldsize, Era, etc.
-Added Concept Info
-Added Changelog & Readme Texts

Version 1.5
-bulleted civic effects
-player option texts
-gametext for bonus/improvement effects
Version 1.4
-adds missing TXT_KEY_CIVIC_NO_PILLAGE_REWARD
Version 1.3
-Extra Pillaging gametext effects onlydisplay with the playeroption (traits, etc.)
-Removed Worker Code from the SDK/XML
-Added in Text for Civic Modifier for Capital Receives Pillage (Thanks Lib Spi't)
-Fixed Goody Hut text error
-Checked against Test of Time for any updates
-Added missing GlobalDefines Entries
-Removed uneeded GlobalDefines Entries
-Removed uneeded Text entries
-Removed uneeded xml/sdk files
Version 1.2
-Removed Partisans Code from the SDK/XML
-Added a playeroption
Version 1.1
-Re-release for BTS 3.19
Version 1.0
-DPII"s original version


Extra Pillage Mod Original Thread

Download
 

Attachments

  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    182.8 KB · Views: 228
  • Civ4ScreenShot0006.JPG
    Civ4ScreenShot0006.JPG
    171.4 KB · Views: 192
It is hardcoded into the SDK so the regular benefits are applicable to all leaders. The traits could be modified in the xml to get what you want though.

I suppose if this modcomp was only in python, you could do what you are asking, but I rarely code with python.
 
hey mate, I don't know if you will be able to help or not, but I think I am having an issue compiling this comp with other ones, the error references two of your bits of code, but I can't figure out what is wrong or why.

These are the error messages.
Spoiler :
1>CvUnit.obj : error LNK2019: unresolved external symbol "public: int __thiscall CvPlayerAI::AI_getEnemyPlotStrength(class CvPlot *,int,bool,bool)const " (?AI_getEnemyPlotStrength@CvPlayerAI@@QBEHPAVCvPlot@@H_N1@Z) referenced in function "public: bool __thiscall CvUnit::pillage(void)" (?pillage@CvUnit@@QAE_NXZ)
1>CvUnit.obj : error LNK2019: unresolved external symbol "public: int __thiscall CvPlayerAI::AI_getOurPlotStrength(class CvPlot *,int,bool,bool)const " (?AI_getOurPlotStrength@CvPlayerAI@@QBEHPAVCvPlot@@H_N1@Z) referenced in function "public: bool __thiscall CvUnit::pillage(void)" (?pillage@CvUnit@@QAE_NXZ)
1>Release\CvGameCoreDLL.dll : fatal error LNK1120: 2 unresolved externals


I have tried doing searches in the files to try and track down the issues with no success yet, was just wondering if might be able to shed some light?

Cheers :)
 
You forgot to merge something somewhere. I usu search in Visual C++ with find in files for the comment with the modcomp and then the merged version. I look at the number of times it is found to narrow it down.
 
hmmmm it says I have 128 hits in both... could it be an assets thing? so not in the sdk part?

AHA!

in the assets I have 113 in 14 files against 161 in 15 files....now which is the 15th file...

hmmmmm.... no that was a bust... the 15th file was Bonusinfos.xml and I had just forgotten to copy the mod comp notes..

could the improvementinfos.xml cause this issue? that is the only other place I am seeing an inconsistency, but I think that is because I do not have as many improvements as native...

do you have any ideas as to what files might be calling these references in your sdk... I am resorting to looking through each hit and checking to see if it each hit has the same number of lines between it and the next as your version...but that is going to be really hard... if I could narrow it down to a few less files that would be great..
 
I have been revising the code and I see things like partisans, conscripts and draft (?)

Are these things supposed to be there or you didn't delete their references? I don't seem to see any unit info. I don't think the have any use at all in the dll.
 
I think they are from his partisan mod, hwether they are meant to be there or not I don't know

it would be nice to know though because I think it is 2 lines of code in one of these partisan parts that are causing a merge problem for me, because they refer to something from vanilla that was replaced by something new in kmod.
 
Maybe he plans to do something with it (?)

Partisans have some relation with pillage with CvPlayer.cpp for ex., but those functions should be unused since there are no partisans units at all in this mod.
 
1>CvUnit.cpp
1>CvUnit.cpp(4884) : warning C4101: 'iK' : unreferenced local variable
1>CvUnit.cpp(4884) : warning C4101: 'iJ' : unreferenced local variable

any idea what these are/how they work, etc

I know they are part of your pillage code, I have gone through and deleted all reference to the partisans, but i still get this warning when I compile...

Any helpful thoughts?
 
Something is missing. Maybe int iJ; should be somewhere at the begining of a function? If it is just the pillage mod you are looking at and you deleted the partisan stuff, I'd look to see if iJ/iK is in there anywhere and try and ad it back in.

In addition, try out the mod if you compile successfully. When I did the same, the map feature would not trigger.
 
yeah when I compile the .dll, when i run the game i get a bunch of xml errors, and all units and promotions are gone, and when I start a new game it CTD's, presumably because there are no units for the mapscript to use...

see here for more info on the errors if you would be willing to have a look and see if you can draw out anymore ideas or solutions for what I might try as a next step....

thanks in advance :)
 
Top Bottom