</iYieldChange> = Means

Dracitus

Chieftain
Joined
Dec 20, 2010
Messages
53
What does the 3 groups of yeild mean

Code:
				<BonusTypeStruct>
					<BonusType>BONUS_CORN</BonusType>
					<bBonusMakesValid>1</bBonusMakesValid>
					<bBonusTrade>1</bBonusTrade>
					<iDiscoverRand>0</iDiscoverRand>
					<YieldChanges>
[COLOR="Sienna"]						<iYieldChange>2</iYieldChange>
						<iYieldChange>0</iYieldChange>
						<iYieldChange>0</iYieldChange>[/COLOR]
					</YieldChanges>
				</BonusTypeStruct>
 
Checking the Modiki is always a good plan.

But...
The 3 yield values are food, production, and commerce (in that order).
The 4 commerce values are gold, research, culture, and espionage (also in that order)
 
ok cool

can it minus food production commerce buy adding like +3 food -5 production and +6 commerce


Example
Code:
<BonusTypeStruct>
<BonusType>BONUS_CORN</BonusType>
<bBonusMakesValid>1</bBonusMakesValid>
<bBonusTrade>1</bBonusTrade>
<iDiscoverRand>0</iDiscoverRand>
<YieldChanges>
<iYieldChange>+3</iYieldChange>
<iYieldChange>-5</iYieldChange>
<iYieldChange>+6</iYieldChange>
</YieldChanges>
</BonusTypeStruct>


can it just take like +5 food 6 production + 5 commerce so it only
adds +5 food each turn ,6 production only for one turn and + 5 commerce Each turn

Example
Code:
<BonusTypeStruct>
<BonusType>BONUS_CORN</BonusType>
<bBonusMakesValid>1</bBonusMakesValid>
<bBonusTrade>1</bBonusTrade>
<iDiscoverRand>0</iDiscoverRand>
<YieldChanges>
<iYieldChange>+3</iYieldChange>
<iYieldChange>5</iYieldChange>
<iYieldChange>-6</iYieldChange>
</YieldChanges>
</BonusTypeStruct>
 
+ isn't needed, if it even works. - is needed though. I'm not sure what the difference between +3 and 5 is supposed to be, in your last code. +3 doesn't work, I think, but even if it does, 3 would have the same result as +3.
 
Instead of starting new threads constantly and asking for advise, I think it would be prudent to check with the CivIV XML Reference in the Modiki first. If XML itself is hard to penetrate (I happen to think it is) then someone would probably be able to point you to a guide, tutorial or other online resource on the subject.
 
I actully asked in servel post if it was a good idea to have it all at 1 post instead of many post .. but you guys never answered thanks for answering ill stick to one post its easyer on me so i wont jump arround all he time and its easyer for you guys to so one it is and sence im done with the others ill stick to this thread.
 
I don't mind the thread as much as the frequency at which they are created. It is, after all, prudent to look in some reference before asking. Because the answer you get might simply be a link to said reference. But perhaps you already checked the Modiki and didn't find what you were looking for?
 
its not hard to eitd whats there or to addon mainly im disecting the code in xml to the point where i like it right now im just randomly picking sbjects that i think i would love to edit and ask questions on them then moveing on to something different


i would do python but i no nothing about it im just editing the main client of c4 bts america i managed to get america xtra free sets starting techs and im in tohe and everyone else starts out the same


and the above are just example not actully in my code

actully i did find it in modiki its just i didnt understand what th yield ment
 
I think editing XML is a good way to get into modding, and the fact that the stuff you encounter also affects the other fields, like art and the SDK, makes it worthwhile. Because the XML entries are parsed by the DLL to set values and settings in the C++ code. Then the DLL sublets some of its functionality to the Python scripting language. So Python is probably the least necessary craft in modding, while XML is pretty essential.

As an example this is what the YieldTypes look exposed to Python. But it is all inherited from the XML settings you're doing right now, and changing them will affect everything else.
 
right now the editing ive done only effects america no other civ if i where to do all civs it would be to much to handle and then all the errors hat could show up sometimes but its fun and im learning alot .. all i do is copy the tech or building and put it into the civilization uner america but back to my question


is it posiable in stead of commerance to go up how about the gold..... well ill do some studing in modiki
 
before i go can you give me a sample of coding in python. i would like to try python i jus duno what i need to start programming in pythron
 
Sure:
Spoiler :
PHP:
### Unique powers for Glory and Greatness mod, by Baldyr

