Announcement

Collapse
No announcement yet.

Download the Super Apolyton Pack 2 Unit Updater

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

  • #46
    Thanks Peter, I have updated my APOL_Units.txt file. Let me know if you find other mistakes.
    "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

    Comment


    • #47
      Peter, as far as I know, the AI civs are not spending any gold for upgrading their units. As a rule I don't like the AI to be exempted from applying the general rules. Would it be possible to alter the Updater2 code so that the AI civs would have to pay the upgrades?
      "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

      Comment


      • #48
        It wouldn't be at all difficult to charge the AI for updates; getting it to make sure that it's got enough gold to pay for the updates is another question. I would be quite surprised if this could be consistently done: you would more than likely find that you're often sending your modern units to fight antiquated ones.

        Originally, this was my motivation in writing the updater script. I thought that as you progressed through time, there was just too many old units lying around in the game and it wasn't much fun killing them off. It turned out to have a few unexpected side effects: 1) charging the human meant that he had to make added decisions about what to do with his gold, and 2) not charging the AI is like adding another difficulty factor to the game (remember, everybody always used to complain about how easy the game was).

        Comment


        • #49
          Originally posted by Peter Triggs
          (remember, everybody always used to complain about how easy the game was).
          Yeah it is a long time ago since I heard this complaint the last time.

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

          Comment


          • #50
            Peter, your code is indeed better than mine. Pretty much bug free. So that should be the official one! And we can forget about mine

            I must remind you that like Tamerlin I dont like your cheat of free upgrading. But you could make modification in the following handler in which makes the AI upgrades its units in parts depending of the size of the stack it belong (The bigger the stack the more likely to ugrade) and the distance to the nearest city (The unit can only upgrade if in a radius 4 of the city). The only cheat is that the upgrade cost half the gold and the toleranc on the nearest city distance.

            This code can not immediatly be added in you code because there are some different vaariable (Very few ons though). But you may consider thinking about that

            Code:
            HandleEvent(BeginTurn) 'UpgradeAIUnits' post {
            int_t j;
            int_t i;
            int_t k;
            int_t c;
            int_t num;
            int_t tmpPlayer;
            int_t cityCount;
            int_t unitNum;
            unit_t tmpUnit;
            army_t tmpArmy;
            city_t tmpCity;
            location_t tmpLoc;
            	num = 9;
            	tmpPlayer = player[0];
            	if(!IsHumanPlayer(tmpPlayer)) {
            		while(num > 0 && PlayerGold(tmpPlayer) > 300) {
            			for(j = 0; j < player[0].armies; j = j + 1) {
            				GetArmyByIndex(player[0], j, tmpArmy);
            				cityCount = PlayerCityCount(tmpPlayer);
            				for(c = 0; c < cityCount; c = c + 1) {
            					GetCityByIndex(tmpPlayer, c, tmpCity);
            					if(CityIsValid(tmpCity)
            					&& distance(tmpCity.location, tmpArmy.location) < 4
            					&& tmpArmy.size > num) {
            						for(k = 0; k < tmpArmy.size; k = k + 1) {
            							GetUnitFromArmy(tmpArmy, k, tmpUnit);
            							tmpLoc = tmpArmy.location;
            							for (i = 0; i < OLD_UNIT_TYPE.#; i = i + 1){
            								if(tmpUnit.type == OLD_UNIT_TYPE[i]
            								&& HasDataBaseAdvance(tmpPlayer, enadv[i])
            								&& PlayerGold(tmpPlayer) > PER_UNIT_UPDATE_COST[i]) {
            									CreateUnit(tmpPlayer, NEW_UNIT_TYPE[i], tmpLoc, 0);
            									Event: DisbandUnit(tmpUnit);
            									AddGold(tmpPlayer, -PER_UNIT_UPDATE_COST[i]);
            								}
            							}
            						}
            					}
            				}
            			}
            			num = num - 3;
            		}
            	}
            }
            Last edited by Pedrunn; February 27, 2003, 21:43.
            "Kill a man and you are a murder.
            Kill thousands and you are a conquer.
            Kill all and you are a God!"
            -Jean Rostand

            Comment


            • #51
              Originally posted by Peter Triggs
              It wouldn't be at all difficult to charge the AI for updates; getting it to make sure that it's got enough gold to pay for the updates is another question. I would be quite surprised if this could be consistently done: you would more than likely find that you're often sending your modern units to fight antiquated ones.
              Why not allowing the AI Civs to update all their units and just set their treasury at 0 when they don't have enough money?

              I suppose it would also be difficult to ask the AI civs to move their units to a fortification or a town to upgrade their units.

              Originally, this was my motivation in writing the updater script. I thought that as you progressed through time, there was just too many old units lying around in the game and it wasn't much fun killing them off. It turned out to have a few unexpected side effects: 1) charging the human meant that he had to make added decisions about what to do with his gold, and 2) not charging the AI is like adding another difficulty factor to the game (remember, everybody always used to complain about how easy the game was).
              I agree with you the game is much more interesting now you have to fight against an ennemy that has up to date units. The difficulty is higher but the game really benefit from the Updater2.
              "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

              Comment


              • #52
                Peter and Pedrunn,

                I am currently finishing the game I intended to use as a full scale test of the Updater2. So far the Updater2.slc code is working fine and it is greatly improving the game. I actually enjoy it so much I think I would be unable to play a CtP2 game without it.

                Great work Peter and Pedrunn!

                I have only seen one bug, I have been allowed twice or thrice to update a Cavalry unit to a Tank while I had not yet discovered Tank Warfare. I think an AI civs had just discovered it though and that the Updater2 has been somehow confused.

                Would it be possible to allow the Aerial Units to be also updated when they are stationed in an Air Base?

                I am currently working again on new arrays that would allow you to directly update older units (like Pikemen) to their most modern counterpart (like Marines). I have added the new arrays and I now have to compute and add the Gold cost of each array which will be the cumulative cost of all the updates.

                Thanks again for your work Peter and Pedrunn...
                "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                Comment


                • #53
                  I tried the newupdater in a game without modswapper and without mods like APOLPack, cradle etc. and, after minor problems, it seems to work fine. But I get regular messages about global warming??? I tried with a new game so there is no pollution. I have the messages for the updater in a separate file and load this file in strings.txt via import "updater.txt"
                  Last edited by itsamic; March 19, 2003, 12:52.

                  Comment


                  • #54
                    as i just finished (well it became boring) my cradle game with the modified updater i was curious about one thing:
                    what did the powerpoints thingy do in the vanilla game?

                    Comment


                    • #55
                      itsamic,

                      I doubt that has anything to do with the updater code. IIRC, this has occured before in one of the mods, but I can't remember which one.

                      Zaphod,

                      Nothing. They were a freebe data field; that's why I could expropriate it.

                      Comment


                      • #56
                        I've changed the messages from a separate file to a part of info_str.txt. Now the message appears only once, in the first round after loading the game. I'll ignore it....
                        But now I have an other question:
                        I have changed the Update event from the sleep to the move order. Is there an influence to the unit update of the AI? I ask because the AI seems not to update their units.
                        Or can someone give me a tip how to check this?
                        Last edited by itsamic; March 22, 2003, 18:05.

                        Comment


                        • #57
                          That shouldn't make any difference, the AI updates when it gets the advance. But I did change it so that the AI only updates it's units that are not on Human owned land. This is so that you don't instantaneously find yourself fighting a more modern army. You might have to wait a few turns before you see its' more modern units.

                          Comment


                          • #58
                            I use a cheated game to test different things (tech tree, see how diplomod works etc.) If I change to an other civ I can see they have the whole range from Hoplit to Marine. Most units are on their own territory, some are fortyfied, some moves. I looked into the slic but I can't figure out the problem. For my own units the update works fine and it is a great improve at all.

                            Comment


                            • #59
                              I'm in a Good Mood-SAP game but I forgot to add the "include APOL_updater2.slc" to GM1_APOL_script.slc. I f I do this now, can I reload slic and continue with the game or should I start a new one.
                              "Between nations, as between persons, respect for each other's rights is peace".- Benito Juárez.

                              Comment


                              • #60
                                I am not sure Tlatoani but I think it should work after a reloadslic. If you test it and it doesn't work you will just have to remove the line #include... from your GM1_APOL_script.slc to go on with your current game.
                                "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                                Comment

                                Working...
                                X