weapons upgrades: I'm so confused

Lady Wandbender

Chieftain
Joined
May 4, 2008
Messages
51
Location
atlanta ga
*wimper*
Note: This is NOT me understanding weapons upgrades nor how to get them nor how to use them nor their benifit (sorry some folks sometimes seem to think I'm a compelte moron)

My question is where are the promotions handled, I understand they are automatic, but I can't find the place which makes them automatic I've checked through the promotions.xml the spells.xml, the unit.xml, I know I must be missing it, but can someone lend me a map?
 
Pretty sure they're applied by Python. Probably onUnitMove I'd think, since you get them on moving into a city with access to the resource.
 
It's in the DLL, I've actually been playing with it recently. Here is the unmodified version if you care to see it. Though I doubt that is the case since you know how it works, but wanted to change it around.

Spoiler :
Code:
void CvUnit::setWeapons()
{
	CvPlot* pPlot;
	CvCity* pCity;
    if (GC.getDefineINT("WEAPON_PROMOTION_TIER1") == -1)
    {
        return;
    }
	pPlot = plot();
    if (pPlot->isCity())
    {
        pCity = pPlot->getPlotCity();
        if (pCity->getOwner() == getOwner())
        {
            PromotionTypes ePromT1 = (PromotionTypes)GC.getDefineINT("WEAPON_PROMOTION_TIER1");
            PromotionTypes ePromT2 = (PromotionTypes)GC.getDefineINT("WEAPON_PROMOTION_TIER2");
            PromotionTypes ePromT3 = (PromotionTypes)GC.getDefineINT("WEAPON_PROMOTION_TIER3");
            if (isHasPromotion(ePromT3) == false)
            {
                if (pCity->hasBonus((BonusTypes)GC.getDefineINT("WEAPON_REQ_BONUS_TIER3")) &&
                  m_pUnitInfo->getWeaponTier() >= 3)
                {
                    setHasPromotion(ePromT3, true);
                    gDLL->getInterfaceIFace()->addMessage(getOwner(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), gDLL->getText("TXT_KEY_MESSAGE_WEAPONS_MITHRIL"), "AS2D_REPAIR", MESSAGE_TYPE_MAJOR_EVENT, GC.getPromotionInfo(ePromT3).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX(), getY(), true, true);
                    setHasPromotion(ePromT2, false);
                    setHasPromotion(ePromT1, false);
                }
                else
                {
                    if (isHasPromotion(ePromT2) == false)
                    {
                        if (pCity->hasBonus((BonusTypes)GC.getDefineINT("WEAPON_REQ_BONUS_TIER2")) &&
                          m_pUnitInfo->getWeaponTier() >= 2)
                        {
                            setHasPromotion(ePromT2, true);
                            gDLL->getInterfaceIFace()->addMessage(getOwner(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), gDLL->getText("TXT_KEY_MESSAGE_WEAPONS_IRON"), "AS2D_REPAIR", MESSAGE_TYPE_MAJOR_EVENT, GC.getPromotionInfo(ePromT2).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX(), getY(), true, true);
                            setHasPromotion(ePromT1, false);
                        }
                        else
                        {
                            if (isHasPromotion(ePromT1) == false)
                            {
                                if (pCity->hasBonus((BonusTypes)GC.getDefineINT("WEAPON_REQ_BONUS_TIER1")) &&
                                  m_pUnitInfo->getWeaponTier() >= 1)
                                {
                                    gDLL->getInterfaceIFace()->addMessage(getOwner(), true, GC.getDefineINT("EVENT_MESSAGE_TIME"), gDLL->getText("TXT_KEY_MESSAGE_WEAPONS_BRONZE"), "AS2D_REPAIR", MESSAGE_TYPE_MAJOR_EVENT, GC.getPromotionInfo(ePromT1).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX(), getY(), true, true);
                                    setHasPromotion(ePromT1, true);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
 
Thank you Xienwolf, it explains why I couldn't find it, I haven't even considered going into the .h files yet and the sdk stuff, until I can look at some python code and figure out why the !#($*@$#$@ heck it's not working I don't even want to start playing with anything that will need to be recompiled.

Like today,I was trying to make a spell based off of Scorch, simple cut and paste/rename(s) to create peaks, and not only could I not get it work, but then my scorch spells stopped working...thank Hera for backups. Until I can do the simpler stuff, maybe I should stay away from the things that go bang
 
Actually if you follow Kael's Tutorial on how to set up Codeblocks and compile the DLL, it should be quite simple (well setup tutorial. Pictures and everything).

Then download his DLL files and compile without changing everything, just to see that you CAN do it with how you have yourself set up.

Personally, I think that the DLL is much clearer than the Python, because it isn't referring to some mystical divine overlord entity nearly as often, leaving you wondering what precisely it is asking for. It mostly just calls on itself, and you can go look at the precise function it called to see if it is doing what you want it to do.
 
Peaks and hills are weird. Their xml aren't really used much; only a couple tags will actually change anything, and you can even delete their xml entries entirely without changing the game (they still show up fine). They are mostly hardcoded in the game engine (not even the dll, but somewhere we can't access)


You spell would probably work better if you based it on Motherload spell instead of Scorch. Note they work differently:
Scorch uses:
pPlot.setTerrainType(gc.getInfoTypeForString('TERRAIN_DESERT'),True,True)
while Motherlode uses:
pPlot.setPlotType(PlotTypes.PLOT_HILLS, True, True)

I'd guess that
pPlot.setPlotType(PlotTypes.PLOT_PEAK, True, True)
(or maybe its PlotTypes.PLOT_PEAKS instead of PlotTypes.PLOT_PEAK) would work better.



If you cut and pasted then of course Scorch wouldn't work, since the python portions would be missing. I'll assume you meant copied though.

Are other spells that use python working? Errors in one define of CvSpellInterface.py can stop the entire file from loading. When this happens, the game still runs but no python-using spells work.
 
Thank you MagisterCultuum, (and I've loved that name, though maybe I just always wanted to be a Magister) that would all sound logical. No, it was copy and paste...(duh on me) the other channelling spells didn't seem to be working, but Bloom worked just fine, so I don't think(!) it was in the file. (I had already thought of that and checked it just in case I was a moron who added an extra line or otherwise did something dumb)
 
Actually, Bloom is an xml-only spell (although I use python in my version because I want the elven civs to be able to cast it on improvements)

I'm guessing there was a syntax error in CIV4SpellInfos.xml. I usually use IDLE to check for syntax errors before loading the game. It can show you where to look to find the problem, but I hate actually editing it. My most common mistake is a single space before a tab; its recommendation. I've yet to find a way for it to show spaces and tabs separately, and it recommendation to fix this is to automatically change every tab into spaces and make me go through and fix every line.


I'm pretty sure you can't be a Magister, because that is the masculine form of the word. (The feminine is Magistra)
 
interesting about the gender difference, I hadn't known that....maybe it's a cultural translation, like girls have to be witches and boys have to be shaman...girls can be shaman and boys can be witches (just if a woman had the power she was also an enemy to greece/rome/spain/england..so was a witch, but if a boy had power and could be dealt with he was a shaman)...or is it a strict translation from the greek (latin?)?
 
I'm strictly talking about the way the word is declined in Latin.

Magister is a second declension r-stem. No second declension word is feminine (well, with the exception of proper nouns, some words of Greek origin, and of course any variety of tree. Domus, the word for home, is also feminine, but it is rather irregular and probably fits better in the fourth declension). Those that end in -um (plus the word vulgus, which is occasionally spelled vulgum anyway) are neuter. The rest are masculine, mostly ending in -us. However, this nominative singular case ending is often dropped if preceded by an r. If the r follows a consonant then an e is added before it (like in magister) and otherwise the unaltered root is the masculine nominative singular. I know of no second declension words ending in r that are not masculine.



As a general rule, the first declension equivalent using the same root (i.e, the part of the preceding the case ending of the genitive singular) is used for the feminine form of second declension words. (There are a few words for which a third declension word is used for the feminine form though, and a few third declension masculine words with first declension feminines. Some times both are used interchangeably.I'm wanting to say that there is one word where 5th declension is used for the feminine form, but I don't remember what it is.)

Of course, for a few words (like Vir--man, in the sense of the gender not species) having a feminine equivalent at all doesn't really make sense.

First Declension worlds are all feminine, with few exceptions. Most exceptions are proper nouns, but other denote occuation. The masculine suffix -a (which makes the word first declension) basically means "one who does [whatever the root deals with]" Hence Agricola (farmer), Nauta (sailor), Poeta (poet-which is also of Greek origin), homicida (murderer), etc. I suppose these could be feminine if a wamon had these jobs too.


(Although there are exceptions among nouns, adjectives follow these grammatical rules very strictly)


The Latin words for witch are Venefica (literally "poison maker." This is the one used in the Vulgate to translate the Greek term translated "witch" or "sorcerer," which is derived from the same word as Pharmacist. Biblical references to witchcraft mostly really refer to drug abuse, especially using hallucinogens to make others believe you had divine powers) and Malefica (literally "evil-maker." I think this was a later term used once the concept of witchcraft was more demonic than chemical). The masculine forms Maleficus and Veneficus were not uncommon though, and had the same stigma and translation.
 
woot! Let's hear it for the latin home-boy! (Just saw your location). That was a great explaination, saddly the latin I do know (and had to learn) is like my grammar and spelling, I only use it when it counts and I don't *think* in it, if you follow what I mean.
 
Either maker or doer are right. Fica is from facio, which means either make of do. I used maker because poison-maker makes more sense than poison-doer, and I wanted to translate it the same way both times.
 
^ Ah, Facio. The most entertaining verb in Latin to conjugate when people who don't know what you're up to are around.
 
Back
Top Bottom