from GGUtils import *

# constants

iUnitDiscountPercent = 20
iArabianFood = 2
iArabianCommerce = 1
iCarthageVassalXP = 1
iCarthageVassalGold = 50
eCelticCivic = eHereditaryRule
eChineseCivic = eBureaucracy
iEnglandMoves = 1
tHolyRomanEras = (False, True, False, True, False, False, False) # Classical & Renaissance
iIncaFood = 1
iIndiaCitySize = 2
iIndiaSurplusPercent = 10
eIndianCivic = ePacifism
iJapaneseProbability = 20
maliTechMessage = "Choose a free starting Tech!"
iMayanProbability = 25
iNetherlandsInterest = 3
iGermanProbability = 50
iGermanGold = 25
iOttomanProbability = 50
iOttomanGold = 50
iOttomanCulture = 100
tPersianDomains = eLand, eSea
iPersianMoves = 1
iRomanConstructionDiscount = 20
iRomanUpgradeDiscount = 50
iSpainGoldBonus = 50
iVikingBonus = 100

startingCivicDict = { "Celt": eCelticCivic,
                      "China": eChineseCivic,
                      "India": eIndianCivic
                      }
### setup

for pCivPlayer in CivPlayer.getCivs("Holy Rome"):
        pCivPlayer.setData("lFreeEraTechs", list(tHolyRomanEras))

### main functions - called from CvEventManager/CvGameUtils

def startingCivics(ePlayer, eCivic):
        """
        Enable Civic type from start.
        """
        for name, eStartingCivic in startingCivicDict.iteritems():
                if CivPlayer.isCiv(name, ePlayer) and eCivic == eStartingCivic:
                        return True
        return False

def aztecGold(pUnit, ePlayer):
        """
        Gold for units killed based on experience of unit.
        """
        if isCiv("Aztec", ePlayer):
                getCyPlayer(ePlayer).changeGold(pUnit.getExperience())

def carthageVassals(ePlayer):
        """
        Extra gold and Great General points for vassals.
        """
        if not CivPlayer.isCivAlive("Carthage"): return
        pVassalCiv = instance(ePlayer)
        for pMasterCiv in CivPlayer.getCivs("Carthage"):
                if pVassalCiv.get(CyTeam).isVassal(pMasterCiv.get(CyTeam)):
                        pVassalCiv.get(CyPlayer).changeCombatExperience(iCarthageVassalXP)
                        iGold = pVassalCiv.get(CyPlayer).getGold()
                        iBonusGold = max(1, min(iCarthageVassalGold, iGold / iCarthageVassalGold))
                        grantGold(ePlayer, iBonusGold)
                        break

def colombiaOccupation(pCity, ePlayer, bConquest):
        """
        No Revolting in Captured cities.
        """
        if bConquest and CivPlayer.isCiv("Gran Colombia", ePlayer):
                pCity.setOccupationTimer(0)

def germanyCapture(pWinningUnit, pLosingUnit):
        """
        50 percent chance to capture barbarian units and get gold reward.
        """
        ePlayer = pWinningUnit.getOwner()
        if ( CivPlayer.isCiv("Germany", ePlayer)
             and pLosingUnit.getDomainType() == eLand
             and pLosingUnit.getOwner() == eBarbarian
             and isProbabilityPercent(iGermanProbability, "germany") ):
                captureUnit(ePlayer, pWinningUnit, pLosingUnit)
                grantGold(ePlayer, iGermanGold)

def germanyConscription(pCity):
        """
        No Unhappiness for Drafting.
        """
        eOwner = pCity.getOwner()
        if CivPlayer.isCiv("Germany", eOwner):
                iConscriptTimer = pCity.getConscriptAngerTimer()
                if iConscriptTimer:
                        pCity.changeConscriptAngerTimer(-iConscriptTimer)

def englandMovement():
        """
        +1 Movement to Ships.
        """
        for pTeam in CivPlayer.getCivs("England", CyTeam):
                pTeam.changeExtraMoves(iEnglandMoves)

def holyRomeTech(eTech, ePlayer):
        """
        Free Tech in the Classical and Renaissance Eras.
        """
        if not CivPlayer.isCiv("Inca", ePlayer): return
        pCivPlayer = instance(ePlayer)
        lHolyRomanEras = pCivPlayer.getData("lFreeTechEras")
        eTechEra = gc.getTechInfo(eTech).getEra()
        ePlayerEra = pCivPlayer.get(CyPlayer).getCurrentEra()
        if lHolyRomanEras[eTechEra] == True:
                lHolyRomanEras[eTechEra] = None
        elif lHolyRomanEras[ePlayerEra] == None:
                pCivPlayer.get(CyTeam).setHasTech(eTech, True, ePlayer, False, True)
                lHolyRomanEras[ePlayerEra] = False
