The Expression System

1) Okay, I'll be happy with just the number of trade routes.
2) I am avare of autobuild but that only enables the building once the requirements are met. However if the access to the requirements change (like no longer have 2:traderoute: because of civic change) the building won't go inactive. Or will it?
THX for the help anyway :worship:
 
1) Okay, I'll be happy with just the number of trade routes.
2) I am avare of autobuild but that only enables the building once the requirements are met. However if the access to the requirements change (like no longer have 2:traderoute: because of civic change) the building won't go inactive. Or will it?
THX for the help anyway :worship:
Looks like I did not remember that correctly. Only the autobuilt ones for property have the automatic unbuild. While you could attach the building to a property that changes more or less every turn, that is somewhat of a hack. Best solution would probably be if someone added an autounbuild flag to the buildings info and implemented it in CvCity::doAutobuild.
 
A new question:
I see that outcomes can create a new unit from an old one, like upgrade.
Is it possible to create more than 1 unit? Like a "mother" unit creates a "child" unit without killing the "mother".
 
I got no idea how that stuff works but there seems to be a bKill tag for CvOutcomeMission. Maybe that's what your lookin for?

pXML->GetOptionalChildXmlValByName(&m_bKill, L"bKill", true);
 
Any ideas why this code doesn't work?
Code:
            <Actions>
                <Action>
                    <MissionType>MISSION_GROW_UP</MissionType>
                    <ActionOutcomes>
                        <Outcome>
                            <OutcomeType>OUTCOME_GROW_UP</OutcomeType>
                            <iChance>50</iChance>
                            <UnitType>UNIT_MALE</UnitType>
                        </Outcome>
                    </ActionOutcomes>
                    <ActionOutcomes>
                        <Outcome>
                            <OutcomeType>OUTCOME_GROW_UP</OutcomeType>
                            <iChance>50</iChance>
                            <UnitType>UNIT_FEMALE</UnitType>
                        </Outcome>
                    </ActionOutcomes>
                </Action>
            </Actions>
As you see the result should be a Male or a Female unit with 50/50% chances.
But in reality it's always a Male :dunno:
 
Code:
<Actions>
    <Action>
        <MissionType>MISSION_GROW_UP</MissionType>
        <ActionOutcomes>
            <Outcome>
                <OutcomeType>OUTCOME_GROW_UP</OutcomeType>
                <iChance>50</iChance>
                <UnitType>UNIT_MALE</UnitType>
            </Outcome>
            <Outcome>
                <OutcomeType>OUTCOME_GROW_UP</OutcomeType>
                <iChance>50</iChance>
                <UnitType>UNIT_FEMALE</UnitType>
            </Outcome>
        </ActionOutcomes>
    </Action>
</Actions>

An <Action> cannot have two <ActionOutcomes>, but <ActionOutcomes> can have multiple <Outcome>.
Just like <Actions> can have multiple <Action> while the <UnitInfo> cannot have multiple <Actions>.
 
Another question:
Is <GPUnitType> a unit type or a unit class?
In C2C there are no unit classes.... So hard to answer that, as we may have changed it from class to regular when we removed classes.
Would have to go back in version history to when we had unitclasses and check what the dll expects from it there....

I would guess it's just unit type though.
 
I think it's Great Person by Unit Type but it's easy enough to glance at the code to see if it wants a class or type reference by looking down stream at where it's being applied.
 
Back
Top Bottom