Development Thread

If anything, adding it makes it harder. If someone is using female GPs, then he has the proper schema file anyway.
 
That's what I was thinking, and since that also requires less work for me I'm happy to say, "Done and done!" ;)
 
I haven't had a great person pop yet, but the XML is read just fine.
Yes, XML reads fine. Great People being born always gives me error messages about the female version of a unit not being found.
Code:
Assert Failed

File:  .\CvGlobals.cpp
Line:  3618
Expression:  strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message:  info type UNIT_SCIENTIST_FEMALE not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml


CvPlayer::createGreatPeople always calls kUnit.getFemaleUnitType(), and CvGlobals::getInfoTypeForString will not find anything and give me that assert.
 
Shoot, is there a form that doesn't perform an assertion? I need a "findInfoTypeForString" that ignores missing keys which I might have to add.
 
It's not like it's not working. If getInfoTypeForString can't find any info for the string it returns -1, which equals NO_UNIT, so it does exactly what you want it to, no need for anything new. The function simply assumes you know what you are searching for and expects that the info actually exists.
 
But don't you get the popup when running a debug build? That's kind of annoying since I know up front that the type might not exist. As long as it doesn't do anything bad in the release build, I'm okay to leave it as-is.
 
Just having a look at the city tile status feature now, very cool. I saw that the colors and transparencies are customizable in XML. That said, I'm confused why you left working and not-working the same. Makes me think I'm not using the feature the way you intended. For example, what good is it to highlight improved and improvable tiles in an indistinguishable way? Or where you assuming people would choose one or the other? Also seems like the colors are backwards. Shouldn't working an improved tile be good/green?

In any event, I'm after the highlights that are selected in the first screenshot. I want to know when a city is working a tile that isn't improved. May have spotted a problem with the camp immediately north of Xian. Through process of elimination, that circle is there when only "improvable w. bonus" is checked. Trouble is, it's already improved, and shouldn't be highlighted.
 

Attachments

  • Civ4ScreenShot0028.JPG
    Civ4ScreenShot0028.JPG
    220.5 KB · Views: 323
  • Civ4ScreenShot0029.JPG
    Civ4ScreenShot0029.JPG
    203.8 KB · Views: 335
Yes, this is something I didn't have time to correctly address. The camp is highlighted as improvable because it does not have a route. While the game provides the bonus if it is next to a river, the AI still flags it as needing a route. I'll probably address this in an early patch because it's rather annoying. I probably should also have added an option to ignore routes since the city's yield is the same whether the route is there or not.

As for the same colors, I originally had no configurability so perhaps I left two colors the same. Worked improved tiles should be white to mimic what you see in the city screen (working equals white). There's nothing to be done about those tiles so I don't want them "highlighted" with a color. Similarly, not worked unimprovable tiles are black as again there's nothing to be done. I'll double-check the colors tonight.

BTW, if you select multiple cities all of their tiles are circled, but only the "first" city has its area shaded. I did this so you could select neighbors and still tell whose tiles are whose. Does this make sense, or is it too disjoint? I think 99.9% of the time you'll select only a single city anyway so it probably doesn't matter, but I'd like to do the right (useful) thing in the other 0.1% cases, too.
 
Hi Boys. :D

It sounds like the new tag is causing problems. Here is a little detail on how I implemented the <bFemale> tag in the new BAT.

I added it so that any unit could be tagged as female, not just Great People, Missionaries, and CEOs. My thought was to make a tag where a modder could easily differentiate between a male and female version of a unit, if desired.

This is a snip from a relevant schema:

Code:
    </ElementType>
        <ElementType name="LeaderPromotion" content="textOnly"/>
        <ElementType name="iLeaderExperience" content="textOnly" dt:type="int"/>
        [COLOR="Red"][B]<ElementType name="bFemale" content="textOnly" dt:type="boolean"/>[/B][/COLOR]
        <ElementType name="UnitInfo" content="eltOnly">
            <element type="Class"/>
            <element type="Type"/>
            <element type="UniqueNames"/>
            <element type="Special"/>
    ...
        
<!-- Snip -->
    ...

    <element type="Strategy"/>
        <element type="Help" minOccurs="0"/>
        <element type="Advisor"/>
        [COLOR="Red"][B]<element type="bFemale" minOccurs="0"/>[/B][/COLOR]
        <element type="bAnimal"/>
        <element type="bFood"/>
        <element type="bNoBadGoodies"/>
   ...

And this is how it's implemented in BAT's FUnit module CIV4UnitInfos.XML:

