Thread Tools
Old July 19, 2003, 19:46   #1
Darrell999
Settler
 
Local Time: 05:57
Local Date: November 2, 2010
Join Date: Mar 2003
Posts: 13
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.
Darrell999 is offline  
Old July 19, 2003, 20:02   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:57
Local Date: November 2, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
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
Immortal Wombat is offline  
Old July 19, 2003, 21:17   #3
Darrell999
Settler
 
Local Time: 05:57
Local Date: November 2, 2010
Join Date: Mar 2003
Posts: 13
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!
Darrell999 is offline  
Old July 20, 2003, 15:54   #4
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:57
Local Date: November 2, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Quote:
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.

Quote:
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
Immortal Wombat is offline  
Old August 1, 2003, 19:15   #5
Matthew Hayden
Chieftain
 
Matthew Hayden's Avatar
 
Local Time: 05:57
Local Date: November 2, 2010
Join Date: Aug 2000
Location: Great Britain
Posts: 85
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
Matthew Hayden is offline  
Old August 2, 2003, 07:14   #6
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:57
Local Date: November 2, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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
Pedrunn is offline  
Old August 2, 2003, 13:50   #7
J Bytheway
Call to Power PBEMCall to Power II Democracy GameCTP2 Source Code Project
Emperor
 
J Bytheway's Avatar
 
Local Time: 06:57
Local Date: November 2, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
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.
J Bytheway is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:57.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team