1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. dacubz145

    dacubz145 Deity

    Joined:
    Jun 21, 2010
    Messages:
    3,730
    Location:
    Windy City
    Would that not have to do with the war though? Because there is more civs, more wars, especially in a game with a lot of wars. Then there is less civs, so less wars, less unit movements etc.

    I will run some tests sometime and I can post what I come upo with
     
  2. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    Yes. The obsolete wonder will still count, and thus can block you from building a new wonder to replace it.

    (I haven't actually tested this; I just checked it in the code because I was curious about it.)
     
  3. DeathMaker900

    DeathMaker900 Chieftain

    Joined:
    Jun 12, 2009
    Messages:
    51
    i just noticed my musketmen have the ability to gain the interception promotion. no other unit that isnt supposed to have the promotion is eligible to take it. as far as i can tell the promotion in my mod as well as the unit's unitinfo are exactly the same as vanilla BTS'. how can i remove the promtion from my musketmen? also what prevents unit's like the Infantry from being able to take that promotion seeing as its 'available' to gunpowder units according to the promotion's XML?

    EDIT: ok it appears as though all the units who SHOULD get the promotion cant get it and vice-verse.... is this an SDK problem?
     
  4. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    @DeathMaker900

    Usually (ie. in vanilla BtS), musketmen and infantry are blocked from getting the interception promotion by the following rule in the dll:
    Code:
    	if (kUnit.getInterceptionProbability() == 0)
    	{
    		if (kPromotion.getInterceptChange() != 0)
    		{
    			return false;
    		}
    	}
    
    This rule is checked along side all the other promotion eligibility rules. So, for a unit to be eligible for the interception promotion, it needs to have some non-zero chance of interception already. (Note: a negative inception chance would satisfy this rule.)
     
  5. DeathMaker900

    DeathMaker900 Chieftain

    Joined:
    Jun 12, 2009
    Messages:
    51
    Thanks karadoc! the ==0 got deleted in my SDK which explains the complete swap.
     
  6. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    anyone know how to edit the production cost of settlers?

    I change the icost value, but it doesn't seem to make a difference?
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,118
    Location:
    DE/NL/FR
    It does, just not immediately.
    The cost of the settler is somewhere set in the SDK, so that it can scale better with the different map options. The iCost value is IIRC just a number of additional hammers which is needed, ontop of that calculation. So you'd need C++ coding to really change something there.
     
  8. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
  9. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Ok I am investigating my food resource idea again, I have 1 and a half questions,

    1. is there a good thread that shows what the different tags in the buildinginfos does and how to implement them?

    2. Failing that I have looked at a few of the tags, and I am trying to figure out if or which is the one I want.

    <Bonus>NONE</Bonus>
    <FreeBonus>NONE</FreeBonus>
    <BonusHealthChanges/>
    <BonusHappinessChanges/>
    <BonusProductionModifiers/>
    <BonusYieldModifiers/>

    So what I want to do is have 1 building that has a negative effect on food, but produces a food resource, then another building that uses food resources to add food to the city in which it is built, like a corporation building does.

    I am just not sure which if any of the tags will help me achieve that and if they would how to properly write it?

    Oh I get the health and happiness ones add that for a resource, I was just curious how to code it properly.
     
  10. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,118
    Location:
    DE/NL/FR
    1) the modiki :mischief:?

    2)
    Bonus: You need a resouce for this building
    FreeBonus: Hollywood, Rock'n Roll, Broadway
    BonusHealth/BonusHappinessChanges: e.g. the wheat for the granary
    BonusProductionModifiers: Building is build faster if resource is available (e.g. Statue of liberty with copper)
    BonusYieldModifiers: More production if a resource is available, e.g. Iron Works

    What you want is not available in standard BtS, but there is somewhere a SDK modcomp which would do it.
     
  11. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
  12. DarkC

    DarkC Chieftain

    Joined:
    May 8, 2012
    Messages:
    55
    hey guys, i'm balancing some of the units right now and decided to make the archers available to perform a range attack but i don't want them to become too powerful so i was wondering:
    is it possible to make them perform a ranged attack only if the enemy is standing on the 2nd tile away from them?
     
  13. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,118
    Location:
    DE/NL/FR
    Not without SDK.
    The ranged attack in normal BtS is already somehow a hack, and I don't think there are really more adjustments possible.
     
  14. Civciv5

    Civciv5 Grand Emperor

    Joined:
    Aug 14, 2011
    Messages:
    2,103
    Location:
    Nergenshuizen, Belgium
    I'm going to add an "Utopia Project" into my mod 2100.
    It will be very costly,but it has many positive effects.
    I will need codes for this:
    -Removes unhappiness from all cities in the WORLD
    -All AIs become friendly to the player
    -Nobody can declare war on anyone
    Would that be possible?
    Thank you!
     
  15. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,118
    Location:
    DE/NL/FR
    Yes, possible, but would be totally overpowered, maybe even gamebreaking.
    Should this be a victory condition, or something like that?
     
  16. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    1) Where i can change corporations (not XML) because this is in XML:
    PHP:
                <PrereqBonuses>
                    <
    BonusType>BONUS_CORN</BonusType>
                    <
    BonusType>BONUS_SUGAR</BonusType>
                    <
    BonusType>BONUS_RICE</BonusType>
                </
    PrereqBonuses>
                <
    HeadquarterCommerces>
                    <
    iHeadquarterCommerce>4</iHeadquarterCommerce>
                    <
    iHeadquarterCommerce>0</iHeadquarterCommerce>
                    <
    iHeadquarterCommerce>0</iHeadquarterCommerce>
                </
    HeadquarterCommerces>
                <
    BonusProduced>BONUS_OIL</BonusProduced>
                <
    CommercesProduced>
    This is for Standard Ethanol and mean:
    Consumes: Corn, Sugar, Rice.
    Generate: Oil.
    Where is "Competes with: Cereal Mills, Sid's Sushi Co" Python or SDK or game random make competes depending on what the other corporations generate and what is consumed?

    2)In PythonCallbackDefines.xml i can see this for example:
    PHP:
        <Define>
            <
    DefineName>USE_CANNOT_FOUND_CITY_CALLBACK</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
        <
    Define>
            <
    DefineName>USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
        <
    Define>
            <
    DefineName>USE_IS_PLAYER_RESEARCH_CALLBACK</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
        <
    Define>
            <
    DefineName>USE_CAN_RESEARCH_CALLBACK</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
    but if i set USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK on 1, settlers can build cities on water? And what does all this do in this file and what mean?
     
  17. LateGameWarMong

    LateGameWarMong Warlord

    Joined:
    Jul 28, 2008
    Messages:
    115
    So Privateers were too much fun, I decided to make more units able to attack without a DOW.
    This works fine for other Naval units (specifically, a new class of submarine units) - but I'm having a bit of trouble with land and air units.

    I added a "drone" with a hidden nationality that can attack enemy units without a war dec... the problem is, I can't use it to bomb cities or improvments - just damaging enemy units - sure its a little useful... but not much - if there is no way, then I'll make the drones able to kill units, but thats not what I want ideally.

    I also made a gunpowder unit (limited to a maximum of 5 per player), and made it such that it can go into enemy territory (invisible to most units, but not marines, spies, and workers), it will attack and kill enemy units, pillage improvements, etc...
    But I don't want it to be able to capture cities (This would be OP'd I think), but now I can't even attack enemy units in cities - would this be resolved by removing the invisible condition? I want it to behave like a helicopter unit- can wipe out city defenders, can't capture a city.
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,118
    Location:
    DE/NL/FR
    2 corporations compete with each other if they use the same resources. So you have to assign other resources if you want 2 corps in the same city.

    All entries in this file activate Python functions, which are deactivated (because the game is faster if they are deactivated).
    If you activate them, additional Python can be added to the game.

    Not sure if setting USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK to 1 will allow you to found cities on water. Might need some Python, but you should try it first, if it works without other changes.

    The problem: If you pillage an improvement, then somebody will get money from the pillaging. And that doesn't make sense if the unit has hidden nationality.
    :)hmm: I'm not sure if the privateer can pillage fishing boats)

    I guess to change that, you'd have to make some modifications in the SDK.

    Yes, the invisible condition should be the cause of your problem.
     
  19. Zlatko

    Zlatko CIW

    Joined:
    Apr 1, 2010
    Messages:
    713
    Location:
    Solar System
    Thank you The_J

    CIV4ProjectInfo.xml:
    Spoiler :
    <Type>PROJECT_MANHATTAN_PROJECT</Type>
    <Description>TXT_KEY_PROJECT_MANHATTAN_PROJECT</Description>
    <Civilopedia>TXT_KEY_PROJECT_MANHATTAN_PROJECT_PEDIA</Civilopedia>
    <Strategy>TXT_KEY_PROJECT_MANHATTAN_PROJECT_STRATEGY</Strategy>
    <VictoryPrereq>NONE</VictoryPrereq>
    <TechPrereq>TECH_FISSION</TechPrereq>
    <AnyonePrereqProject>NONE</AnyonePrereqProject>
    <iMaxGlobalInstances>1</iMaxGlobalInstances>
    <iMaxTeamInstances>-1</iMaxTeamInstances>
    <iCost>1500</iCost>
    <iNukeInterception>0</iNukeInterception>
    <iTechShare>0</iTechShare>
    <EveryoneSpecialUnit>NONE</EveryoneSpecialUnit>
    <EveryoneSpecialBuilding>SPECIALBUILDING_BOMB_SHELTER</EveryoneSpecialBuilding>
    <bSpaceship>0</bSpaceship>


    CIV4BuildingInfos.xml:
    Spoiler :
    <BuildingInfo>
    <BuildingClass>BUILDINGCLASS_BOMB_SHELTER</BuildingClass>
    <Type>BUILDING_BOMB_SHELTER</Type>
    <SpecialBuildingType>SPECIALBUILDING_BOMB_SHELTER</SpecialBuildingType>
    <Description>TXT_KEY_BUILDING_BOMB_SHELTER</Description>
    <Civilopedia>TXT_KEY_BUILDING_BOMB_SHELTER_PEDIA</Civilopedia>
    <Strategy>TXT_KEY_BUILDING_BOMB_SHELTER_STRATEGY</Strategy>
    <Advisor>ADVISOR_MILITARY</Advisor>
    <ArtDefineTag>ART_DEF_BUILDING_BOMB_SHELTER</ArtDefineTag>
    <MovieDefineTag>NONE</MovieDefineTag>
    <HolyCity>NONE</HolyCity>
    <ReligionType>NONE</ReligionType>
    <StateReligion>NONE</StateReligion>
    <bStateReligion>0</bStateReligion>
    <PrereqReligion>NONE</PrereqReligion>
    <PrereqCorporation>NONE</PrereqCorporation>
    <FoundsCorporation>NONE</FoundsCorporation>
    <GlobalReligionCommerce>NONE</GlobalReligionCommerce>
    <GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>


    I can't build bomb shelter while I do not finish MANHATTAN_PROJECT. I can do similar like this for some magic project and magic buildings.

    Where is defined Nuclear weapon ban/unban?

    When i finish MANHATTAN_PROJECT i can build NUKES, where i can change that, for example need some another project for nukes?
     
  20. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    It is set to false by default.
    Setting the callback to 1 will just activate it, which still returns false.
    Still have to change it to true
     

Share This Page