Announcement

Collapse
No announcement yet.

GoodMod: The Mod of Goods

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

  • #91
    Originally posted by Maquiladora
    Martin is there any way i can add a second good on Tundra terrain? Youve got one good on tundra (Caribou) but i want another good with different bonuses to the Caribou, is there a way without writing more code to generate a second good on tundra?

    and if there isnt another way, can you tell me how to modify goods.slc to put it in
    To just add a good you just need to modify some text files no new slic is needed, but if you want also a terrain bonus slic is needed.

    You need to modify the following files:

    To add a good at all:

    goods.txt for the good itsself
    terrain.txt to add the good to a certain kind of terrain
    gl_str.txt to give the new good a name
    uniticon.txt to to give the good some images and some text for the Great Libary, note that the GlHidden flag for CTP2 v1.1 does not work
    Great_Libary.txt for some description
    goodsID.txt I am not sure if this is really needed because the sprite indeces in this file are redundant and dublicated with the ones on Goods.txt, however I modified it for GoodMod

    To add a terrain bonus you need to modify:

    tileimp.txt to modify the tileimprovement that gives the terrain boni for the good
    Goods.slc to write some code that places the according tileimps on the tiles with the goods.

    Well GM1_goods.txt should be self explaining just search for "Caribou" and you find an outcommented entry, right below it. You just have to uncomment it and modify it to your needs. Basicly the entry should look like the one for the Caribou. With the exception of the field Probability. The probability of all goods that can appear on a terrain type should be at maximum 1. So the entry there is ok, but can be changed if you don't like the ratio of 1/3 to 2/3. Actual you see 0.5 and 0.25, but as the total probability is not 1 but 0.75 you get to these values.

    GM1_terrain.txt is just an uncommenting job in the according terrain.

    Well you have to do something in GM1_gl_str.txt but just copy 'n' paste 'n' modify the text of the according good you find there.

    For GM1_uniticon.txt: You might have nothing to do except of modification, of an existing entry, everything should be there, and if not it is just again copy 'n' paste 'n' modify.

    GM1_Great_Libary.txt: Here I am sure the entry is there but just needs to be filled with some life.

    GM1_goodsID.txt: Well if it is necessary then you just need to modify one number.

    GM1_tileimp.txt: You need to find this entry:

    TILEIMP_LAND_GOOD_TWO

    There you need to add an terrain effect for tundra.

    GM1_Goods.slc: Here is the most complicate part, but I think I make it easy:

    First rename MG_CreateGoodImprovement2 to MG_CreateGoodImprovement and remove or rename the orignal MG_CreateGoodImprovement. However I thought the first function would be faster, but I doubt that there is a difference.

    Now find this piece of code in the file:

    Code:
    	elseif  (HasGood(MGGoodLoc)==36) {//TERRAIN_TUNDRA_GOOD_ONE // Caribou
    		Event:CreateImprovement(MGPlayer, MGGoodLoc, MGTileImpLandGood1, 0);
    	}
    Copy it and paste it directly under the original version.

    Replace in the duplicate the 36 by 37 and replace MGTileImpLandGood1 by MGTileImpLandGood2 note the 2 at the end. Then you have to increment by one all the numbers in that line in the following entries:
    Code:
    	elseif  (HasGood(MGGoodLoc)==36)
    That should it be, note that you cannot load a savegame that you saved before this modification with this modification. If you try it the game crashs.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #92
      Thanks Martin, it was only the SLIC i was worried about, and i thought it would be easier just to ask you Ill give it a go and get back to you.

      I read that Peter is trying to incorporate the good bonuses into the sourcecode which is excellent too, but as MP is still very buggy in the sourcecode, your mod is a "good" alternative
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • #93
        Worked first time, thanks
        Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
        CtP2 AE Wiki & Modding Reference
        One way to compile the CtP2 Source Code.

        Comment


        • #94
          Martin

          I was trying to read the code and it loolks like the imps create a good, but you have it preset to randomly add new goods. I was think is it possible to make the SLIC so that the #3 and #4 goods that you added are not randomly placed but instead appear after an adavnce is reached?

          2) is it possible to edit imps so that certain imps can only be built on certain goods (new ones probably)

          3) make it so the player can only build a few good improvements? (I'm thinking about planting cotton instead of it appearing)

          thanks, I might have more questions


          PS have you looked into the code to see how more goods can be added like the hard coded ones?
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • #95
            Originally posted by E
            I was trying to read the code and it loolks like the imps create a good, but you have it preset to randomly add new goods. I was think is it possible to make the SLIC so that the #3 and #4 goods that you added are not randomly placed but instead appear after an adavnce is reached?
            Actual the tile improvements only improve the good tile by providing their food/prod/gold boni to that tile with the good on it. So you have first to prevent the game from placing the goods on the map, I think there was something about the probability, or you could remove the good via slic, and then place another one. And later you can place goods of that type you removed. For that you need this specific good place function added by The Big MC to our version of the game.

            [QUOTE] Originally posted by E
            2) is it possible to edit imps so that certain imps can only be built on certain goods (new ones probably)

            You would need to check whether the terrain has a good and if not to stop the player from placing it if not.

            Originally posted by E
            3) make it so the player can only build a few good improvements? (I'm thinking about planting cotton instead of it appearing)
            You would need to count the good improvements of each type you have and prevent the player from placing these improvements via slic, if there are too many of them or they are too close, etc...

            And of course for these kind of improvements you need to find empty spots in the button bank.

            And another ugly side effect is that the GUI suggerate that the improvement can be placed, but nevertheless the slic doesn't allow to place it. And of course the AI.

            Originally posted by E
            PS have you looked into the code to see how more goods can be added like the hard coded ones?
            Which hard encoded goods? There are no hard encoded goods, there is just a limit of 4 goods per terrain type. And of course this can be increased. And there is no need to look it up in the code to come to this statement.

            -Martin
            Civ2 military advisor: "No complaints, Sir!"

            Comment


            • #96
              Thanks Martin, I THINK I understand everything.

              So the improvement only add a bonus to the good, not the good itself...

              As for:
              2) is it possible to edit imps so that certain imps can only be built on certain goods (new ones probably)

              You would need to check whether the terrain has a good and if not to stop the player from placing it if not.

              I guess i have to use Hasgood function ahnd then block it, so I'll llok for slic to help with that. BUt does the hasgood with getdistance slic allow me to:

              Find a tile with a good then find the nearest city (using get distance of 2) then (using ATG elephant code) allow only that city to make units if advance is available ?

              Or even more complex find a good, allow tile improvement, then get distance (say two tiles) and allow only specific units to be built?

              I'll try to find code to match this but if you can think of any that may help this please let me know.
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment

              Working...
              X