Announcement

Collapse
No announcement yet.

Battles shoud destroy tile Improvments.

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

  • Battles shoud destroy tile Improvments.

    For the first time i lost to the AI today. I am not totally dead, but my lands become a battlefield. From that game i had an idea .
    Tile Improvments should be destroyed (pillaged) in a battle over them. That would add such a good and realistic feature. Does anyone know if that is possible?
    "Kill a man and you are a murder.
    Kill thousands and you are a conquer.
    Kill all and you are a God!"
    -Jean Rostand

  • #2
    Code:
    HandleEvent(BattleAftermath) 'pillage' pre{
         Event:CutImprovements(location[0]);
    }
    Its that simlpe
    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
      !!!!!!!

      Thanks IW.
      It is working.
      "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


      • #4
        It actually works? wow, that's surprised even me!

        Glad I could help, I had a bit of trouble posting earlier, but it seems to have come through ok.

        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


        • #5
          That is a great idea, Pedrunn. It's very realistic, and probably should be incorporated into the new mods. Perhaps a poll is in order to gauge the depth of opinion for or against?

          Wombat: Wow, talk about "Ask and ye shall receive"!
          To La Fayette, as fine a gentleman as ever trod the Halls of Apolyton

          From what I understand of that Civ game of yours, it's all about launching one's own spaceship before the others do. So this is no big news after all: my father just beat you all to the stars once more. - Philippe Baise

          Comment


          • #6
            Can I just tack it onto the end of another one of your codes???
            Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
            ...aisdhieort...dticcok...

            Comment


            • #7
              Unfornutelly since i got that code, Although it worked just fine through the cheat mode i am experiencing game crashs (3 times now) with the message the CTP2 caused an error on the CTP2.exe.
              All the crashs happen in abut turn 40-50 wich is the time barbarians ussually appears. My theory is that the AI x Barbarians combat are causing these crashs. Did someone who got this code are experiencing this problem. I will just start a game without it. And i will keep informing.
              "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


              • #8
                Uh-oh It wasn't me!

                I see no way that it can be, though the tile improvement functions are notoriously buggy...

                Sure Dave, tack it in anywhere, it has no variables, no functions, nothing.
                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


                • #9
                  Is it possible to make it a random event as well, or is it basically the tile improvement gets destroyed when there's a battle on it. I'm guessing, based on my limited knowledge that it wouldn't be possible to make it occur randomly.

                  Even if you could make it random you would want it heavily weighted towards destroying the improvement. Leaving a percentage chance of the improvement surviving would reflect the percentage of improvements that survive overall, as partially destroying improvements would likely take way too much work.
                  “The American people have now spoken, but it’s going to take a little while to determine exactly what
                  they said.” — President Clinton

                  Comment


                  • #10
                    I have just finishing figuring up what happened.
                    Since i was playing autosaved i went check to see if a battle really happened. The game crashed when it was the turn of the brown ones so they were the first checked.
                    There was a battle after all. Among a barbarian Light calvary and a Brown Spearman. But surprisily there wasnt a tile not even close to the battle .
                    I deleted the code and restarted the same game. I am curently at turn 70 and no sight of crashs. The Barbarians even attacked and conquered my capitol (those bastards).

                    I do not get it! you make a code that work to destroy tile imps. but it crashs when a regular batle happens. Yet everything works fine through Cheat Mode.
                    I did not get a good conclusion. And i hope someone did played this code. I want to know if it is just me (since my CTP2 is tottally full of others codes) or this did it happen with someone else.
                    "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


                    • #11
                      Oops, this is the exact same problem that crashed the original natural disaster codes
                      It works fine when there is a tile imp, because it can remove it. When there is not a tile imp, there is nothing to remove, and the game crashes.
                      Take 2:
                      Code:
                      HandleEvent(BattleAftermath) 'pillage' pre {
                              int_t  i;
                              for(i = 0; i < 24; i = i + 1){
                                     if(TileHasImprovement(location[0], i)){
                                             Event:CutImprovements(location[0]);
                                     }
                              }
                      }
                      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


                      • #12
                        Thanks again IW i will try a new game now.
                        And to think that i was going to give uo of this great idea :
                        wish me good luck!
                        "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


                        • #13
                          I started the new game and i am almost at turn 100. I got some battles with the barbs and they worked fine. No crash. Although none of them were over tile imps. But they did get destroyed through the cheat mode.
                          I think it is all ok now. Great Job IW.
                          "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


                          • #14
                            Originally posted by Paulypav
                            Is it possible to make it a random event as well, or is it basically the tile improvement gets destroyed when there's a battle on it. I'm guessing, based on my limited knowledge that it wouldn't be possible to make it occur randomly.
                            This code should make it possible:

                            Code:
                            HandleEvent(BattleAftermath) 'pillage' pre {
                            	int_t  i;
                            	if (Random(6) > 0) {
                            		for(i = 0; i < 24; i = i + 1){
                            			if(TileHasImprovement(location[0], i)){
                            				Event:CutImprovements(location[0]);
                            			}
                            		}
                            	}
                            }
                            This code should give you a change one seventh that your tile improvement will survive the battle.

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

                            Comment


                            • #15
                              Originally posted by Martin Gühmann

                              This code should give you a change one seventh that your tile improvement will survive the battle.

                              -Martin
                              It just keeps getting better and better.
                              "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

                              Working...
                              X