Great Diplomat Mod (BTS 3.19)

stolenrays

Deity
Joined
Aug 2, 2009
Messages
2,061
This is a BTS 3.19 update for the Great Diplomat Mod. I've cleaned up and removed the unnecessary python code that were resulting in exceptions and automatically giving the plague mission to Great Doctor's when merging with that mod. I've replaced the python code with C++ code.

-------New Units-------
Great Diplomat
-Embark on a Diplomatic Mission (+4 attitude with an opposing civilization)
-Attach Himself to a City
-Discover a Military Related Technology
-Start a Golden Age
-Assimilate a Barbarian City
-Great Diplomat is Invisible
-Force Peace with a Civilization
-Upgrade Improvements
-Bribe Any Barbarian Stack to go home

Envoy/Modern Envoy
-2:move:
-50:hammers:, available at Optics
-National Unit (2 Allowed)
-Can Investigate Cities
-Can Bribe Government Officials (Vanilla ‘Steal Plans’ mission aesthetically altered)
-Requires open borders and are not invisible.

Specialists:
-Lawyer: +2:commerce:, +1:espionage:, +3:gp: Great Statesman Points
-Great Diplomat: +4:commerce:, +3:espionage:

----Gameplay Changes-----

  • -United Nations: Diplomat:gp: instead of Merchant:gp:
    -Versailles: Diplomat:gp: instead of Artist:gp:
    -Itza: Diplomat:gp: instead of Prophet:gp:
    -Courthouse: Allows 1 Lawyer Specialist (in addition to the current Spy)
    -Jail: Allows 2 Lawyer Specialists (replacing the current Spies – I always felt 7 total spies weren’t needed considering Democracy is right next to Constitution)
    -Castle: Allows 1 Lawyer Specialist
    -Customs House: Allows 1 Lawyer Specialist
    -Democracy: First to discover receives a free Great Diplomat

    -----Credits:-----
    -Great Diplomat 3.13: Tsentom 1
    -Great Diplomat Model: Not sure, from ‘The Road to War’ mod
    -Envoy Model: Not sure, from ‘Crossroads of the World’ mod
    -Modern Envoy Model: Mozza
    -Diplomat Icons & Names: TheLopez
    -Specialist Stacker: TheLopez
    -Total War: jojoweb for the assimilate barbarian city, upgrade improvements, and force peace missions.

    ----For Modmakers-------
    Additions are commented with Great Diplomat

    -----Version History-----
    Spoiler :

    Version 1.4
    -Button for Bribe Barbarian Unit Mission

    Version 1.3
    -Bribe A Barbairan Unit to Leave Mission (Can even Bribe a stack simulating the Pope's mission vs. the Huns)
    -Small text/Pedia fixes

    Version 1.2
    -Assimilate Barbarian Cities from Total War
    -Great Diplomat is Invisible
    -Force Peace mission from Total War

    Version 1.1
    -Add in Diplomat/Envoy Help text
    -New Diplomat/Envoy Buttons
    -Revert Steal Plans button
    -Moved Missions to the DLL
    -Removed unneeded art
    -Fixed unneeded art
    -Removed Globaldefines, Python Callback.xml, GlobalTypes.xml, MIssionInfos.xml files
    -Exec limits reinstated
    -Removed unneeded entries from EffectsInfos.xml
    -Fixed text/entries for SpecialistInfos, UnitInfos, Text.xml
    -Social Reform from Total War
    -Bulleted auto info for steal plans and investigate city
    -Bullet unit info for new missions (Goodwill/Social Reform).
    -Removed uneeded python


    Download
 

Attachments

  • civ4screenshot0024_O78_thumb.jpg
    civ4screenshot0024_O78_thumb.jpg
    3.5 KB · Views: 2,015
  • civ4screenshot24_yDR_thumb.jpg
    civ4screenshot24_yDR_thumb.jpg
    3.5 KB · Views: 508
  • civ4screenshot_Tf1_thumb.jpg
    civ4screenshot_Tf1_thumb.jpg
    3 KB · Views: 2,013
I'd like to merge this with another mod, so is the python marked so its easy to mod?
 
I'd like to merge this with another mod, so is the python marked so its easy to mod?

Yes, that is part of the reason I updated it. To make it easy to merge. All added parts are now commented with Great Diplomat, but before they all weren't.
 
I'm getting two python errors from the eventmanager.

Code:
				if playerStateReligion == CvUtil.findInfoTypeNum(gc.getReligionInfo, gc.getNumReligionInfos(), "RELIGION_CONFUCIANISM"):
					for iOpponent in lPlayers:
						if iOpponent.getID() != iPlayer:
							iAttitude = player.AI_getAttitude( iOpponent.getID() )
							if iAttitude == AttitudeTypes.ATTITUDE_FRIENDLY:
								if self.getRandomNumber( 15 ) == 0:
									self.doAITargetOpponentMeteor( iOpponent.getID(), iPlayer )
									unit.kill( 0, unit.getOwner())
							if iAttitude == AttitudeTypes.ATTITUDE_PLEASED:
								if self.getRandomNumber( 5 ) == 0:
									unit.kill( 0, unit.getOwner())

Both errors point to the unit.kill line. Not sure what is going wrong or how to fix it.
Lines 1753 and 1777 of my eventmanager throw up python exceptions.
 

Attachments

  • CvEventManager.7z
    14 KB · Views: 65
I'm moving this mod to sdk. Social reform is in Total War. I just made a new mission for improving relations called GOODWILL.

It compiles fine, and looks good, but the game CTD when seting up the map. I figure that has something to do of the order of where I modded in my new mission, but can't find the error.

I was hoping somebody with more experience modding mission can take a look at my work and help out. Thanks.
 

Attachments

  • Great Diplomat.7z
    1.8 MB · Views: 66
I think I figured out the python error. Anyway, I've worked on it and removed much of the uneeded code including from Gods of Old/Inquisitor. There were even religion checks in there for no reason at all. I'll have to clean up the other files as well before I release it.
 
Would it be possible to cap the relation benefit at plus four or a region of diplomatic failure? It seems obsessive to be able to be a warmonger and spam any opposing country with diplomats until you're friendly.
 
Just updated to v1.1:

Version 1.1
-Added Diplomat/Envoy Help text
-New Diplomat/Envoy Buttons
-Moved Missions to the DLL
-Remove/fixed uneeded art
-Removed GLobaldefines, Python Callback.xml, GlobalTypes.xml, MIssionINfos.xml files
-Exec limits reinstated
-Removed unneed entries from EffectsInfos.xml
-Fixed text/entries for SpecialistInfos, UnitInfos, Text.xml
-Social Reform from Total War
-Modified Social Reform Mission Help Text
-Bulleted Unit info text for steal plans and investigate city
-Bullet unit info for new missions (Goodwill/Social Reform).
-Removed Python Code
-Specialists revised
-GlobalDefine Integers for Social Reform Population Modifier & Goodwill Attitude Change
 
I've finished the mod now with one small bug left. When you receive a popup to force peace with a civ, all you view is the text entry TXT_KEY_**_DESC entry where ** is the name of the civ. Here is the C++ for debugging:


Spoiler :
Code:
bool CvDLLButtonPopup::launchUnitForcePeacePopup(CvPopup* pPopup, CvPopupInfo &info)
{
	PlayerTypes eActivePlayer = GC.getGameINLINE().getActivePlayer();
	CvUnit* pUnit = GET_PLAYER(eActivePlayer).getUnit(info.getData1());

	if (eActivePlayer == NO_PLAYER || !pUnit->canForcePeace())
	{
		return (false);
	}

	CvWString szBuffer;
	szBuffer = gDLL->getText("TXT_KEY_POPUP_CHOOSE_FORCE_PEACE_ENEMY_WITH");
	gDLL->getInterfaceIFace()->popupSetBodyString(pPopup, szBuffer);

	for (int iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).isAlive())
		{
			if (pUnit->canForcePeaceWith((PlayerTypes)iI))
			{			
				gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, [COLOR="Teal"]GET_PLAYER((PlayerTypes)iI).getCivilizationDescriptionKey()[/COLOR], GC.getCivilizationInfo(GET_PLAYER((PlayerTypes)iI).getCivilizationType()).getButton(), (int)iI, WIDGET_GENERAL);
			}
		}
	}

	gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_NEVER_MIND").c_str(), ARTFILEMGR.getInterfaceArtInfo("INTERFACE_BUTTONS_CANCEL")->getPath(), -1, WIDGET_GENERAL);

	gDLL->getInterfaceIFace()->popupLaunch(pPopup, false, POPUPSTATE_IMMEDIATE);

	return (true);
}
 
Stolenrays, I'm trying to merge your mod into Rise of Mankind - A New Dawn, but I'm getting a crash as soon as I start a new map; I've tried debugging it but it looks like some part of the code is missing; I can't get a value for that paiTemp variable. Do you have any advice? Thank you in advance. :)
 
I'll have to check out the code. I got no CTD whenplaying the game and trying the missions. Maybe it is a missing read/write value. I got the most recent mission code from my own creation and some from Total War. THe paiTemp variable is from Total war and can be a bit tricky as jojo's code nomenclature is a bit different.
 
Top Bottom