Im currently having my first experience programming slic, the goal is to remove that silly bug with internet wonder and computer centers still being build, when done it should work for all that type of wonders.
here is what it does for now:
HandleEvent(BeginTurn) 'WonderLookup' post {
int_t i;
int_t inetplayer;
city_t tmpCity;
inetPlayer = WonderOwner(WonderDB(WONDER_INTERNET));
if(inetPlayer != -1) {
//remove computer center from inetPlayer buildlists
for( i = 0 ; i < PlayerCityCount(inetPlayer); i = i + 1 ){
GetCityByIndex(inetPlayer, i, tmpCity);
KillBuildingFromBuildList(tmpCity, BuildingDB(IMPROVE_COMPUTER_CENTER));
}
}
}
as you can see it identifies the player that owns the wonder (if any) each turn and then procedes to remove all computer centers from the build lists of all cities the player own. it works for human players and AI alike.
i could really use a couple of tips on how to prevent computer center from appearing on the build lists at all.
but as it is now it should still prove usefull, i hate going trough all my build lists and manually removing buildings when i build such a wonder.
here is what it does for now:
HandleEvent(BeginTurn) 'WonderLookup' post {
int_t i;
int_t inetplayer;
city_t tmpCity;
inetPlayer = WonderOwner(WonderDB(WONDER_INTERNET));
if(inetPlayer != -1) {
//remove computer center from inetPlayer buildlists
for( i = 0 ; i < PlayerCityCount(inetPlayer); i = i + 1 ){
GetCityByIndex(inetPlayer, i, tmpCity);
KillBuildingFromBuildList(tmpCity, BuildingDB(IMPROVE_COMPUTER_CENTER));
}
}
}
as you can see it identifies the player that owns the wonder (if any) each turn and then procedes to remove all computer centers from the build lists of all cities the player own. it works for human players and AI alike.
i could really use a couple of tips on how to prevent computer center from appearing on the build lists at all.
but as it is now it should still prove usefull, i hate going trough all my build lists and manually removing buildings when i build such a wonder.
It seems like you're giving whoever owns the building-wonders a special advance and as soon as the wonder changes owner, you give the new owner a certain amount of money for every accompanying wonder-building he owns. What's the advance good for? Why give money to the new owner? If you're trying to sell the buildings it would be much better to actually destroy the building as well using the event DestroyBuilding or do it differently altogether by calling the event SellBuilding, which takes the money-part out of your hands altogether. In that case, the code would look something like this:
I think you just scared away any non-CS students and non-ITers that might have been following this thread 
Comment