1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Strange TerrainImpassable TERRAIN_HILL did not work

Discussion in 'Civ4 - Creation & Customization' started by Manifold, Jan 12, 2010.

  1. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,074
    Did anyone noticed, that this did not work:

    <TerrainImpassables>
    <TerrainImpassable>
    <TerrainType>TERRAIN_HILL</TerrainType>
    <bTerrainImpassable>1</bTerrainImpassable>
    </TerrainImpassable>
    </TerrainImpassables>

    Very strange - or is it my mistake?
     
  2. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,399
    Location:
    The Matrix
    Hills are handled differently (like Peaks) and I don't think you can make them impassable for individual units without at least some Python coding (I'd strongly suggest SDK for this though).
     
  3. Willem

    Willem Chieftain

    Joined:
    Feb 12, 2002
    Messages:
    7,313
    Location:
    Canada
    Hills aren't a specific terrain type like Mountains so that usage won't work with them. The only thing that command will work for is the base terrains like Grassland, Plains etc. Mountains are a base terrain, that's why they function as they do. Hills aren't.
     
  4. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,238
    Location:
    North Carolina, USA
    I had to do some sheninagins in the SDK for this normal list to work in the XML. It's because Hills and Peaks and actually PlotTypes, not Terrain Types, and are listed as Terrain Types purely for the civilopedia's sake.
     
  5. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,074
    Maybe i can take a look. Where do i find your work.
    But meentime i solved the problem by creating a new "terrain" and give it to the hills, that seems simple and looks great; just unfortunately is there now a new terrain-entry in the pedia.
     
  6. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,238
    Location:
    North Carolina, USA
    If you are up to creating a custom dll and editing the SDK (Being able to make SDK changes is very liberating... :mischief:), then I can tell you what to change to make that XML work.

    In CvUnit, search for this line:
    Code:
    if (m_pUnitInfo->getTerrainImpassable(pPlot->getTerrainType()))
    Replace it with this new code:
    Code:
    			bool bPeak = false;
    			bool bHill = false;
    			if (m_pUnitInfo->getTerrainImpassable(GC.getInfoTypeForString("TERRAIN_HILL")))
    				bHill = true;
    			if (m_pUnitInfo->getTerrainImpassable(GC.getInfoTypeForString("TERRAIN_PEAK")))
    				bPeak = true;
    			if (m_pUnitInfo->getTerrainImpassable(pPlot->getTerrainType()) || (pPlot->isPeak() && bPeak) || (pPlot->isHills() && bHill))
    After you compile,
    putting TERRAIN_PEAK or TERRAIN_HILL will work in the XML, at least for that code. I think there are still other places Terrains will need fixing.
     
  7. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,074
    Thank you very much, but

    sounds :crazyeye: For now i will use the russian method: Who cares the pedia? The main thing is, it works.:D

    However thank you, i will keep this in mind.
     
  8. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,238
    Location:
    North Carolina, USA
    IMHO, Aesthetics are everything, but if you like your way better, great. :p
     
  9. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,756
    Location:
    Germany / Netherlands
    Hiding the new terrain by hardcoding it in the python should not be so difficult...
     
  10. Manifold

    Manifold ModderProtectionAdvocate

    Joined:
    Aug 27, 2007
    Messages:
    1,074
    Admittedly my method is some practical. Usually i just use Aesthetics to get the GREAT_LIBRARY.

    Ok, Aesthetics, so i have the choice between

    :confused:

    and

    :crazyeye:
     

Share This Page