##        pCivPlayer.setData("lFreeTechEras", lHolyRomanEras)
        
def indiaPopulation(pCity):
        """
        Cities Start with 2 population.
        """
        eOwner = pCity.getOwner()
        if CivPlayer.isCiv("India", eOwner):
                pCity.setPopulation(iIndiaCitySize)

def indiaGrowth(pCity, ePlayer):
        """
        Extra food on city growth.
        """
        if CivPlayer.isCiv("India", ePlayer):
                iFoodBarSize = pCity.getFoodTurnsLeft() * pCity.foodConsumption(False, 0)
                iFoodSurplus = int(iFoodBarSize * iIndiaSurplusPercent / 100.0)
                pCity.changeFood(iFoodSurplus)

def japanHeal(pUnit):
        """
        20 percent chance for a unit to heal fully after combat victory.
        """
        if CivPlayer.isCiv("Japan", pUnit.getOwner()) and isProbabilityPercent(iJapaneseProbability, "japan"):
                pUnit.setDamage(0, False)

def japanCulture(pUnit):
        """
        Units killed in borders add to city culture.
        """
        eOwner = pUnit.getOwner()
        if CivPlayer.isCiv("Japan", eOwner) and pUnit.plot().getOwner() == eOwner :
                iX, iY = pUnit.getX(), pUnit.getY()
                eTeam = tPlayer[eOwner].team
                pCity = findCity(iX, iY, eOwner, eTeam, True, False, -1, -1, -1)
                pCity.changeCulture(eOwner, pUnit.getExperience(), True)

def maliTech():
        """
        Can Select a Free Technology to start the game.
        """
        for pPlayer in CivPlayer.getCivs("Mali", CyPlayer):
                if pPlayer.isHuman():
                        pPlayer.chooseTech(1, maliTechMessage, False)
                else:
                        pPlayer.AI_chooseFreeTech(1)

def mayaEnslave(pWinningUnit, pLosingUnit):
        """
        Enslave - 25 percent chance to get a Worker unit any time a land unit is defeated in combat.
        """
        ePlayer = pWinningUnit.getOwner()
        if ( CivPlayer.isCiv("Maya", ePlayer)
             and pLosingUnit.getDomainType() == eLand
             and isProbabilityPercent(iMayanProbability, "maya")
             and pLosingUnit.getUnitType() >= eWarrior ):
                spawnUnit(ePlayer, pWinningUnit.getX(), pWinningUnit.getY())

def netherlandsInterest():
        """
        Receive 3 percent interest on gold reserves each game turn (rounded down).
        """
        for pPlayer in CivPlayer.getCivs("Netherlands", CyPlayer):
                if not pPlayer.isAlive(): return
                pPlayer.setGold(int(pPlayer.getGold() * ((iNetherlandsInterest + 100) / 100.0)))

def ottomanCapture(pWinningUnit, pLosingUnit):
        """
        5O percent chance to capture enemy ships and earn gold.
        """
        ePlayer = pWinningUnit.getOwner()
        if ( CivPlayer.isCiv("Ottoman", ePlayer)
             and pLosingUnit.getDomainType() == eSea
             and isProbabilityPercent(iOttomanProbability, "ottoman") ):
                captureUnit(ePlayer, pWinningUnit, pLosingUnit)
                grantGold(ePlayer, iOttomanGold)

def ottomanCulture(pCity, ePlayer, bConquest):
        """
        Spread culture in conquered cities.
        """
        if bConquest and CivPlayer.isCiv("Ottoman", ePlayer):
                pCity.changeCulture(ePlayer, iOttomanCulture, True)

def persiaMovement(ePlayer, bActive):
        """
        All land and sea units gain one extra movement point during Golden Ages.
        """
        if not CivPlayer.isCiv("Persia", ePlayer): return
        iExtraMoves = iPersianMoves
        if not bActive:
                iExtraMoves = - iExtraMoves
        for eDomain in tPersianDomains:
                instance(ePlayer).get(CyTeam).changeExtraMoves(eDomain, iExtraMoves)

