Announcement

Collapse
No announcement yet.

Problem in GM1_Goods.slc (in Cradle 1.35)

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

  • Problem in GM1_Goods.slc (in Cradle 1.35)

    After a pretty long hiatus, I've come back to see what the product of all the hard work on CtP2 mods have yielded, and thought I'd give Cradle a shot...

    I've installed CtP2 (fresh install), The 1.11 patch, modswapper and Cradle 1.35. CRA_Goods.slc is GM1_Goods.slc v.1.6

    I started checking out what could be done in the editor (using a 100x200 map.) I put some goods clustered together for a test. I had some issues with goods; when starting the scenario, not all of the new additional goods I placed have their associated underlying terrain improvements. The issue is reproducable. At first I thought it might be due to the number of goods on the map, however, I reproduced the problem on another map, which I started from scratch.

    It seems to happen often when goods are placed close together (within a square.) Some or all of the goods may or may not be affected.

    It can be easily reproduced if you start the editor with a small map, place a couple of 3x3 blocks of goods close to your start location, and start it as a scenario.

    It can be worked around since its not necessarily a critical issue; you don't often need to place resources close together like that, but might want to in a scenario.

    Any thoughts?

    MrBaggins

  • #2
    I think it's probably caused by the fact that the 'good' tile improvement placement only happens once, when the map is generated for the first time. When you place goods again afterwards, they do not get the tile improvements done underneath.

    Try starting the scenario, then opening the chat window (press ' ), type /reloadslic, press enter...
    Next turn, the tile improvements should be placed underneath the tiles.
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

    Comment


    • #3
      The code is being executed: the fresh map has the goods placed... is saved as a scenario, then started as a new game. The code in question is executed (I checked with a message box.) However it doesn't handle all cases.

      Could it be that somehow the improvement is 'cut' before its finished, when the resources are grouped closely (and just hasn't been seen since its not been used in this situation before) I'm trying a few things with the code to see if I can come to a solution, but other peoples effort is appretiated.

      MrBaggins

      Comment


      • #4
        Next thing we know CD and Nordicus will be posting.

        Good to see you again MrBaggins!

        Comment


        • #5
          Originally posted by MrBaggins
          Could it be that somehow the improvement is 'cut' before its finished, when the resources are grouped closely (and just hasn't been seen since its not been used in this situation before) I'm trying a few things with the code to see if I can come to a solution, but other peoples effort is appretiated.
          That's not the problem all auxiliry tile improvements are cut before the good tile improvement is finished. The problem is that the auxiliry tile improvement is placed on a random neighbour terrain tile of the good and if there is a good then the good tile improvment is cut of with the auxiliry tile improvement.

          To test this you could go to the MG_CutUnitImprovement event handler, there is CutImprovement event called, comment this line out and you should get a map with a lot of terrain owned by the Barbarians, and you should also find some of them on goods with the good improvement. The alternative would be to put the tile imps of your new goods manually on the map. They should be on the map if you create a scenario. But then you have to disable the good improvment process. That can be done by going to the MG_NewGoodImprovement event handler and find there these lines:

          if (GetCurrentRound () == 0 ) {//&& player[0] == 1
          elseif (GetCurrentRound () > 1) {//if someone reloads slic

          by

          if (GetCurrentRound () == -1 ) {//&& player[0] == 1
          elseif (GetCurrentRound () > -1) {//if someone reloads slic

          That has the effect the good improvement code is never executed in the scenario game (remember the tile imp locations should be saved with the map, so no need to put them again on the map). In the original scrip the good improvment process is only executed on turn 0, otherwise the code will be disabled. In the new version would be run the good improvement code on turn -1, as there is no turn -1 it is never executed, so that the elseif statement is always true and will disable the code.

          I think it is possible to work out a sollution to improve the goods without the auxiliry improvement but this needs time that I don't have, unfortunatly.

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

          Comment


          • #6
            Thanks for the feedback

            I had a thought about a possible solution and it seems to work... although I'm going to test it out more.


            I replaced the following four lines of "HandleEvent(BeginTurn)'MG_NewGoodImprovement'pre {"

            Code:
            GetRandomNeighbor(MGGoodLoc, MGUnitLoc);
            CreateUnit(0, UnitDB(UNIT_BOMBER), MGUnitLoc, 1, MGGoodUnit);
            Event:CreateImprovement(0,MGUnitLoc, MGTestImp,0 );
            Event: DisbandUnit(MGGoodUnit);
            with

            Code:
            for (k=0; k<=7 ; k=k+1) {
               GetNeighbor(MGGoodLoc, k, MGUnitLoc);
               if( HasGood(MGUnitLoc) == -1 ) {
                  CreateUnit(0, UnitDB(UNIT_BOMBER), MGUnitLoc, 1, MGGoodUnit);
                  Event:CreateImprovement(0,MGUnitLoc, MGTestImp,0 );
                  Event: DisbandUnit(MGGoodUnit); 
                  k=k+7;
               }
            }
            you need to initialize k with
            Code:
            int_t k;
            in the header of the event.


            Essentially, rather than randomly picking a neighbor square to place the unit and test tile imp on, it picks the first one without a good on.

            I thought it might not work on a 3x3 grid of goods, but I was wrong... that seems to work ok too.

            mrbaggins

            Comment


            • #7
              Speaking of tile improvements, remind me it has been awhile since I looked at this, but in CTP2 do any goods add to the food a tile brings into the city? I know Civ 3 has wheat and CTP had this also (it is easier to see when you move citizens around). Just wondering.

              Comment


              • #8
                In the default CTP2 game no good gives a food, gold or production bonus for your city. This was possible in CTP1 but not in the default game, too. In CTP2 it was intended but because of bugs or unfinsihed work it doesn't work, therefore I have to use the workaround to place invisible Tile Improvements on the good tiles to add such a terrain bonus.

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

                Comment


                • #9
                  What mods have that feature and which goods do they effect? Can I see the bonus in the game someway easily?

                  Comment


                  • #10
                    GoodMod is basically what you are looking for. Its available as an addon to CityMod2, MedPack2 and the Apolyton Pack, and its also included in Cradle of Civilization.

                    Find what you need here

                    To discover what bonuses, just right click a square, or view the civilopedia entries for the trade goods.

                    Comment

                    Working...
                    X