Code:
    ...
    <Description>TXT_KEY_UNIT_GREAT_PROPHET</Description>
    <Civilopedia>TXT_KEY_CONCEPT_GREAT_PEOPLE_PEDIA</Civilopedia>
    <Strategy>TXT_KEY_UNIT_GREAT_PROPHET_STRATEGY</Strategy>
    <Advisor>ADVISOR_RELIGION</Advisor>
    [COLOR="Red"][B]<bFemale>0</bFemale>    <!-- Set to 1 for female unit -->[/B][/COLOR]
    <bAnimal>0</bAnimal>
    <bFood>0</bFood>
    <bNoBadGoodies>0</bNoBadGoodies>
    <bOnlyDefensive>0</bOnlyDefensive>
    
    ...

The actual <Type> tag as implemented in the BULL DLL is:

Code:
    <UnitInfo>
        <Class>UNITCLASS_PROPHET</Class>
        [COLOR="Red"][B]<Type>UNIT_PROPHET_FEMALE</Type>[/B][/COLOR]
        <UniqueNames>
            <UniqueName>TXT_KEY_GREAT_PERSON_RUTH</UniqueName>
            <UniqueName>TXT_KEY_GREAT_PERSON_ESTHER</UniqueName>
            <UniqueName>TXT_KEY_GREAT_PERSON_SARAH</UniqueName>
            
    ...

Maybe that will help a little? :)
 
Thanks to a tip from Afforess, who is currently in exile from CFC, I added a second "true" parameter to getInfoTypeForString() which is aptly named bIgnoreAsserts. ;) Problem solved.
 
Yes, this is something I didn't have time to correctly address. The camp is highlighted as improvable because it does not have a route. While the game provides the bonus if it is next to a river, the AI still flags it as needing a route. I'll probably address this in an early patch because it's rather annoying. I probably should also have added an option to ignore routes since the city's yield is the same whether the route is there or not.
I was still confused before I realized that there's no road there. That area was recently pillaged in a war, and I forgot to rebuild it. Makes sense now.

BTW, if you select multiple cities all of their tiles are circled, but only the "first" city has its area shaded. I did this so you could select neighbors and still tell whose tiles are whose. Does this make sense, or is it too disjoint? I think 99.9% of the time you'll select only a single city anyway so it probably doesn't matter, but I'd like to do the right (useful) thing in the other 0.1% cases, too.
This sounds fine to me. Unless you want to get real fancy and change the highlight with each new city selection, this should suffice just fine. Two clicks switching between adjacent cities can clue you in. I don't think it's worth the extra effort.
 
This sounds fine to me. Unless you want to get real fancy and change the highlight with each new city selection, this should suffice just fine. Two clicks switching between adjacent cities can clue you in. I don't think it's worth the extra effort.

Hmm, they are probably stored in the order they were selected (except when using ctrl or alt where it's the natural order of the cities), but I don't know for sure. I'll see what people say about it and revisit it later.
 
Hmm, they are probably stored in the order they were selected (except when using ctrl or alt where it's the natural order of the cities), but I don't know for sure. I'll see what people say about it and revisit it later.
How do you select sities without using ctrl? I select one city, ctrl-select another and only one city's tiles are shaded, and the order of selection doesn't matter, only the order of founding/aquiring does - older city goes shades.
Nothing serious and I don't really know any way around it.
 
How do you select sities without using ctrl? I select one city, ctrl-select another and only one city's tiles are shaded.

It sounds like you're shift-selecting which allows you to select any number of cities. If you control-select a city, it selects all cities on the continent. Alt-select selects all cities in your empire.
 
The majority of BUG dev occurred while EF was in-between jobs. He since got rehired, and is busy, I assume.
 
The majority of BUG dev occurred while EF was in-between jobs. He since got rehired, and is busy, I assume.
Yes, I think I'm the only one without a life right now, hence my appearance here tonight. :lol:

I know that he has some ideas on the go, but time is a luxury that he (and I - not sure about ruff) doesn't have atm.
 
I'm sort of out of ideas at the moment. I do have one but that is just way toooo big to actually want to start.

Anyone got any python related changes that they want to see in BUG?
Spoiler :
That last line was probably the biggest mistake I'll make this year - asking for work. Not promising that anything at all actually gets done :D.
 
I was hoping to write up a nice "here's what's happening now, why I'm not modding at the moment, and what to expect in the future" post, but I just don't have the time or energy so I'll just quickly answer your question. Afforess is right about part of that, but even when I was working I devoted all my free time (literally four-five hours every night after work and all weekends) to BUG because, well, I had no life, I really loved modding, and I played Civ4 on occasion.

While I still have no life per se, I am working longer and also just a bit burned out from doing the above. Plus, Civ5 really took the wind out of my sails. I love that it's hex based . . . and that's it. It is otherwise pretty much the same game. :( And while they did a lot of work to enable in-game browsing of mods, the whole modding system is much more intensive. No doubt it provides more features, but since the game was such a let down I haven't been inclined to start modding for it.

As for Civ4 modding and BUG, I just need to take an extended break before continuing, but I do hope to pick it up again as it was really fun.
 
Take your time, you deserve it. Civ community will always be grateful for the effort you've done.
 
Back
Top Bottom