| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
The resources on this site have been incredibly helpful as I build my first mod. Thanks to everyone for their contributions!
I can't seem to find the answer to one pesky problem: My goal is a mod that has three "good" players and three "evil" players, with a bunch of players in between. The goal of the game is for all "good" or "evil" players to be wiped out. Ideally, the good and evil players would jockey for allies among the players in between, and the players who are neither good nor evil would be forced to eventually choose sides. Is this possible? I'm great with XML, but Python is out of my league, so if it is possible to do this as an XML mod, I'd really prefer that method. Thanks! Last edited by Aurelia; Jan 27, 2007 at 10:31 PM. Reason: typo |
|
|
|
|
|
#2 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
tbh - I think you would need to have a bit of python to achieve this, maybe find a python coder with a bit of spare time to write the code for you (I'll look into it, but I am still very new to coding myself, and have some other large projects I am currently working on).
Edit:I am assuming two things here, that you have warlords, and that you have an IMB Version, or that Mac Version is the same as IBM version in reguards to Python... I might have something good to go in a day or more - really depends on how problematic I find this... 2nd Edit:I have found out that you might also need to edit the SDK, if you can get this to compile yourself at least, I think I can tell you exactly what you will need to do (not sure yet, I am in the middle of compiling what I just done right now). In short the way I have gone about this is by adding a new tag to the civ4civilizationinfos.xml called <iFaction>0</iFaction> and another tag to the civ4victoryinfo.xml called <bFaction>0</bFaction> which is either 0 for no faction victory, or 1 for a faction victory, which you can then enter in a new victory conditon in the civ4victoryinfo.xml file that represents your faction win. To do this I had to do some very simple editing of the SDK to make Civ IV actually load the values, and to export them to Python, which will then check to see if there has been a faction win. I might be making this post early, since I havn't tested the theory yet, nor written the Python code to actually detect the win, just made the custom tags is all.(it just finished compiling so I am going to check and make sure I don't get any errors in the actual game now - bbl) Well it smurfed, so I'll try and figure out why, but if I don't manage it I think you will find the above method is the way you'll have to do it - maybe someone with a bit more exp in the SDK dept. might be able to suggest better... Here's a start of the edits I made that actually don't glitch the game, but also don't do anything yet except add a tag to the Civ4VictoryInfo.xml file.... The files that are being edited are XML CIV4VictoryInfo.xml CIV4GameInfoSchea.xml C++ SDK CvInfos.cpp CvInfos.h Find this code in CvInfos.h... Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // class : CvVictoryInfo // // DESC: // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Code:
public: DllExport CvVictoryInfo(); DllExport virtual ~CvVictoryInfo(); DllExport int getPopulationPercentLead() const; // Exposed to Python DllExport int getLandPercent() const; // Exposed to Python DllExport int getMinLandPercent() const; // Exposed to Python DllExport int getReligionPercent() const; // Exposed to Python DllExport int getCityCulture() const; // Exposed to Python DllExport int getNumCultureCities() const; // Exposed to Python DllExport int getTotalCultureRatio() const; // Exposed to Python DllExport bool isFaction() const; // Exposed to Python ** EDITED by TRN2 DllExport bool isTargetScore() const; // Exposed to Python DllExport bool isEndScore() const; // Exposed to Python DllExport bool isConquest() const; // Exposed to Python DllExport bool isDiploVote() const; // Exposed to Python DllExport bool isPermanent() const; // Exposed to Python DllExport const char* getMovie() const; DllExport bool read(CvXMLLoadUtility* pXML); Code:
protected: int m_iPopulationPercentLead; int m_iLandPercent; int m_iMinLandPercent; int m_iReligionPercent; int m_iCityCulture; int m_iNumCultureCities; int m_iTotalCultureRatio; bool m_bFaction; //EDITED by TRN2 bool m_bTargetScore; bool m_bEndScore; bool m_bConquest; bool m_bDiploVote; bool m_bPermanent; CvString m_szMovie; Code:
//------------------------------------------------------------------------------------------------------ // // FUNCTION: CvVictoryInfo() // // PURPOSE : Default constructor // //------------------------------------------------------------------------------------------------------ Code:
CvVictoryInfo::CvVictoryInfo() :
m_iPopulationPercentLead(0),
m_iLandPercent(0),
m_iMinLandPercent(0),
m_iReligionPercent(0),
m_iCityCulture(0),
m_iNumCultureCities(0),
m_iTotalCultureRatio(0),
m_bFaction(false), //EDITED by TRN2
m_bTargetScore(false),
m_bEndScore(false),
m_bConquest(false),
m_bDiploVote(false),
m_bPermanent(false)
{
}
Code:
int CvVictoryInfo::getNumCultureCities() const
{
return m_iNumCultureCities;
}
int CvVictoryInfo::getTotalCultureRatio() const
{
return m_iTotalCultureRatio;
}
bool CvVictoryInfo::isFaction() const //BEGIN EDIT by TRN2
{
return m_bFaction;
} //END EDIT by TRN2
bool CvVictoryInfo::isTargetScore() const
{
return m_bTargetScore;
}
bool CvVictoryInfo::isEndScore() const
{
return m_bEndScore;
}
Code:
bool CvVictoryInfo::read(CvXMLLoadUtility* pXML)
{
CvString szTextVal;
if (!CvInfoBase::read(pXML))
{
return false;
}
pXML->GetChildXmlValByName(&m_bFaction, "bFaction"); //EDITED by TRN2
pXML->GetChildXmlValByName(&m_bTargetScore, "bTargetScore");
pXML->GetChildXmlValByName(&m_bEndScore, "bEndScore");
pXML->GetChildXmlValByName(&m_bConquest, "bConquest");
pXML->GetChildXmlValByName(&m_bDiploVote, "bDiploVote");
pXML->GetChildXmlValByName(&m_bPermanent, "bPermanent");
CIV4GameInfoSchema.xml here... Code:
<ElementType name="HandicapInfos" content="eltOnly"> <element type="HandicapInfo" maxOccurs="*"/> </ElementType> <ElementType name="bFaction" content="textOnly" dt:type="boolean"/> <!-- EDITED HERE --> <ElementType name="bTargetScore" content="textOnly" dt:type="boolean"/> <ElementType name="bEndScore" content="textOnly" dt:type="boolean"/> <ElementType name="bConquest" content="textOnly" dt:type="boolean"/> <ElementType name="bDiploVote" content="textOnly" dt:type="boolean"/> <ElementType name="bPermanent" content="textOnly" dt:type="boolean"/> <ElementType name="iPopulationPercentLead" content="textOnly" dt:type="int"/> Code:
<ElementType name="VictoryInfo" content="eltOnly"> <element type="Type"/> <element type="Description"/> <element type="Civilopedia"/> <element type="bFaction" minOccurs="0"/> <!--EDITED HERE--> <element type="bTargetScore"/> <element type="bEndScore"/> <element type="bConquest"/> <element type="bDiploVote"/> <element type="bPermanent"/> <element type="iPopulationPercentLead"/> <element type="iLandPercent"/> <element type="iMinLandPercent"/> <element type="iReligionPercent"/> <element type="CityCulture"/> <element type="iNumCultureCities"/> <element type="iTotalCultureRatio"/> <element type="VictoryMovie"/> </ElementType> Code:
<VictoryInfo> <Type>VICTORY_FACTION</Type> <Description>TXT_KEY_VICTORY_FACTION</Description> <Civilopedia>TXT_KEY_VICTORY_FACTION_PEDIA</Civilopedia> <bFaction>1</bFaction> <!--The New TAG Goes Here--> <bTargetScore>0</bTargetScore> <bEndScore>0</bEndScore> <bConquest>0</bConquest> <bDiploVote>0</bDiploVote> <bPermanent>0</bPermanent> <iPopulationPercentLead>0</iPopulationPercentLead> <iLandPercent>0</iLandPercent> <iMinLandPercent>0</iMinLandPercent> <iReligionPercent>0</iReligionPercent> <CityCulture>NONE</CityCulture> <iNumCultureCities>0</iNumCultureCities> <iTotalCultureRatio>0</iTotalCultureRatio> <VictoryMovie></VictoryMovie> </VictoryInfo> Another thing you might do that I have not done is add a TXT_KEY entry or two into the Text subfolder for this victory condition, bbl with the CIV4Civilizations.XML when I have finished it, and got it to work without smurfing
Last edited by TRN2; Jan 31, 2007 at 09:35 AM. |
|
|
|
|
|
#3 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
Well I'm stumped...
Same two files from the SDK....
CvInfos.cpp CvInfos.h the edits that I am making are listed here... CvInfos.h Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// class : CvLeaderHeadInfo
//
// DESC:
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class CvArtInfoLeaderhead;
class CvLeaderHeadInfo :
public CvInfoBase
{
//---------------------------------------PUBLIC INTERFACE---------------------------------
public:
DllExport CvLeaderHeadInfo();
DllExport virtual ~CvLeaderHeadInfo();
DllExport int getFaction() const; //Faction Mod by TRN2&Impaler DllExport int getWonderConstructRand() const; // Exposed to Python
DllExport int getBaseAttitude() const; // Exposed to Python
DllExport int getBasePeaceWeight() const; // Exposed to Python
DllExport int getPeaceWeightRand() const; // Exposed to Python
DllExport int getWarmongerRespect() const; // Exposed to Python
DllExport int getRefuseToTalkWarThreshold() const; // Exposed to Python
DllExport int getNoTechTradeThreshold() const; // Exposed to Python
DllExport int getTechTradeKnownPercent() const; // Exposed to Python
DllExport int getMaxGoldTradePercent() const; // Exposed to Python
DllExport int getMaxGoldPerTurnTradePercent() const; // Exposed to Python
DllExport int getMaxWarRand() const; // Exposed to Python
DllExport int getMaxWarNearbyPowerRatio() const; // Exposed to Python
DllExport int getMaxWarDistantPowerRatio() const; // Exposed to Python
DllExport int getMaxWarMinAdjacentLandPercent() const; // Exposed to Python
DllExport int getLimitedWarRand() const; // Exposed to Python
DllExport int getLimitedWarPowerRatio() const; // Exposed to Python
DllExport int getDogpileWarRand() const; // Exposed to Python
DllExport int getMakePeaceRand() const; // Exposed to Python
DllExport int getDeclareWarTradeRand() const; // Exposed to Python
DllExport int getDemandRebukedSneakProb() const; // Exposed to Python
DllExport int getDemandRebukedWarProb() const; // Exposed to Python
DllExport int getRazeCityProb() const; // Exposed to Python
DllExport int getBuildUnitProb() const; // Exposed to Python
DllExport int getBaseAttackOddsChange() const; // Exposed to Python
DllExport int getAttackOddsChangeRand() const; // Exposed to Python
DllExport int getWorseRankDifferenceAttitudeChange() const; // Exposed to Python
DllExport int getBetterRankDifferenceAttitudeChange() const; // Exposed to Python
DllExport int getCloseBordersAttitudeChange() const; // Exposed to Python
DllExport int getLostWarAttitudeChange() const; // Exposed to Python
DllExport int getAtWarAttitudeDivisor() const; // Exposed to Python
DllExport int getAtWarAttitudeChangeLimit() const; // Exposed to Python
DllExport int getAtPeaceAttitudeDivisor() const; // Exposed to Python
DllExport int getAtPeaceAttitudeChangeLimit() const; // Exposed to Python
DllExport int getSameReligionAttitudeChange() const; // Exposed to Python
DllExport int getSameReligionAttitudeDivisor() const; // Exposed to Python
DllExport int getSameReligionAttitudeChangeLimit() const; // Exposed to Python
DllExport int getDifferentReligionAttitudeChange() const; // Exposed to Python
DllExport int getDifferentReligionAttitudeDivisor() const; // Exposed to Python
DllExport int getDifferentReligionAttitudeChangeLimit() const; // Exposed to Python
DllExport int getBonusTradeAttitudeDivisor() const; // Exposed to Python
DllExport int getBonusTradeAttitudeChangeLimit() const; // Exposed to Python
DllExport int getOpenBordersAttitudeDivisor() const; // Exposed to Python
DllExport int getOpenBordersAttitudeChangeLimit() const; // Exposed to Python
DllExport int getDefensivePactAttitudeDivisor() const; // Exposed to Python
DllExport int getDefensivePactAttitudeChangeLimit() const; // Exposed to Python
DllExport int getShareWarAttitudeChange() const; // Exposed to Python
DllExport int getShareWarAttitudeDivisor() const; // Exposed to Python
DllExport int getShareWarAttitudeChangeLimit() const; // Exposed to Python
DllExport int getFavoriteCivicAttitudeChange() const; // Exposed to Python
DllExport int getFavoriteCivicAttitudeDivisor() const; // Exposed to Python
DllExport int getFavoriteCivicAttitudeChangeLimit() const; // Exposed to Python
DllExport int getDemandTributeAttitudeThreshold() const; // Exposed to Python
DllExport int getNoGiveHelpAttitudeThreshold() const; // Exposed to Python
DllExport int getTechRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getStrategicBonusRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getHappinessBonusRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getHealthBonusRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getMapRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getDeclareWarRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getDeclareWarThemRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getStopTradingRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getStopTradingThemRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getAdoptCivicRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getConvertReligionRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getOpenBordersRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getDefensivePactRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getPermanentAllianceRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getVassalRefuseAttitudeThreshold() const; // Exposed to Python
DllExport int getVassalPowerModifier() const; // Exposed to Python
DllExport int getFavoriteCivic() const; // Exposed to Python
DllExport const TCHAR* getArtDefineTag() const; // Exposed to Python
DllExport void setArtDefineTag(const TCHAR* szVal);
// Arrays
DllExport bool hasTrait(int i) const; // Exposed to Python
DllExport int getFlavorValue(int i) const; // Exposed to Python
DllExport int getContactRand(int i) const; // Exposed to Python
DllExport int getContactDelay(int i) const; // Exposed to Python
DllExport int getMemoryDecayRand(int i) const; // Exposed to Python
DllExport int getMemoryAttitudePercent(int i) const; // Exposed to Python
DllExport int getNoWarAttitudeProb(int i) const; // Exposed to Python
DllExport int getUnitAIWeightModifier(int i) const; // Exposed to Python
DllExport int getImprovementWeightModifier(int i) const; // Exposed to Python
DllExport int getDiploPeaceIntroMusicScriptIds(int i) const;
DllExport int getDiploPeaceMusicScriptIds(int i) const;
DllExport int getDiploWarIntroMusicScriptIds(int i) const;
DllExport int getDiploWarMusicScriptIds(int i) const;
// Other
DllExport const CvArtInfoLeaderhead* getArtInfo() const;
DllExport const TCHAR* getLeaderHead() const;
DllExport const TCHAR* getButton() const;
DllExport void write(FDataStreamBase* stream);
DllExport void read(FDataStreamBase* stream);
DllExport bool read(CvXMLLoadUtility* pXML);
//---------------------------------------PROTECTED MEMBER VARIABLES---------------------------------
protected:
int m_iFaction; //Faction Mod by TRN2 & Impaler int m_iWonderConstructRand;
int m_iBaseAttitude;
int m_iBasePeaceWeight;
int m_iPeaceWeightRand;
int m_iWarmongerRespect;
int m_iRefuseToTalkWarThreshold;
int m_iNoTechTradeThreshold;
int m_iTechTradeKnownPercent;
int m_iMaxGoldTradePercent;
int m_iMaxGoldPerTurnTradePercent;
int m_iMaxWarRand;
int m_iMaxWarNearbyPowerRatio;
int m_iMaxWarDistantPowerRatio;
int m_iMaxWarMinAdjacentLandPercent;
int m_iLimitedWarRand;
int m_iLimitedWarPowerRatio;
int m_iDogpileWarRand;
int m_iMakePeaceRand;
int m_iDeclareWarTradeRand;
int m_iDemandRebukedSneakProb;
int m_iDemandRebukedWarProb;
int m_iRazeCityProb;
int m_iBuildUnitProb;
int m_iBaseAttackOddsChange;
int m_iAttackOddsChangeRand;
int m_iWorseRankDifferenceAttitudeChange;
int m_iBetterRankDifferenceAttitudeChange;
int m_iCloseBordersAttitudeChange;
int m_iLostWarAttitudeChange;
int m_iAtWarAttitudeDivisor;
int m_iAtWarAttitudeChangeLimit;
int m_iAtPeaceAttitudeDivisor;
int m_iAtPeaceAttitudeChangeLimit;
int m_iSameReligionAttitudeChange;
int m_iSameReligionAttitudeDivisor;
int m_iSameReligionAttitudeChangeLimit;
int m_iDifferentReligionAttitudeChange;
int m_iDifferentReligionAttitudeDivisor;
int m_iDifferentReligionAttitudeChangeLimit;
int m_iBonusTradeAttitudeDivisor;
int m_iBonusTradeAttitudeChangeLimit;
int m_iOpenBordersAttitudeDivisor;
int m_iOpenBordersAttitudeChangeLimit;
int m_iDefensivePactAttitudeDivisor;
int m_iDefensivePactAttitudeChangeLimit;
int m_iShareWarAttitudeChange;
int m_iShareWarAttitudeDivisor;
int m_iShareWarAttitudeChangeLimit;
int m_iFavoriteCivicAttitudeChange;
int m_iFavoriteCivicAttitudeDivisor;
int m_iFavoriteCivicAttitudeChangeLimit;
int m_iDemandTributeAttitudeThreshold;
int m_iNoGiveHelpAttitudeThreshold;
int m_iTechRefuseAttitudeThreshold;
int m_iStrategicBonusRefuseAttitudeThreshold;
int m_iHappinessBonusRefuseAttitudeThreshold;
int m_iHealthBonusRefuseAttitudeThreshold;
int m_iMapRefuseAttitudeThreshold;
int m_iDeclareWarRefuseAttitudeThreshold;
int m_iDeclareWarThemRefuseAttitudeThreshold;
int m_iStopTradingRefuseAttitudeThreshold;
int m_iStopTradingThemRefuseAttitudeThreshold;
int m_iAdoptCivicRefuseAttitudeThreshold;
int m_iConvertReligionRefuseAttitudeThreshold;
int m_iOpenBordersRefuseAttitudeThreshold;
int m_iDefensivePactRefuseAttitudeThreshold;
int m_iPermanentAllianceRefuseAttitudeThreshold;
int m_iVassalRefuseAttitudeThreshold;
int m_iVassalPowerModifier;
int m_iFavoriteCivic;
CvString m_szArtDefineTag;
// Arrays
bool* m_pbTraits;
int* m_piFlavorValue;
int* m_piContactRand;
int* m_piContactDelay;
int* m_piMemoryDecayRand;
int* m_piMemoryAttitudePercent;
int* m_piNoWarAttitudeProb;
int* m_piUnitAIWeightModifier;
int* m_piImprovementWeightModifier;
int* m_piDiploPeaceIntroMusicScriptIds;
int* m_piDiploPeaceMusicScriptIds;
int* m_piDiploWarIntroMusicScriptIds;
int* m_piDiploWarMusicScriptIds;
};
Code:
//======================================================================================================
// CvLeaderHeadInfo
//======================================================================================================
//------------------------------------------------------------------------------------------------------
//
// FUNCTION: CvLeaderHeadInfo()
//
// PURPOSE : Default constructor
//
//------------------------------------------------------------------------------------------------------
CvLeaderHeadInfo::CvLeaderHeadInfo() :
m_iWonderConstructRand(0),
m_iBaseAttitude(0),
m_iBasePeaceWeight(0),
m_iPeaceWeightRand(0),
m_iWarmongerRespect(0),
m_iRefuseToTalkWarThreshold(0),
m_iNoTechTradeThreshold(0),
m_iTechTradeKnownPercent(0),
m_iMaxGoldTradePercent(0),
m_iMaxGoldPerTurnTradePercent(0),
m_iMaxWarRand(0),
m_iMaxWarNearbyPowerRatio(0),
m_iMaxWarDistantPowerRatio(0),
m_iMaxWarMinAdjacentLandPercent(0),
m_iLimitedWarRand(0),
m_iLimitedWarPowerRatio(0),
m_iDogpileWarRand(0),
m_iMakePeaceRand(0),
m_iDeclareWarTradeRand(0),
m_iDemandRebukedSneakProb(0),
m_iDemandRebukedWarProb(0),
m_iRazeCityProb(0),
m_iBuildUnitProb(0),
m_iBaseAttackOddsChange(0),
m_iAttackOddsChangeRand(0),
m_iWorseRankDifferenceAttitudeChange(0),
m_iBetterRankDifferenceAttitudeChange(0),
m_iCloseBordersAttitudeChange(0),
m_iLostWarAttitudeChange(0),
m_iAtWarAttitudeDivisor(0),
m_iAtWarAttitudeChangeLimit(0),
m_iAtPeaceAttitudeDivisor(0),
m_iAtPeaceAttitudeChangeLimit(0),
m_iSameReligionAttitudeChange(0),
m_iSameReligionAttitudeDivisor(0),
m_iSameReligionAttitudeChangeLimit(0),
m_iDifferentReligionAttitudeChange(0),
m_iDifferentReligionAttitudeDivisor(0),
m_iDifferentReligionAttitudeChangeLimit(0),
m_iBonusTradeAttitudeDivisor(0),
m_iBonusTradeAttitudeChangeLimit(0),
m_iOpenBordersAttitudeDivisor(0),
m_iOpenBordersAttitudeChangeLimit(0),
m_iDefensivePactAttitudeDivisor(0),
m_iDefensivePactAttitudeChangeLimit(0),
m_iShareWarAttitudeChange(0),
m_iShareWarAttitudeDivisor(0),
m_iShareWarAttitudeChangeLimit(0),
m_iFavoriteCivicAttitudeChange(0),
m_iFavoriteCivicAttitudeDivisor(0),
m_iFavoriteCivicAttitudeChangeLimit(0),
m_iDemandTributeAttitudeThreshold(NO_ATTITUDE),
m_iNoGiveHelpAttitudeThreshold(NO_ATTITUDE),
m_iTechRefuseAttitudeThreshold(NO_ATTITUDE),
m_iStrategicBonusRefuseAttitudeThreshold(NO_ATTITUDE),
m_iHappinessBonusRefuseAttitudeThreshold(NO_ATTITUDE),
m_iHealthBonusRefuseAttitudeThreshold(NO_ATTITUDE),
m_iMapRefuseAttitudeThreshold(NO_ATTITUDE),
m_iDeclareWarRefuseAttitudeThreshold(NO_ATTITUDE),
m_iDeclareWarThemRefuseAttitudeThreshold(NO_ATTITUDE),
m_iStopTradingRefuseAttitudeThreshold(NO_ATTITUDE),
m_iStopTradingThemRefuseAttitudeThreshold(NO_ATTITUDE),
m_iAdoptCivicRefuseAttitudeThreshold(NO_ATTITUDE),
m_iConvertReligionRefuseAttitudeThreshold(NO_ATTITUDE),
m_iOpenBordersRefuseAttitudeThreshold(NO_ATTITUDE),
m_iDefensivePactRefuseAttitudeThreshold(NO_ATTITUDE),
m_iPermanentAllianceRefuseAttitudeThreshold(NO_ATTITUDE),
m_iVassalRefuseAttitudeThreshold(NO_ATTITUDE),
m_iVassalPowerModifier(0),
m_iFavoriteCivic(NO_CIVIC),
m_pbTraits(NULL),
m_piFlavorValue(NULL),
m_piContactRand(NULL),
m_piContactDelay(NULL),
m_piMemoryDecayRand(NULL),
m_piMemoryAttitudePercent(NULL),
m_piNoWarAttitudeProb(NULL),
m_piUnitAIWeightModifier(NULL),
m_piImprovementWeightModifier(NULL),
m_piDiploPeaceIntroMusicScriptIds(NULL),
m_piDiploPeaceMusicScriptIds(NULL),
m_piDiploWarIntroMusicScriptIds(NULL),
m_piDiploWarMusicScriptIds(NULL),
m_iFaction(-1) //Faction Mod by TRN2 & Impaler{
}
Code:
void CvLeaderHeadInfo::setArtDefineTag(const TCHAR* szVal)
{
m_szArtDefineTag = szVal;
}
int CvLeaderHeadInfo::getFaction() const //Faction Mod by TRN2 & Impaler
{
return m_iFaction;
}
// Arrays
bool CvLeaderHeadInfo::hasTrait(int i) const
{
FAssertMsg(i < GC.getNumTraitInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_pbTraits ? m_pbTraits[i] : false;
}
int CvLeaderHeadInfo::getFlavorValue(int i) const
{
FAssertMsg(i < GC.getNumFlavorTypes(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_piFlavorValue ? m_piFlavorValue[i] : -1;
}
Code:
void CvLeaderHeadInfo::read(FDataStreamBase* stream)
{
CvInfoBase::read(stream);
uint uiFlag=0;
stream->Read(&uiFlag); // flag for expansion
stream->Read(&m_iFaction); //Faction Mod by TRN2 & Impaler stream->Read(&m_iWonderConstructRand);
stream->Read(&m_iBaseAttitude);
stream->Read(&m_iBasePeaceWeight);
stream->Read(&m_iPeaceWeightRand);
stream->Read(&m_iWarmongerRespect);
stream->Read(&m_iRefuseToTalkWarThreshold);
stream->Read(&m_iNoTechTradeThreshold);
Code:
void CvLeaderHeadInfo::write(FDataStreamBase* stream)
{
CvInfoBase::write(stream);
uint uiFlag=0;
stream->Write(uiFlag); // flag for expansion
stream->Write(m_iFaction); //Faction Mod by TRN2 & Impaler stream->Write(m_iWonderConstructRand);
stream->Write(m_iBaseAttitude);
stream->Write(m_iBasePeaceWeight);
stream->Write(m_iPeaceWeightRand);
stream->Write(m_iWarmongerRespect);
stream->Write(m_iRefuseToTalkWarThreshold);
Code:
bool CvLeaderHeadInfo::read(CvXMLLoadUtility* pXML)
{
CvString szTextVal;
if (!CvInfoBase::read(pXML))
{
return false;
}
pXML->GetChildXmlValByName(szTextVal, "ArtDefineTag");
setArtDefineTag(szTextVal);
pXML->GetChildXmlValByName(&m_iFaction,"iFaction"); //Faction Mod by TRN2 & Impaler
pXML->GetChildXmlValByName(&m_iWonderConstructRand, "iWonderConstructRand");
pXML->GetChildXmlValByName(&m_iBaseAttitude, "iBaseAttitude");
pXML->GetChildXmlValByName(&m_iBasePeaceWeight, "iBasePeaceWeight");
pXML->GetChildXmlValByName(&m_iPeaceWeightRand, "iPeaceWeightRand");
pXML->GetChildXmlValByName(&m_iWarmongerRespect, "iWarmongerRespect");
pXML->GetChildXmlValByName(&m_iRefuseToTalkWarThreshold, "iRefuseToTalkWarThreshold");
pXML->GetChildXmlValByName(&m_iNoTechTradeThreshold, "iNoTechTradeThreshold");
pXML->GetChildXmlValByName(&m_iTechTradeKnownPercent, "iTechTradeKnownPercent");
pXML->GetChildXmlValByName(&m_iMaxGoldTradePercent, "iMaxGoldTradePercent");
Code:
<ElementType name="DiplomacyMusicWar" content="eltOnly"> <element type="DiploMusicWarEra" minOccurs="0" maxOccurs="*"/> </ElementType> <ElementType name="DiplomacyIntroMusicWar" content="eltOnly"> <element type="DiploMusicWarEra" minOccurs="0" maxOccurs="*"/> </ElementType> <ElementType name="iFaction" content="textOnly" dt:type="int"/> <ElementType name="LeaderHeadInfo" content="eltOnly"> <element type="Type"/> <element type="Description"/> <element type="Civilopedia"/> <element type="ArtDefineTag"/> <element type="iFaction" minOccurs="0"/> <element type="iWonderConstructRand"/> <element type="iBaseAttitude"/> <element type="iBasePeaceWeight"/> <element type="iPeaceWeightRand"/> <element type="iWarmongerRespect"/> <element type="iRefuseToTalkWarThreshold"/> <element type="iNoTechTradeThreshold"/> Last edited by TRN2; Jan 31, 2007 at 09:38 AM. |
|
|
|
|
|
#4 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
Reserved for Part 3: The Python
Reserved for Part 3: The Python
Since I am still a Civ IV nublette - I was wondering - could I get directions to where the victory conditions are calculated in the game, I have tried using windows search feature, and I think the files are encoded diffferently or something - cause it don't work, and eclipse - which is what I am using to edit my Python files won't search all files - this is drastically slowing me down trying to find where to hook my new victory condition code
Last edited by TRN2; Jan 28, 2007 at 08:51 AM. |
|
|
|
|
|
#5 |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
WOW! I can't believe you did all this stuff! I hope my little scenario will be worth all the work you're putting into this.
Since you're doing so much, I'll let you know exactly what it is you're building: My scenario is called "Aurelia." It is set in an imaginary world that is ringed by mountains, with an inland sea in the middle. At the center of the sea is the island nation of Aurelia, which was the cradle of civilization. Over the years, settlers migrated to the lands beyond the sea and new civilizations were formed. One of these civilizations, Baltharia, was home to a great wizard who created a staff with the power to radically transorm the planet's landscape. With a wave of the staff, mountains would rise or seas would form. The landlocked, mountain-dwelling Baltharians used this awesome power to create channels to the inland sea. Having no experience with naval combat, the Baltharians then created a massive nautical maze of impassable mountains that jutted above the sea to protect their new harbors. Word of this amazing staff spread throughout the world, and the Baltharians made a thriving business of shaping the lands of distant civilizations. Over time, much of the world became a nearly impassable maze of mountains, with civilizations constantly adding to their rocky defenses. Some of these civilizations were eventually so cut off from the world that they became paranoid about their neighbors' intentions. Gradually, their paranoia drove them mad and they became bent on controlling the entire world. They formed an evil alliance and mounted an attack on the unsuspecting civilization of Baltharia. Their plan was to seize the wizard and his magical staff, then use its power to destroy any foe that stood in their way. As their armies approached, the wizard had no doubt of their intentions. No matter how many mountains he conjured, he knew that their massive armies would eventually prevail. He could think of only one way to save his beloved Baltharia. With his staff in one hand and his sword in the other, he set out to face the raging horde. When he reached their camp, he held the staff above his head and called out to Calixius, the leader of the evil alliance. Just as Calixius emerged from his camp, and the wizard was certain he was watching, he snapped the magical staff in two and threw the useless pieces of wood to the ground. "Seize him!" Calixius barked to his soldiers. The wizard knew that if he was captured, the enemy would find a way to force him to make another staff. Without a moment's hesitation, he drew his sword and thrust it into his own chest. Without the lure of the staff, the alliance called off the attack on Baltharia, but the news of their aborted plan soon reached the palace of Aurelia, now ruled by the young king, Aurelius. He called on his closest allies and formed a pact to protect civilization from this new, terrible threat. And this is where the game begins. There are 17 civilations to choose from: 3 evil, 3 good, and 10 that are somewhere in the middle. The goal of the game is for good or evil to triumph - one can play either side they choose. There are more Civs that are diplomatically inclined to side with the good guys, but this is because beating the bad guys will be nearly impossible without a lot of help. The evil alliance's cities are protected by long, winding mazes of mountains, each with different challenges. Playing the maze cities should be a lot of fun, too, since there are so many ways to set up your defenses, with lots of places to hide an army that would be outside the opponents' field of view. Anyway, that's the scenario. It would be really good if there were a way to force Civs to eventually choose one of the two alliances. Otherwise, they would be technologically left in the dust competing against two teams of three. Any ideas, suggestions or further help would be greatly appreciated.
|
|
|
|
|
|
#6 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
I would also suggest that you look at Kael's Thread on http://forums.civfanatics.com/showthread.php?t=166935, it doesn't contain victory conditions, but with his permission, I might incorporate that, and touch up a few ideas of my own on factions, and make a proper mod out of this, since there seems to be a fair amount of interest for it.
|
|
|
|
|
|
#7 | |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
Quote:
Thanks again for all that you've done - this is way, way more than I was expecting when I started this thread. |
|
|
|
|
|
|
#8 |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
I would just add a python check that would look for the presense of your good and bad guys each turn and run the following if you want to award victory to either side:
Code:
gc.getGame().setWinner(iPlayer, CvUtil.findInfoTypeNum(gc.getHandicapInfo,gc.getNumHandicapInfos(),"VICTORY_CONQUEST"))
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
|
|
#9 | |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
tbh
tbh- I hadn't made it that far, I was going to do this code (simply because I have had a few people already comment on it) to do factions, this way you could have good and evil, or good, evil and nuetral, or a slew of different factions, that I was then going to push into teams, I do see what you are saying though, that I could eliminate the CIV4VictoryInfos.XML, but it was included for the learning process, and also because I wanted the extra flag on the game options screen so that the mod could be disabled in the case of the player not wanting to use it.
One quick last question... Quote:
also it is 6AM atm and I am off to bed - nite
|
|
|
|
|
|
|
#10 | |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
Quote:
Ultimately, though, I decided against it because I thought it would be more fun to have a handful of "fence-sitters." These would be civs with no strong ties to either side that have slightly better than average relations with civs on both sides of the aisle. If the scenario forced them to eventually choose a side, it would add a diplomatic challenge to what would otherwise be a routine conquest victory. On a side note, I've never had more than one Permanent Alliance in an unmodified single player game. I almost always play with that option off. Will the AI join a permanent alliance that already exists between two or more civs? If so, what variables does it use to make the decision? Is it merely the attitude toward the civ that asks them to join, or does it include the attitude toward all members of the alliance? What Leaderhead variables would I need to alter to virtually guarantee that they'll eventually join an alliance (without making their allegiance too easy to get)? |
|
|
|
|
|
|
#11 | |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
Quote:
But if you could also put the check in the onSetPlayerAlive() function in the same file. That way you check for the victory condition each time a civ dies.
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
|
|
|
#12 | ||||
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
ty so much - I am looking forward to knowing these *.py, *.cpp and *.h files much better over the next few weeks/months
![]() Quote:
Quote:
Quote:
Quote:
EDIT:Why am I so unsleepy
Last edited by TRN2; Jan 28, 2007 at 01:06 PM. |
||||
|
|
|
|
|
#13 | |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
Quote:
I like your idea for having middle neutral civs. I would probably recommend a python script that checks the attitude of the neutral players each turn and pushed them to either of the two teams if their attitude is high enough (and removes them if it goes down). I guess the big question is, what is it that you want to decide if the neutral civs join a team or not? Attitude is good, you may want to consider other aspects. Maybe 2 neutral civs hate each other so you can only ever get one of them. Maybe one civ requires some payment for its service? Maybe a civ will join anyone who performs a task for them? Have fun with it.
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
|
|
|
#14 | |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
Quote:
I also like the idea that if you don't keep them happy, they'll switch sides. |
|
|
|
|
|
|
#15 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
I am still stuck on the second part of my code, I've been pulling out hair, chewing my toe-nails, etc.. but to no avail, if someone could go over the third reply to this and find the bug I would be grateful, I got a hunch that I've left something out.
And if it is not that, then Code:
pXML->GetChildXmlValByName(&m_iFaction, "iFaction"); |
|
|
|
|
|
#16 |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
Kael, your suggestion has really added a new dimension to the game. I like it a lot.
I'm going to brainstorm my ideas for the "fence-sitter" civs here in case anybody has other brilliant ideas. ![]() The Fence-Sitter Civs: Spoiler:
I may make a couple other Civs into fence-sitters, but these are definites. If you have any suggestions, please share them. Thanks again for all the help and great ideas. Last edited by Aurelia; Jan 28, 2007 at 03:14 PM. Reason: Added spoiler tags |
|
|
|
|
|
#17 |
|
Chieftain
Join Date: Jan 2007
Posts: 89
|
You should really wrap all that in a spoiler tag
|
|
|
|
|
|
#18 |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
Another little twist:
Spoiler:
Last edited by Aurelia; Jan 28, 2007 at 03:16 PM. Reason: Added spoiler tags |
|
|
|
|
|
#19 |
|
Chieftain
Join Date: Jan 2007
Posts: 13
|
From another thread re: Mac Compatibility:
Can the things we're talking about be done with just Python and xml? |
|
|
|
|
|
#20 |
|
Deity
Join Date: May 2002
Location: Ohio
Posts: 17,392
|
The stuff I recommended is all python, should work on both macs and pcs.
__________________
Civ4: Fall from Heaven II (forum) (webpage), FfH: Age of Ice Civ5: Queen of the Iceni, Legions, Modders Guide to Civilization V Current Project: Fallen Enchantress |
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Victory Condition | Gambino | Civ4Col - Strategy & Tips | 2 | Sep 26, 2008 02:55 PM |
| Spy/Religion/Custom Victory condition?? | mechadamuramu | Civ4 - Strategy & Tips | 2 | Jan 10, 2008 04:06 PM |
| Modifying the Victory Condition part of the Custom Game Screen | torin23 | Civ4 - Creation & Customization | 1 | Jan 23, 2007 04:22 AM |
| What Victory condition do you like the most? | Danicela | Civ4 - General Discussions | 1 | Apr 19, 2006 05:11 PM |
| What should our victory condition be? | Chieftess | Civ3 Demo Game: Polls | 5 | Jul 07, 2002 06:42 PM |