Announcement

Collapse
No announcement yet.

Clerics, Corporate branch and so on...

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

  • #76
    forgot the code

    Note: I just notests i made seven upgrades in this version. isnt this suggestive )
    Attached Files
    "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


    • #77
      Here's number 8. Since I won't have any time over the weekend I'll post it even though I haven't done that much to it.
      - Pedrunn: You completely forgot a testing routine in the settler stuff, it's where you'll find now a variable "testunit".
      - The Settler stuff won't work out nicely yet. I rewrote it but the fact that there'll be nonexisting units in the ReligiousSettler array will give slicerrors because there's no UnitIsValid function and in orther to use the ArmyIsValid you'll have to valid Unit to put into that function... I'm believing that it works nevertheless though, believing at least...
      - The LogRegardEvent: I was PMing Peter about this, but he couldn't see what I saw (instead he nicely pointed out some other mistakes), so I'll just post my screeshot here:
      Attached Files

      Comment


      • #78
        yes, i've got win XP - I like it though...

        the syntax we're using (where p is another integer):
        LogRegardEvent(tmpPlayer, p, -2, 0, ID_NONE, 0);
        I've got NONE in the stringfiles and I've tried playing with the last 0, no change.

        And here's the code (with the LogRegard disabled), as last time setup to be part of SAP with the according Modswapper option:
        Attached Files

        Comment


        • #79
          There is no unit is valid check???

          And what about this one:

          unit.valid - true if the unit still exists, false otherwise

          From the slic documentaion about the build in array types.

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

          Comment


          • #80
            Originally posted by mapfi
            - Pedrunn: You completely forgot a testing routine in the settler stuff, it's where you'll find now a variable "testunit".
            I see this in a lot of codes and i do write this routine most of the time. But is this really needed? How does this improve the code?
            Sorry for my ignorance
            Originally posted by mapfi
            - The Settler stuff won't work out nicely yet. I rewrote it but the fact that there'll be nonexisting units in the ReligiousSettler array will give slicerrors because there's no UnitIsValid function and in orther to use the ArmyIsValid you'll have to valid Unit to put into that function... I'm believing that it works nevertheless though, believing at least...
            I tested this feature and it did work. For the message we could use a if(ReligiousSettler.# > 0) to prevent the slic error. But i dont see why a problem would happen?
            Originally posted by mapfi
            - The LogRegardEvent: I was PMing Peter about this, but he couldn't see what I saw (instead he nicely pointed out some other mistakes), so I'll just post my screeshot here:
            I will look another function to change the regard. But this function was used several times in the NewDiplomod code. Why are we getting errors?
            //player[0] = tmpReligion; no error, but it's not written into it - i'll always get the same religion in the message
            This is the most terrible comment i have ever seen. I tested and you were right. player[0] no matter how we change it during the code will always be defined as the built in variable of the event.
            There is a way to solve this. Make the messages being send to the religion owner in the turn of the player that started the religion.
            Or we can forget this is make real-life religions like the ones you suggested a while ago. But we still have to figure out how save its names.

            1) There is still a loop in the "Do want to convert" message that you get when a city of yours is converted to another religion. Can you check this. I just cant see/fix these loops

            EDIT: Thanks martin, I had no idea of this unit.valid. I only had eyes to the functions when i looked for a valid unit test. That will help us a lot.
            Last edited by Pedrunn; September 7, 2002, 07:44.
            "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


            • #81
              Pedrunn, look at this again taken from your code more closely and your ignorance will be gone in seconds
              Code:
              while(i < ReligiousSettler.# && sucess == 0) { 
              		GetArmyFromUnit(tmpUnit, tmpArmy);
              		if(!ArmyIsValid(tmpArmy)) {
              			ReligiousSettler[i] = tmpUnit;
              			SettlerReligion[i] = tmpReligion;
              			sucess = 1;
              		}
              		i = i + 1;
              	}
              }
              What does it do? It overwrites every single part of the array with the same values. What you actually wanted to do is to test if the unit in the religioussettler array was valid. Well, my code worked for that but thanks to martin, it's even easier!

              Comment


              • #82
                Here's the update to the code - I'll just post the slic this time. Thanks to Martin who pointed the unit.valid thing out, the settler stuff works just perfectly now. I also corrected some other small bug in a for-loop. I tested all possible situations with settlers and I'm sure that it works as intended now.
                The LogRegardEvent however, is the last debugslic=yes error and still gives me the wrong type of argument and even freezes my machine again. I've talked to Peter about this and he doesn't have the problems on his machine. So I find it particularly nice of him that he offered me his computer...

                The strange thing is, I've played with Dale's AOM which has the new diplomod which just uses this function and I didn't get one error. Furthermore, if you look at some previous post the problem I had with PlayerCityCount seems to be the same. That's solved now after Pedrunn had the code. Pedrunn, what did you do? I can't pinpoint it, but that'll probably be the solution, I hope...
                (so the LogRegard is disabled in the slic - I'd be happy if some people could activate it and try it out on their system)
                Attached Files

                Comment


                • #83
                  Pedrunn, the two other things you mentioned:
                  I can't find a loop in the doyouwantconvert messages. Are you sure? Didn't it display several times because the ai player was actually converting more than one city during his turn?

                  As for the player[0] stuff, i'm sorry I made a terrible comment
                  Seriously, I don't like the solutionwe got now either but it's just not working out. Either SLIC would need a string variable for that, or the player array would have to be accessible for numbers over 0 anytime. Maybe if we just asked activision to do a patch...

                  Comment


                  • #84
                    Originally posted by mapfi
                    The LogRegardEvent however, is the last debugslic=yes error and still gives me the wrong type of argument and even freezes my machine again. I've talked to Peter about this and he doesn't have the problems on his machine. So I find it particularly nice of him that he offered me his computer...
                    I get the same messages you do with LogRegardEvent with DebugSlic = Yes but my PC doesnt freezes. I will test if at least the regard is given if the DebugSlic = No.
                    Does the game crashs with DebugSlic = No.

                    Originally posted by mapfi
                    if you look at some previous post the problem I had with PlayerCityCount seems to be the same. That's solved now after Pedrunn had the code. Pedrunn, what did you do? I can't pinpoint it, but that'll probably be the solution, I hope..
                    This is a coding secret
                    (*If i had at least once tried to fix this but no clue what he is talking bout )

                    Originally posted by mapfi
                    Pedrunn, the two other things you mentioned:
                    I can't find a loop in the doyouwantconvert messages. Are you sure? Didn't it display several times because the ai player was actually converting more than one city during his turn?
                    I will test this again then.

                    Originally posted by mapfi
                    As for the player[0] stuff, i'm sorry I made a terrible comment
                    Seriously, I don't like the solutionwe got now either but it's just not working out. Either SLIC would need a string variable for that, or the player array would have to be accessible for numbers over 0 anytime. Maybe if we just asked activision to do a patch...
                    But i still dont see another solution
                    Even if we are going to use real-life religion i dont nave any idea on how to make the correct religion name appear appear in the messages too. I feel tied up.

                    PS: I willl check your new the code now.
                    "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


                    • #85
                      (*If i had at least once tried to fix this but no clue what he is talking bout )
                      I guess it'll remain a mistery...

                      DebugSlic = No results in the game running properly but I don't think the regard is give then. If I compare our code to the new Diplomod, the only difference I see is that we use an int as an argument instead of a value of the player array. But we we're talking about this before and didn't find a solution for our code...

                      Comment


                      • #86
                        Here is the pre-9 version of the code (will wait your editing to turn it to 9).

                        Additions:

                        1) Religious Info Messages fixed using the player who started a religion to send the message to those with this starting religion.
                        player[0] is the variable of the message for the religion. and for the religion level the variable is ReligionLevel.

                        2) Religion variable for the message for the Do You Want to Convert fixed by changing the event from ConvertCityUnit(unit_t, city_t) to ConvertCity(city_t, int_t, int_t). The variable for the religion in the message is player[0]. Note: I had to add a new int_t variable (ReligionCodeConversion) to prevent messages to pop up every time the code uses the event ConvertCity (wich arent few!!!)

                        3) Another message added to the Reformation Event to better explain the player who is reforming what happens. In this case i added a message telling him that the city has the same religion as the player so he cant reform.

                        3) Prevent a human player to convert cities with same religion of yours.

                        4) AI dealing better with the religion: If he tries to convert a city with same religion of yours he actually tries to Sell Indulgences. And if he tries to sell indulgences to a city with religion different of your he tries to convert it first.

                        5) Reformation decreases happiness in the city.

                        6) Tested LogRegard Event and it does work so i left it in the code.

                        7) Better organization of the code. May look odd at first but i think it is better. According to order: New Functions --> Events --> messages.

                        Comments:
                        --> I cant think of nothing else to improve the code so far except adding more info to the religios info (happy mod of religion, number of players with it, etc...). I think we are one step to release this code.
                        --> Lets define wich numbers we will use after all for the (my suggestion):
                        - NewReformCost - (CityReligionLevel*cityPop*10);
                        - AI chance of Reforming - (PlayerGold = 4*reformCost) and (PlayerRelLevel > CityRelLevel/3)
                        - AI chance of Converting- (ConvertorReligionLevel = 3*ConvertedReligonLevel)
                        - HappyMod - (see code)
                        - Sell Indulgences money - (theTenth = city[0].population*3)(theTenth = city[0].population/2)
                        - Every Turn Money ( 3*gold per citypop of converted city of non converted cities / players with this religion
                        - Regard - Same Religion + 5, different religion - 2
                        Non-slic changes:


                        --> Messages: Those messages i PMed you are fine for this code. Just some minor changes

                        --> Increase to the max of possible the values for the GOAL_CONVERT_CITY, GOAL_REFORM and GOAL_SELL_INDULGENCES. The slic make the calculation it it should or shouldnt do this goal and how.

                        --> ORDER_REFORM does not cost gold or movement those have to be set to 0.

                        --> Sell Indulgences also cant give money (const.txt)

                        --> Tomorrow i will make the different clerics for theocratics and non-theocratics govs.

                        I think that is all.
                        Attached Files
                        "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


                        • #87
                          Mapfi, I guess you are too busywith the hidden nationality slic. So since we are pretty much done here i will make the code a mod with expansions for the Apolyton Pack and GoodMod and submit to the database. .
                          The readme is what is going to take me more time though.
                          "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


                          • #88
                            Yes, I was playing with that recently - submitting it to the directory? If everything works - ok. I'd rather release a beta in this thread before though, so some people might try it out before we put it onto the file server. Only to avoid several fixes after such a release.
                            And if the last post is still the most up-to-day version I'll look into tonight, I already got in on my computer.

                            Comment


                            • #89
                              I did try the code out and it failed. There's now something wrong in the doyouwanttoconvert stuff I'm sure. Sorry for not having more time to look into it. If you however have time to pack it up I'll do a playtest this week and as I see it I'd still rather reword and correct part of those messages. I'm trying not even to mention this logregard thinigie!
                              As for the values - depends on the experience in a full game and people's likings.

                              Comment


                              • #90
                                saving this from page 2 or I'll never find it again...

                                Pedrunn, I'm working on this again. Checked half of the code on my last train ride. Besides some small mistakes I'll also rewrite the variable names a little - use some systematic naming. I'd be happy if you could PM or mail me the strings again as I seem to have totally outdated ones...
                                I'll give you a updated version of this thing within the next few days.
                                By the way, are you planning to use this in your hopefully-soon-to-be-released mod?

                                Comment

                                Working...
                                X