Announcement

Collapse
No announcement yet.

Victory through capital city capture possible?

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

  • Victory through capital city capture possible?

    Does anyone know if it's possible to mod victory conditions where win conditions are based on the capture of certain capital cities, or if cities can be assigned victory points? Or does anyone know of any user-made scenarios that already has this? Thanks.

  • #2
    Odd, I very nearly replied to your Civ3 thread. Cities are assigned victory points in the Alexander the Great scenario as included in the game. The capture of "Mount Doom" in Hexagonian's Lord of the Rings scenario gives a substantial advantage to the human player, but victory is possible to assign by capital city capture.

    If you only have one capital city to capture, the code is easy:

    Code:
    HandleEvent(CaptureCity) 'victory_conditions' pre{
           if(CityHasBuilding(city[0], "IMPROVE_CAPITAL") && !IsHumanPlayer(city[0].owner)){
                   GameOver(1,1);  // player one wins;
           }
    }
    If you have more than one AI, you'll need an array (probably) to keep track of which have been taken, but yes, it is certainly possible.
    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, Immortal Wombat!
      I'm a complete newbie for CTP2 scenario design, but I would very much like to see some scenarios where there is "sudden death" victory conditions where each country gets a capital to defend. If there is none around, I suppose I'll try to see if I can create one. Do you know if there are any other user-created scenarios that have this? Also, if you happen to find out how to assign cumulating victory points for cities, that would be fantastic. Thanks again!

      Comment


      • #4
        Originally posted by Darrell999
        Do you know if there are any other user-created scenarios that have this?
        I don't think so. Almost all the SLIC that has been done has been done for mods, not scenario events. Which is a shame in some ways, but it means we still have plenty to try.

        Also, if you happen to find out how to assign cumulating victory points for cities, that would be fantastic. Thanks again!
        Code:
        int_t  VICTORY_POINTS[];
        
        HandleEvent(CaptureCity) 'count_victory_points' post{
            VICTORY_POINTS[city[0].owner] = VICTORY_POINTS[city[0].owner] + city[0].population;
             if(VICTORY_POINTS[city[0].owner] > 150){
                   GameOver(city[0].owner,1);
            }
        }
        Roughly speaking, something like this should work. Each city that's captured gives the captor points equal to the city's population. The first player to exceed 150 points wins. It'll need some initiation code and so forth, but that's about it.
        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
          Hmmm - there are a few historical scenarios which could be made to use that capital capture condition.

          I have the war between Germany and the Soviet Union firmly in mind here - if Germans capture Moscow, German victory, if Russians capture Berlin, Russian victory, and so on and so forth.

          But since I am no programmer and certainly no graphics whizz, I can't realise this idea myself

          Comment


          • #6
            If there is more than one AI. Isnt what Darrell999 is looking is a code that give all the cities of the player who lost the capital to its conquerer?

            If it is here is the code

            Code:
            HandleEvent(CaptureCity) 'PedrunnsVictoryConditions' pre{
            int_t c;
            int_t tmpPlayer;
            int_t CityCount;
            city_t tmpCity;
            	if(CityHasBuilding(city[0], "IMPROVE_CAPITAL") 
            //	&& !IsHumanPlayer(city[0].owner)
            	){
            		tmpPlayer = city[0].owner;
            		CityCount = PlayerCityCount(tmpPlayer);	
            		for (c = 0; CityCount; c = c + 1) {
            			GetCityByIndex(tmpPlayer, c, tmpCity);
            			if(CityIsValid(tmpCity)) {
            				Event: GiveCity(tmpCity, player[0]);
            			}
            		}
            	}
            }
            NOTE: I revised many times but i did not tested so dont be surprised if you see syntax errors.
            "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


            • #7
              Of course, with this code the player can sell his own capital building if he sees that he is about to lose, and thus avoid the effects. There's also revolting capitals to consider.

              Comment

              Working...
              X