def romeBuildings(eBuilding, ePlayer):
        """
        +25 percent production of buildings already built in the capital.
        """
        if ( CivPlayer.isCiv("Rome", ePlayer)
             and getCyPlayer(ePlayer).getCapitalCity().isHasBuilding(eBuilding) ):
                return iRomanConstructionDiscount / 100.0
        return -1

def romeUnits(ePlayer):
        """
        -50 percent cost to upgrade units.
        """
        if CivPlayer.isCiv("Rome", ePlayer):
                return iRomanUpgradeDiscount / 100.0
        return -1
                
def russiaDamage(pUnit, pPlot):
        """
        Enemy units in Russian territory take damage when either moving or fighting.
        """
        eUnitOwner, ePlotOwner = pUnit.getOwner(), pPlot.getOwner()
        if ( CivPlayer.isCivAlive("Russia")
             and not eUnitOwner == ePlotOwner
             and CivPlayer.isCiv("Russia", ePlotOwner)
             and isAtWar(ePlotOwner, eUnitOwner) ):
                if pUnit.movesLeft() == 0:
                        pUnit.changeDamage(5, -1)

def spainGoody(ePlayer, eGoody):
        """
        Extra Gold from Goody Huts.
        """
        if CivPlayer.isCiv("Spain", ePlayer):
                if eGoody == 0:
                        grantGold(ePlayer, iSpainGoldBonus / 2)
                elif eGoody == 1:
                        grantGold(ePlayer, iSpainGoldBonus)

def vikingPillage(pPlot, pUnit):
        """
        Double Gold from pillaging.
        """
        return ( CivPlayer.isCiv("Viking", pUnit.getOwner())
                 and not CivPlayer.isCiv("Viking", pPlot.getOwner())
                 * iVikingBonus / 100.0 )

def zuluUpgrade(pUnit):
        """
        Can Upgrade outside borders.
        """
        return CivPlayer.isCiv("Zulu", pUnit.getOwner())
Work in progress, not tested yet. It requires my very own CivPlayer utility to work, so don't even think of testing any of it on its own.
 
Just Wanted to no what it looked like it seem to b e easy enough that i migh try my own code Wha do i need to start doing pythron while im gone to the store by the time i get back. what it be on modiki
 
You can start with my Python modding tutorial. But make sure to read up on the Python language before getting your hands dirty. Otherwise you'll just be bumbling around at random. :p Every hour you spend studying it ends up saving you tens or hundreds of hours of trial-and-error, not to mention the odd gray hairs. I'm just saying...
 
im only 29 so gray hairs out but ill color my hair blue ok good as it being monday i need to get food for the week so i wont starve at the comp lol :p :nuke:
 
I don't mind the thread as much as the frequency at which they are created. It is, after all, prudent to look in some reference before asking. Because the answer you get might simply be a link to said reference. But perhaps you already checked the Modiki and didn't find what you were looking for?

This is the whole reason for the site. If everyone had to constantly do searches for their questions and issues, then convert it over to a WIKI and shut the site down. I think it is interesting that people constantly ask questions -- shows the game still has life in it.

I was on the tail end of this sort of banter back in July and it made me not wanting to use the site. I guess if people get tired of seeing the same sort of questions asked, don't read the posts but please don't ridicule the new guys trying to learn to mod -- it just drives them away.
 
Thank you tchristensen he/she could have been havng a bad day but what you said is why theres this site and others i mean microsoft doent come out with new software and hope you now it all thats whay hey have books and lybary .......and i did say in a past post that im new and new to modding ive only been modding for a week so i tend to take things and jump arround alot but im learning .. but the comment was a bit rude Baldyr but im new and im not use to forums as much..
 
And I of course apologize.

The valid point I was trying to make (besides the vicious attack itself) is that there are some sources out there, to point to these and to encourage the new guy to make use of them. As a first order of business, only. Its faster than waiting for replies that may or may not appear, at least.
 
I forgive you and yes i do check modiki but youve help me alot i like the help you give
bu sometime modiki doesnt have the answer to my question so i have to ask dont worrie the last thing i dont want to do is start a fight. the serch option on this site ant to good either ive been recording my own voice like forthe withdraw sond i put in well tuck our tail between are legs and run ...... i laugh evertime i here it . in my civ lol im having fun i just got some help with doing 2d pictures im making a pic of my self as a leader ... as im tryig to say im just having fun goffing around just random topics.. :king: :p
 
Top Bottom