 |
|  |
 |
|
Martin the Dane
|
 |
Aarhus, Denmark
Feb 2000 time: 06:13
|
|
Back in May I started a thread over in the help section calle: Eliminated AI still there!!! the problem in short is as follows:
Some times when a civ is eliminated the civ will still appear on the diplomacy screen effectively making a conquest victory impossible, then if you turn on the cheat mode the civ will disappear. I believe I have found the cause.
I was playing the Vikings and had eliminated the Swedes but at the next turn they were still there.
In an attempt to find the problem I turned on cheat mode gave the Swedes a new city and subsequently eliminating it, now to my surprise I saw a unit die when I pressed the button I then reloaded the game from a save prior to entering cheat mode, and sent a bomber over the square and lo and behold there was a Swedish diplomat and a lawyer, since I was at war with them my bomber killed them right away. Now there are no more Swedes.
Normally when the last city of a civ has been eliminated or conquered the civ's remaining units will die at the beginning of that civ's next turn, thus eliminating the civ from the game. This however does not always happen, in fact it will not happen if you save and reload the game before completing the turn in which the civ was eliminated.
You don't have to eliminate all the orphaned tropes in order to eliminate the dead civ, one will do, unless you make a save reload after killing the unit. (I did )
I don't know if any of you SLIC wizards can think up a fix to that, what about some check to see it the civ has any cities, and if not eliminate any remaining units, has to take the beginning of the game into account though.
[This message has been edited by Martin the Dane (edited October 30, 2000).]
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:13
|
|
Ah yes, thanks for fixing those bugs, Gedrin, it looks much better like that. One thing though, I'm not sure if city.owner will be the new or the old owner of the city, so I replaced it with player.1. Also, I'm not sure if player.1 is the player that conquers the city or the player that has it's city conquered, so it might be that player.1 should be player.2. So if anyone wants to try this (Martin?), use the code below (it looks like I won't have time for it until at least Friday, maybe even later). If this doesn't work, try replacing all three instances of player.1 with player.2.
code: trigger 'CivDies' when (city.captured) {
if (player.1.cities == 0) {
i = 0;
while (i < player.1.totalunits) {
SetUnitByIndex(2, player.1, i);
KillUnit(unit.2);
i = i + 1;
}
}
}
For ease of testing the 0 in the if-line could also be replaced with 1 (or any other number for that matter) so that all units get destroyed when the civ has exactly 1 city left after conquering a city.
|
|
|  |
 |
|  |
 |
|
Gedrin
|
|
Well gee Martin, you a mere mortal picked up on something we missed, incrementing i.
Locutus good point about city.owner but I believe player.1 is the victim and player.2 is the aggressor. Trouble is Martin I see your code differs in that regard. So please let me know if that was accurate since if I am correct then the trigger would have done nothing at all... except hit false in the if condition...so any units that died have been CTP itself doing it not your trigger.
I believe that city.owner would already have been updated to player.2 since in my Refugee trigger I get a message with the city.name is colour coded to match the agressor... Hmmm... IIRC that is. I'll check on that. Oh and it's my Refugee trigger that makes me think player.1 is the victim, See:
*snip*
// pick a random number in [0,Cities(player.1))... in not inclusive!
destCityIdx = Random (Cities(player.1));
SetCityByIndex(2, player.1, destCityIdx);
AddPops (city.2, 1);
*snip*
If player.1 is the agressor and I pick a random city of his then the pop should flee to the attackers cities... that of course does not happen.
Gedrin
|
|
|  |
 |
|
Martin the Dane
|
 |
Aarhus, Denmark
Feb 2000 time: 06:13
|
|
quote:

Well gee Martin, you a mere mortal picked up on something we missed, incrementing i.
 |
"Elemtary my dear Watson" and by the way I didn't say stupid, just mortal you se my SLIC knowledge is at the same level as my German, understanding but not writing/speking it.
Well Gerdin, I tried bot player.1 and player.2 and with player.1 nothing happend while with player.2 the units were killed one at a time. Just checked again, so player.2 is the victim while player.1 is the agressor.
(The code is directly copy poasete from the .slc file.)
CTP will not kill the units untill after the player press END, that's why the problem is there in the first place.
You wrote something about not using index 1 to select the units for 'execution', I have however not experienced any problems doung so.
quote:

If player.1 is the agressor and I pick a random city of his then the pop should flee to the attackers cities... that of course does not happen.
 |
Are you so sure about that? It did when I tried your code.
The city.owner has ben updated though, I got the growth in the captured city once (out of a total of three attempts) and by the way you wouldn't get the city growth message if the city recieving the refugies was not yours.
Martin the Dane
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
Forum 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
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|