Announcement

Collapse
No announcement yet.

Unit Updater

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

  • #31
    Hatschy, I have quickly tested your new code with a new game and an upgraded unit is not keeping its movement order after it is upgraded.

    Another question, is there a way to reload slic as in CtP2, I would like to test your code with the full game I have started monday... the software is looking for the old strings, does not find the UU_NO_UNIT_SELECTED string, send back a string error message and close the game... I have to revert back to the old string file to go on.
    "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

    Comment


    • #32
      Thanks for your answer, installing into the scenario folder was not enough, I had to change a few things but I don't know really what. As far as I am concerned it is almost easier to include both the text and slic files in the appropriate game files and to remove them if I want to play without them.
      If CtP version 1.2 is installed correctly, copying to the "scenarios" folder is enough. The game searches all subdirectories of that folder for "packlist.txt" files. The content is then displayed in the scenario pack selection dialog. After selecting a scenario pack, the scenarios inside the pack (the subfolders "scen0000", "scen0001" etc.) are searched for "scenario.txt" files, which are displayed in the next dialog. When the game is started, the other files, that belong to the scenario, are included (directly or indirectly) by the files that belong to the official game. If that doesn't work for you, then maybe you have tweaked the official files a little bit too much .

      I understand the problem, the said problem has been solved through a cheat in CtP2 (and as far as I remember the first CtP1's unit updater uses the same trick), the AI players are allowed to update freely their old units and are becoming more challenging. It can be frustrating for the human player though... But without these free upgrades isn't the human players given an undue advantage?
      What do you mean by "free" upgrades for the AIs? Does that mean they don't have to pay for the upgrades? This could be implemented, but wouldn't that be unfair?

      By the way, the CtP2 Unit Updater is only allowing the player to update his units when they are in a town or a fortress. Do you think that it should be the case in CtP1?
      Only experience in using the unit upgrade scenario will tell. But a check, whether a unit is in a town should be possible.

      By the way, CtP1 would be close to a perfect game if it had frontiers, like CtP2, that the AI would respect as (bad as) a city radius .
      Is it something that would be hard to code?
      I think that it is not possible to implement this in SLIC code. The concept of borders is completely missing in CtP1.

      Hatschy, I have quickly tested your new code with a new game and an upgraded unit is not keeping its movement order after it is upgraded.
      Upgrading replaces the old unit with a new one. As there is no way to access the current order of a unit, there is also no way to copy the order from the old unit to the new one. What I was talking about was forgetting the order when cycling through the upgradable units with the arrow buttons of the upgrade message box without performing any upgrade. A unit shouldn't forget its order when selected this way. But for the reason mentioned this works only for units that are alone on their tile.

      Another question, is there a way to reload slic as in CtP2, I would like to test your code with the full game I have started monday... the software is looking for the old strings, does not find the UU_NO_UNIT_SELECTED string, send back a string error message and close the game... I have to revert back to the old string file to go on.
      The SLIC code is saved with the game (in a somehow encrypted form) and I don't know of any method to replace that code once the game is started. So you'll have to include the UU_NO_UNIT_SELECTED string in your string file when loading your saved game. But that doesn't hurt in any way, I just removed string, because the message box the string belongs to will never be displayed.

      Comment


      • #33
        Originally posted by hatschy

        If CtP version 1.2 is installed correctly, copying to the "scenarios" folder is enough. The game searches all subdirectories of that folder for "packlist.txt" files. The content is then displayed in the scenario pack selection dialog. After selecting a scenario pack, the scenarios inside the pack (the subfolders "scen0000", "scen0001" etc.) are searched for "scenario.txt" files, which are displayed in the next dialog. When the game is started, the other files, that belong to the scenario, are included (directly or indirectly) by the files that belong to the official game. If that doesn't work for you, then maybe you have tweaked the official files a little bit too much .


        Would you mean that I don't know what I am doing? To some extents I guess that you are right...


        What do you mean by "free" upgrades for the AIs? Does that mean they don't have to pay for the upgrades? This could be implemented, but wouldn't that be unfair?
        You are right this is completely unfair, but as you said it yourself the AI needs some help as it does not know what to do about its money. Perhaps reducing the upgrade cost for the human player would make it less unfair.


        Only experience in using the unit upgrade scenario will tell. But a check, whether a unit is in a town should be possible.


        I think that it is not possible to implement this in SLIC code. The concept of borders is completely missing in CtP1.
        I suppose that someone would have to hack the Civ:CtP executable or would need the source code in order to hardcode it.


        Upgrading replaces the old unit with a new one. As there is no way to access the current order of a unit, there is also no way to copy the order from the old unit to the new one. What I was talking about was forgetting the order when cycling through the upgradable units with the arrow buttons of the upgrade message box without performing any upgrade. A unit shouldn't forget its order when selected this way. But for the reason mentioned this works only for units that are alone on their tile.
        Thank you for your explanation, I was looking for the wrong thing, I will test the new file accordingly the next game I start.


        The SLIC code is saved with the game (in a somehow encrypted form) and I don't know of any method to replace that code once the game is started. So you'll have to include the UU_NO_UNIT_SELECTED string in your string file when loading your saved game. But that doesn't hurt in any way, I just removed string, because the message box the string belongs to will never be displayed.
        Thank you again, I asked this question because there is a command allowing the player to reload the SLIC files in CtP2.

        I have another question, I would like to halve (at least) the number of turns needed for the Military Readiness as IMO the current setting (10 turns) is ridiculously high. I have searched through the various files but I haven't find the line with the said setting. Do you know where I can change it?
        "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

        Comment


        • #34
          There is a problem with the UnitUpgrade path, I can't update my Phalanxes, Legions and Pikemen to Musketeers.

          I have spotted two problems :

          1 - I think I have not written the good unit name in the slic file, I wrote Musketeer whereas the unit name seems to be Musketeers.

          2 - There seems to be a missing line around line 520 :

          messagebox 'UU_M_UpgradeOptionPikeman' {
          Abort();
          uu_curUpgrOpt = uu_curUpgrOpt + 1;
          if (!uu_showUpgradeMessage && uu_upgradeOption < uu_curUpgrOpt) {
          uu_unitToType = UnitType("UNIT_PIKEMEN");
          uu_unitToNameIndex = GetStringDBIndex(ID_UNIT_PIKEMEN);
          uu_canBuildUnit = HasAdvance(g.player, ID_ADVANCE_AGRICULTURAL_REVOLUTION)
          && !HasAdvance(g.player, ID_ADVANCE_GUNPOWDER)
          && !HasAdvance(g.player, ID_ADVANCE_EXPLOSIVES)
          && !HasAdvance(g.player, ID_ADVANCE_MASS_PRODUCTION);
          Message(g.player, 'UU_M_UpgradeOption');
          }
          }


          Am I right ?


          [EDIT]I have just tested my changes (Musketeers and added line) with the Civ: CtP cheat mode and the UnitUpgrade slic file runs fine.[/EDIT]
          Last edited by Tamerlin; June 13, 2006, 14:57.
          "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

          Comment


          • #35
            During the latest test using the cheat mode, I saw that the French welcome text was still too long.

            Here is the string file with a shortened version :
            Attached Files
            "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

            Comment


            • #36
              I have another question, I would like to halve (at least) the number of turns needed for the Military Readiness as IMO the current setting (10 turns) is ridiculously high. I have searched through the various files but I haven't find the line with the said setting. Do you know where I can change it?
              Sorry, I don't know that either.

              There is a problem with the UnitUpgrade path, I can't update my Phalanxes, Legions and Pikemen to Musketeers.

              I have spotted two problems :

              1 - I think I have not written the good unit name in the slic file, I wrote Musketeer whereas the unit name seems to be Musketeers.
              I didn't have any problems upgrading to Musketeers with the last SLIC file I posted. The internal name is MUSKETEERS (plural), right, but for the upgrade function and for the upgrade option function I used 'UU_M_UpgradeMusketeer' and 'UU_M_UpgradeOptionMusketeer', which is not a problem as long as it is kept that way throughout the whole file.

              2 - There seems to be a missing line around line 520 :

              messagebox 'UU_M_UpgradeOptionPikeman' {
              Abort();
              uu_curUpgrOpt = uu_curUpgrOpt + 1;
              if (!uu_showUpgradeMessage && uu_upgradeOption < uu_curUpgrOpt) {
              uu_unitToType = UnitType("UNIT_PIKEMEN");
              uu_unitToNameIndex = GetStringDBIndex(ID_UNIT_PIKEMEN);
              uu_canBuildUnit = HasAdvance(g.player, ID_ADVANCE_AGRICULTURAL_REVOLUTION)
              && !HasAdvance(g.player, ID_ADVANCE_GUNPOWDER)
              && !HasAdvance(g.player, ID_ADVANCE_EXPLOSIVES)
              && !HasAdvance(g.player, ID_ADVANCE_MASS_PRODUCTION);
              Message(g.player, 'UU_M_UpgradeOption');
              }
              }


              Am I right ?
              The standard game does not obsolete Pikemen when Gunpowder is available. You can easily check this with the Cheat Mode editor. Just grant yourself the Agricultural Revolution and Gunpowder advances and you'll see that you can produce Musketeers and Pikemen as well.

              Comment


              • #37
                Thanks for all the answers Hatschy...

                Does anybody else know how to mod the Military readiness?
                "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                Comment

                Working...
                X