Announcement

Collapse
No announcement yet.

Victory through capital city capture possible?

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

  • J Bytheway
    replied
    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.

    Leave a comment:


  • Pedrunn
    replied
    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.

    Leave a comment:


  • Matthew Hayden
    replied
    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

    Leave a comment:


  • Immortal Wombat
    replied
    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.

    Leave a comment:


  • Darrell999
    replied
    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!

    Leave a comment:


  • Immortal Wombat
    replied
    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.

    Leave a comment:


  • Darrell999
    started a topic Victory through capital city capture possible?

    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.
Working...
X