Announcement

Collapse
No announcement yet.

Download the Super Apolyton Pack 2 Unit Updater

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

  • #31
    Originally posted by Tamerlin
    Peter is working on a new version of his updater, you should look higher on this page if you want to see how it works, one of the main differences is you can update your units in the turns following the discoveries through the sleep order.
    Obviously I missed something. Although I read (not shure if I really did) Peter's post, but unfortunatly I had to much to do in the last weeks.

    But for the updater itself it is questionable to release code that is not properly debugged, if he send it to you and he has later to rewrite something then you could do the converting process again or has to find the changes.

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

    Comment


    • #32
      Originally posted by Martin Gühmann
      But for the updater itself it is questionable to release code that is not properly debugged, if he send it to you and he has later to rewrite something then you could do the converting process again or has to find the changes.

      -Martin
      You are right, this why I have sent him a message to ask him if he had found the time to work on his new updater as he was testing it to remove the last bugs.
      "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

      Comment


      • #33
        You're a hard taskmaster, Tamerlin.

        But seriously, I would probably have kept putting off getting back to this if you hadn't decided to do a SAP version of the updater.

        I haven't actually tested these files, so you get to be a Beta tester. This version is far more robust than the original. But it comes at a price: I tried to set up the original version so that if anyone wanted to use it for a mod, all they had to do was to plug in their own data. This new version doesn't work like that so I've plugged your data in and made the other necessary changes.

        Also, I was working from my desktop so extract the three files to your desktop and then copy and paste them to their correct locations (overwriting the original files where necessary). I'm using the powerpoints field in Units.txt to subclassify the Unit Categories, but since neither the executable nor anyone else has used this data it won't conflict with anything.

        Pedrunn, you will notice that I've 'borrowed' some of your ideas. But I've credited you in the header.

        The reason that I haven't tested these files is that the version of CTP2 that I'm running is my own hybrid: it uses SAP and GOODMOD as a base but is incredibly modified. I'm coming to the conclusion that I could keep tweaking it forever, so maybe it's time to ask for a volunteer to give it a try.

        And don't forget to add the line

        #include APOL_updater2.slc

        to APOL_main.slc
        Attached Files

        Comment


        • #34
          Originally posted by Peter Triggs
          You're a hard taskmaster, Tamerlin.


          But seriously, I would probably have kept putting off getting back to this if you hadn't decided to do a SAP version of the updater.
          The unit updater is just what is needed to make CtP2 the perfect game.

          I haven't actually tested these files, so you get to be a Beta tester.
          It is a pleasure, I will post a feedback as soon as I have the time to test your new updater. I think I will test it at the beginning of the week to come.



          This version is far more robust than the original. But it comes at a price: I tried to set up the original version so that if anyone wanted to use it for a mod, all they had to do was to plug in their own data. This new version doesn't work like that so I've plugged your data in and made the other necessary changes.
          I will have a look at the inner working of your new updater though I doubt I will understand anything at all.

          The reason that I haven't tested these files is that the version of CTP2 that I'm running is my own hybrid: it uses SAP and GOODMOD as a base but is incredibly modified. I'm coming to the conclusion that I could keep tweaking it forever, so maybe it's time to ask for a volunteer to give it a try.
          I volunteer, two hands up.

          And don't forget to add the line

          #include APOL_updater2.slc

          to APOL_main.slc
          Yes, master!
          "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

          Comment


          • #35
            Although the auto update feature is something new.
            We have done exacly the same thing. Only changing the order of the 'ifs' and the names of the variables (Actually most have the same name ).

            Still nice to see you still care about CTP2 modding. I hope you dont retire after this!
            Last edited by Pedrunn; February 1, 2003, 01:11.
            "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


            • #36
              Did not work in my PC

              What about you tamerlin?

              BTW, there are two basic mistakes:

              the int_t enadv[] variable is missing

              and you cant use as many 'elseif' in the APOL_HasDataBaseAdvance function! There seem to be a max number of 'elseif' in a code. Therefore you must replace all those 'elseif' by 'if's and remove the last 'else' it is not needed at all. Since once a number return it stop the whole function!

              Take a look in my zip a couple of posts ago. The correct function is there.

              Still after fixing these mistakes the messages doesnt show up!

              What about you Tamerlin?

              Anyway, I have debugged my code. Seem to be fully working now. But i dont want to post it since the updater is Peter's original creation. I dont want to have him mad at me for messing up a creation he is still working on!

              So should i post the debugged version of my code (still there is a minor bug but at most seem really tolerant)!
              "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


              • #37
                Originally posted by Pedrunn
                Did not work in my PC

                What about you tamerlin?
                I will launch a new game tonight but I don't know if I will have the time to play enough to test it, if not I will use the cheat menue to generate the appropriate situation.

                BTW, there are two basic mistakes:

                the int_t enadv[] variable is missing

                and you cant use as many 'elseif' in the APOL_HasDataBaseAdvance function! There seem to be a max number of 'elseif' in a code. Therefore you must replace all those 'elseif' by 'if's and remove the last 'else' it is not needed at all. Since once a number return it stop the whole function!

                Take a look in my zip a couple of posts ago. The correct function is there.

                Still after fixing these mistakes the messages doesnt show up!

                What about you Tamerlin?
                I post an answer tonight.

                Anyway, I have debugged my code. Seem to be fully working now. But i dont want to post it since the updater is Peter's original creation. I dont want to have him mad at me for messing up a creation he is still working on!


                So should i post the debugged version of my code (still there is a minor bug but at most seem really tolerant)!
                Of course you should! I would like to test your code again.
                "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                Comment


                • #38
                  It was getting late.

                  enadv[]got changed from being a local array to a global EN_ADV[] in the new version.

                  When you have a long sequence of 'if's the computer will start at the top and work it's way down, examining each and every one of them. But if only one of them can be true, then it's better to use 'elseif's because, AFAIK, as soon as it finds the true one it ignores the rest of them and so is slightly faster. I broke the sequence in half to eliminate the stack overflow error. [edit: Actually, after thinking about it, in a function where the 'if' triggers a return, I doubt that it makes any difference.]

                  Pedrunn, I wouldn't be mad at you. The reason I kept working on this is because I've added a few things like you can only update certain units in certain locations.
                  Attached Files
                  Last edited by Peter Triggs; February 1, 2003, 10:06.

                  Comment


                  • #39
                    Originally posted by Peter Triggs
                    Pedrunn, I wouldn't be mad at you. The reason I kept working on this is because I've added a few things like you can only update certain units in certain locations.
                    Ity is just that our codes look so much like each other. We hould have worked together on this but i believe you are the kind of guy that likes to work alone.

                    My new version of the updater is here. I did some changes:

                    1) The broken messages for one unit upgrade are fixed!
                    In the messages I added what is the name of the unit to be updated and the name of the one that is going to update.

                    2) I have changed the order from 'Fortify' to 'Sleep' since there seem to be a problem with the first order (eg. when grouping 5 units with one that is fortified all other five units get fortified so the updater was being launched when grouping units what is something i do not want).

                    3) Some invisible changes to fixes the found bugs.

                    ------------------------------------------------------------------------------------

                    KNOWN BUG: The first unit of an army to be updated is broken for an unknown reason! You have to say no always in order to upgrade the other units.
                    Eg. If you have 5 obsolete units in a army. It will scroll over the units. In the first "Do you want to upgrade" if you say "yes" it the messages to update the other units wont show up If you say "No" the update will continue working as it should.

                    ------------------------------------------------------------------------------------

                    Anyway here is the improved code. You just need to write the line
                    Code:
                    #include "updater.slc"
                    At the bottom of the /gamedata/default/gamedata/script.slc file and the content of the messages copied inside the /gamedata/english/gamedata/info_str.txt.

                    It can be used in the the Apolyton Pack (APOL_script, APOL_main_str.txt).

                    Here is the code:
                    Attached Files
                    Last edited by Pedrunn; February 1, 2003, 08:45.
                    "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


                    • #40
                      Thanks Peter and Pedrunn for your quick replies and your reactivity.

                      I have almost finished the translation of Peter's Updater and I will test it tonight or tomorrow.

                      I will also test Pedrunn's Newupdater as soon as I can.


                      "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                      Comment


                      • #41
                        Peter, I have tested the Updater2 with a current game and using the cheat menue to add some units and try different possibilities.

                        First, the Updater2 is well triggered by an advance enabling Updates and the various options seems to work appropriately (though I am yet to see the "other type of units to update" message...)

                        But there are a few odd things, it is difficult to say if this is because I have not tested the updater through a whole a new game or not:

                        1 - After the initial cycle of update (and I am not updating all the units for the sake of the test), if I put a unit to sleep in order to update it, I have a message asking me "Do you want to update this unit?" but the unit is automatically updated before I choose "yes" or "no" and the corresponding gold is removed from my treasury.
                        Choosing "yes" or "no" does not have any other effect.

                        2 - When a unit is updated its movement range is "refreshed" and it can move again even if the obsolete units had previously used its maximum movement capacity.

                        3 - When there are several types of units in a stack, all the units are updated with the sleep order (voir 1) and I am not told there are other types of units waiting to be updated though the second type of units has been added through the cheat menue and might not be registered as a type of unit waiting to be updated.
                        "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                        Comment


                        • #42
                          1) One of those triggers should have been disabled on startup. I had done this in a different file but just copy and paste

                          Code:
                          HandleEvent(BeginTurn) 'APOL_DisableTriggers' pre {
                              DisableTrigger('AutoUpdateUnit');
                              DisableTrigger('APOL_DisableTriggers');
                          }
                          right above the handler 'InitUpdateArrays' (line 33).

                          2) I left it like that on purpose. It would be no problem to zero out their movement if that's what people want. See what kind of feedback we get.

                          3) See what happens here after you've put the above handler in. BTW, you should only get the 'additional types' warning with ADVANCED_COMPOSITES or PLASMA_WEAPONRY where the advance allows you to update more than one type of unit.

                          Comment


                          • #43
                            Originally posted by Peter Triggs
                            1) One of those triggers should have been disabled on startup. I had done this in a different file but just copy and paste...
                            It works fine now, thank you very much Peter.

                            2) I left it like that on purpose. It would be no problem to zero out their movement if that's what people want. See what kind of feedback we get.
                            IMHO, updating a unit should deplete its remaining movement capacity.

                            3) See what happens here after you've put the above handler in. BTW, you should only get the 'additional types' warning with ADVANCED_COMPOSITES or PLASMA_WEAPONRY where the advance allows you to update more than one type of unit.
                            I had misunderstood the goal of the reminder, I thought it was meant to remind you you had not updated some other older units from a previous update session.
                            "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                            Comment


                            • #44
                              Peter, I have spotted a little mistake in the APOL_Units.txt file, the cost of the Destroyer should be 2200 Gold and not 12 Gold.
                              "Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill

                              Comment


                              • #45
                                Oops. 12 should be the value in the PowerPoints field. And I just glanced over the file and noticed that the longship should have a PowerPoints value of 10.

                                Comment

                                Working...
                                X