Announcement

Collapse
No announcement yet.

Question about terrain mod...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about terrain mod...

    I don't know if anyone can help me with this...I'm new to all this mod stuff for CTP so if I've missed something obvious then forgive me. I was wanting to make the game recognize "jungle" and "swamp" as mountain terrain. Not for any other reason except that when you define which terrain types a unit can travel on, land tiles are either "Land" or "Mountain," and I want to play a game where wheeled units like tanks, artillery etc cannot travel in jungle and swamp just like they cannot travel on mountain terrain. I left the name and icon the same for jungle terrain and just changed terrain type to TERRAIN_TYPE_MOUNTAIN hoping that would do the trick. Didn't work though, any ideas?

    This is while playing Med Mod 4 btw, and I used EasyMod to make the change. I checked the terrain.txt file though and copied it into the default Med Mod 4 directory and started a new game a couple of times. Never works though.

  • #2
    Hi Xmon, Well I'm not sure if this will solve the problem but I think it would be a good work around though if it works

    Code:
    TERRAIN_TYPE_FOREST
    TERRAIN_CAN_DIE
    ENV_BASE	{
    ENV_SCORE	84
    ENV_GOLD	0
    ENV_DEAD_GOLD	0
    ENV_FOOD	5
    ENV_SHIELD	20
    ENV_MOVEMENT	200
    ENV_FREIGHT	200
    ENV_MATERIALS	0
    ENV_TIME	0
    ENV_DEFENSE	0.5
    ENV_DEAD_FOOD	0
    ENV_DEAD_SHIELD	0
    }
    That was taken from the TERRAIN_TYPE_FOREST.

    Did you notice ENV_MOVEMENT 200

    Well you might try changing that to a really high number for jungles and swamps. Higher than any unit you don't want to move through. I wonder if it would be impassable to the units you don't want to move through those terrains.

    Of course in the roads definition.
    Code:
    ENV_ROAD1	{
    ENV_MOVEMENT	33
    ENV_FREIGHT	33
    ENV_MATERIALS	200
    ENV_TIME	2
    ENV_ADVANCE	ADVANCE_TOOLMAKING
    }
    the movement is defined as 1/3rd the cost for movement. I don't know about what you want but you could increase the cost of building the roads for that certain terrain type as well to make it more realistic.

    Anyway hope that helps.




    ------------------
    Gemini

    Comment


    • #3
      Hey Gemini,

      Thanks for trying but it doesn't work. Changing ENV_MOVEMENT just makes it harder for all units to move through there. If I wanted wheeled units to have a hard time getting throught and troops to get through easily, I'd have to give troop units too many movement points so that when they were on other terrains they would be too fast.

      I also wondered if that value might not be a movement penalty, and actually be a category for which unit types could move through (if you look at all the terrain types you might see why I considered this) but, alas, it didn't turn out to be that way.

      It's weird, I would've thought changing the "TERRAIN_TYPE_" flag would do the trick. I have no idea where the program keeps the data as to which tile is what terrain type. I hoped to make the game recognize jungle and swamp tiles as mountain while keeping the jungle and swamp icons for appearances.

      Comment


      • #4
        I tried some similar experiments with the terrain text file to try and get the AIs to mine forests, but to no avail. Much of the code in Ctp1 is half-implemented or not implemented at all, so many times things which should logically work do not. A professional programmer I know, who has seen the hard code for Ctp1, said that it looked like something a bunch of kids making their first game had put together. He said it was a wonder the game worked at all.

        Comment


        • #5
          Ok this one is really over the top and a real reach...
          let me know if it works but don't hold your breath.


          In addition to using:
          TERRAIN_TYPE_MOUNTAIN

          also try changing
          TERRAIN_JUNGLE
          to say
          TERRAIN_GREEN_MOUNTAIN

          and
          TERRAIN_SWAMP
          to say
          TERRAIN_WET_MOUNTAIN

          Course I'll really laugh if that works because it will mean the code effectively parses the name of the terrain to determine an attribute instead of looking for a flag within it.

          If that doesn't work then you might try swapping the definition of mountain and swamp in the terrain.txt file. If that works then it means the terrain type is determined by the order in the file.

          Gedrin

          Comment

          Working...
          X