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

More than one person per tile?

Discussion in 'Civ4Col - Creation & Customization' started by Commander Cody, Jan 4, 2015.

  1. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    How would I go about making it so that more than one person can work a tile? I am asking because I think it would be a great way to make say indenture servants a useful concept as per say I could have 2 or 3 of them working one tile in a city.
     
  2. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    This would take some heavy coding in C++ and Python. I attempted once to allow two cities to use the same plot and there is just a slew of issues with this, so sorry, this won't be easy to do.
     
  3. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    Thanks for the response Kailric.

    Would you know how to make a building output raw goods instead of finished goods per the person working on it? I have figured out how to use the "native unit" and have copied it and changed the name to make it into a native slave unit and my thought was to have a plantation building where the native slaves would be applied to, and it would output small amounts of cotton, tobacco, and sugar.
     
  4. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    That would be handled in CIV4ProfessionInfos.xml. In the below code you see the <YieldsProduced>. You will also have to create a new Building and Special Building type as well, like so...

    CIV4BuildingInfos->BUILDING_PLANTATION
    CIV4BuildingClassInfos->BUILDINGCLASS_PLANTATION
    CIV4SpecialBuildingInfos->SPECIALBUILDING_PLANTATION

    Then in Professions add your new Slave profession...
    Code:
    <ProfessionInfo>
      <Type>PROFESSION_SLAVE</Type>
      <Description>Put Description here</Description>
      <Civilopedia>Pedia entry here</Civilopedia>
      <Strategy>Strat here</Strategy>
      <Help/>
      <Combat>NONE</Combat>
      <DefaultUnitAI>NONE</DefaultUnitAI>
      <SpecialBuilding>SPECIALBUILDING_PLANTATION</SpecialBuilding>
      <bWorkPlot>0</bWorkPlot>
      <bCitizen>1</bCitizen>
      <bWater>0</bWater>
      <bScout>0</bScout>
      <bCityDefender>0</bCityDefender>
      <bCanFound>0</bCanFound>
      <bUnarmed>0</bUnarmed>
      <bNoDefensiveBonus>0</bNoDefensiveBonus>
      <iCombatChange>0</iCombatChange>
      <iMovesChange>0</iMovesChange>
      <iWorkRate>0</iWorkRate>
      <iMissionaryRate>0</iMissionaryRate>
      <iPower>0</iPower>
      <iAsset>0</iAsset>
      <YieldEquipedNums/>
      <FreePromotions/>
      [COLOR="Red"]<YieldsProduced>
        <YieldType>YIELD_BARLEY</YieldType>
      </YieldsProduced>[/COLOR]
      <Button>Button info here</Button>
      <ProfessionSubTypes/>
    </ProfessionInfo>
    There plenty of tutorials on this sight. You will also need to edit Python in order to make a place for your Building. Here is the list of Colonization tutrials.. http://forums.civfanatics.com/showpost.php?p=8341500&postcount=1. Note the one on adding new buildings.

    Since Colonization is a mod of Civilization 4 you can often use tutorials from it for Colonization as well. Hopes this helps :goodjob:
     
  5. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    How do you make a building produce more than 1 Yield?

    I do not see this line:

    <YieldsProduced>
    <YieldType>YIELD_BARLEY</YieldType>
    </YieldsProduced>

    All I have at my disposal are these tags:
    <ProfessionInfo>
    <Type>PROFESSION_SLAVE</Type>
    <Description>TXT_KEY_PROFESSION_SLAVE</Description>
    <Civilopedia>TXT_KEY_UNIT_SLAVE_PEDIA</Civilopedia>
    <Strategy>TXT_KEY_PROFESSION_FARMER_STRATEGY</Strategy>
    <Help/>
    <Combat>NONE</Combat>
    <DefaultUnitAI>NONE</DefaultUnitAI>
    <YieldProduced>YIELD_SUGAR</YieldProduced>
    <YieldConsumed>NONE</YieldConsumed>
    <SpecialBuilding>SPECIALBUILDING_PLANTATION</SpecialBuilding>
    <bWorkPlot>0</bWorkPlot>
    <bCitizen>1</bCitizen>
    <bWater>0</bWater>
    <bScout>0</bScout>
    <bCityDefender>0</bCityDefender>
    <bCanFound>0</bCanFound>
    <bUnarmed>0</bUnarmed>
    <bNoDefensiveBonus>0</bNoDefensiveBonus>
    <iCombatChange>0</iCombatChange>
    <iMovesChange>0</iMovesChange>
    <iWorkRate>0</iWorkRate>
    <iMissionaryRate>0</iMissionaryRate>
    <iPower>0</iPower>
    <iAsset>0</iAsset>
    <YieldEquipedNums/>
    <FreePromotions/>
    <Button>,Art/Interface/Buttons/Civilizations/Colonization_Civilizations_Leaders.dds,3,8</Button>
    </ProfessionInfo>

    Perhaps I am missing something?

    Otherwise I got everything else to work perfectly. Your advice and tutorial references were excellent.
     
  6. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    Just out of my head (without having checked with the xml-files) there should be a "modificator" tag in either the building or the profession xml-file which allows you to enhance (or reduce) the output of the respective profession (percentage-based, so something like "100" would mean doubling the output).
    Actually, I guess it will be located in the building, as the higher level buildings typically give you an enhanced output, too. Just have a look there.
     
  7. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Oh yeah, I forgot, that is a mod that is allows you to have more than one yield output. It's the Multiple Yields per building mod, or something like that. Without it you are only limited to one output and one input.
     
  8. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    I did a manual search going through all the mod pages looking for Multiple Yields produced or something along those lines. Found Multiple Yields Consumed, but the link to that one was dead.
     
  9. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Multiple Professions Per Building (by Androrc) and Multiple Yields Consumed / Produced (by Aymerick)
    were both integrated (and significantly improved over the years) in Religion and Revolution.

    So you could take a look in our sources (that are provided with our download).
    It will require programming skills (C++ and Python) though to adapt them to another mod.
     
  10. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    @raystuttgart

    Thanks for the suggestion. I have looked at Religion and Revolution. The problem is that reverse engineering it is beyond my abilities. I tried to borrow just the Africa screen and area I could not get that too work, and I even tried just doing it from the Triangle Trade Mod which mainly just centers on that.

    Honestly it would be nice if certain components were posted by themselves. Let people pick and choose which stuff that they like and want.
     
  11. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Well, even the most experienced and skilled modders started like that.
    All it takes is enough motivation and time.

    Adapting such features to your mod will require some programming skills of course.
    But a beginner in programming (with basic programming skills) should still be able to adapt "Africa" to his mod in about one or two weekends.

    If you have specific questions about some code, simply post them in the forums.
    There are still people around that could (and most likely will) answer.

    There are technical limitations to that.
    (The game can have only 1 single core logic DLL for example.)

    For some features (basic) ModComps exist.

    If you know programming and commenting is good, it does not make such a big difference if the code you use is inside another (big) mod or inside a (small) ModComp.

    In fact the big mods are usually the better place to look at, because their implementations have become far more advanced and stable than the (old) original ModComps.
    (ModComps are often missing functionality and usually still contain a lot of issues.)

    ----

    Good luck with your modding. :thumbsup:
     
  12. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    Actually you do not need a mod for 2 professions per unit. I found a very easy work around utilizing the existing XML in the game. Here is my fix:

    <ProfessionMeshGroups>
    <UnitMeshGroups>
    <ProfessionType>PROFESSION_SLAVE_COTTON</ProfessionType>
    <fMaxSpeed>1.25</fMaxSpeed>
    <fPadTime>1</fPadTime>
    <iMeleeWaveSize>1</iMeleeWaveSize>
    <iRangedWaveSize>1</iRangedWaveSize>
    <UnitMeshGroup>
    <iRequired>1</iRequired>
    <ArtDefineTag>ART_DEF_UNIT_BRAVE</ArtDefineTag>
    </UnitMeshGroup>
    </UnitMeshGroups>
    <UnitMeshGroups>
    <ProfessionType>PROFESSION_SLAVE</ProfessionType>
    <fMaxSpeed>1.25</fMaxSpeed>
    <fPadTime>1</fPadTime>
    <iMeleeWaveSize>1</iMeleeWaveSize>
    <iRangedWaveSize>1</iRangedWaveSize>
    <UnitMeshGroup>
    <iRequired>1</iRequired>
    <ArtDefineTag>ART_DEF_UNIT_BRAVE</ArtDefineTag>
    </UnitMeshGroup>
    </UnitMeshGroups>
    </ProfessionMeshGroups>

    Did not need any fancy python coding or DLL fixing. A very simple fix. Lets one unit be a professional at two different buildings.
     
  13. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,513
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Spoiler :



    You are confusing things a bit.

    1. <ProfessionMeshGroups> is graphical configuration and nothing else. There is no real feature functionality related to it.
    (It only says, which graphics the unit should display for a specific profession.)

    2. There is no limitation (in Vanilla and most mods) that disallows a (Setter-like-)Unit to work in different Professions (in different Buildings).
    But if you want to have several Professions working in one and the same Building, you will need to touch DLL and Python.

    ----------

    It is important to understand:

    XML is not logic but only simple configuration (for existing logic).
    The logic is inside of the DLL and the Python coding.

    If functionality is already implemented in the logic and configuration elements in XML are already available, you can use it of course.
    But completely new functionality will always require coding.

    ----------

    Good luck with your modding. :thumbsup:
     
  14. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    You are correct that with that raystuttgart.
     
  15. Androrc the Orc

    Androrc the Orc Emperor

    Joined:
    Apr 19, 2004
    Messages:
    1,621
    Location:
    Vienna, Austria
    Rather nice to see my old modcomps still mentioned nowadays :)
     
  16. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yes, we are keeping them fresh ;)
     
  17. Sanotra

    Sanotra Wannabe Modder

    Joined:
    May 16, 2007
    Messages:
    668
    Location:
    Wa - USA
    Multiple units working the same tile. That only makes sense. If you can stuff 2 or 3 units into a building to increase building output, it only makes sense that you could stuff 2 or 3 units onto a tile to increase tile output. Additional units assigned to buildings requires building upgrades (ex: small building 1 unit to giant building 3+ units, etc.), it could be that upgrades to the tile increase how many workers can work the tile (ex: small farm 1 unit to giant farm 3 units, etc.). Very cool idea. Maybe I can add it to radical concepts? Is that ok Commander Cody?
     
  18. Commander Cody

    Commander Cody Chieftain

    Joined:
    Nov 27, 2008
    Messages:
    28
    I am completely fine with that. Use any of my ideas as you like.
     

Share This Page