July 19, 2003, 19:46
|
#1
|
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.
|
|
|
|
July 19, 2003, 20:02
|
#2
|
Prince
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
|
|
|
|
July 19, 2003, 21:17
|
#3
|
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!
|
|
|
|
July 20, 2003, 15:54
|
#4
|
Prince
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
|
|
|
|
August 1, 2003, 19:15
|
#5
|
Chieftain
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
|
|
|
|
August 2, 2003, 07:14
|
#6
|
King
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
|
|
|
|
August 2, 2003, 13:50
|
#7
|
Emperor
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.
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 01:57.
|
|