2. Change all the TIME_SCALE values in DiffDB.txt for each difficulty level.
1. Is it possible to change the tile improvement thing, to be cheaper when upgrading an improvement? I mean, when having a mine, but you want to upgrade the mine to an advanced mine instead. But because it's upgrading, the price should be slightly lower than the original price (Like having a 25% price cut...) Of course, if the tile is empty (Or has something else, than a mine), the price should be normal...
2. Is it possible to change how slow/fast the time goes by?
This space is empty... or is it?

2. Change all the TIME_SCALE values in DiffDB.txt for each difficulty level.
Thx
This space is empty... or is it?

DP. and if you copied the code that was in here try the next post one
Last edited by Pedrunn; September 13, 2002 at 08:37.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

1) You can add PW to the player who isto simulate the bonus. Here is a code that adds 50 PW to the player if his is building advanced mine over mine and 25 if building a advanced farm over a farm. the temolate for new imrprovent is written there ( // means comment and do not make part of the code
Obs: UNTESTED, UNTRIED and MAY GIVE SLIC SYNTAX ERRORS.Code:HandleEvent(CreateImprovement) 'PWBonunWhenBuildingOneSameType' pre { int_t i; int_t InitialPw int_t FinalPW; int_t OLD_TILEIMP[]; int_t NEW_TILEIMP[]; int_t PW_BONUS[]; OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINE); NEW_TILEIMP[0] = TerrainImprovementDB(TILEIMP_ADVANCED_MINE); PW_BONUS[0] = 50; OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_FARM); NEW_TILEIMP[1] = TerrainImprovementDB(TILEIMP_ADVANCED_FARM); PW_BONUS[1] = 30; // TEMPLATE obs: * need to be filled //OLD_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); //NEW_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); //PW_BONUS[*] = *; for(i = 0; i < OLD_TILEIMP.#; i = i + 1) { // Search for all numbers if(TileHasImprovement(location[0], OLD_TILEIMP[i]) { // if tile has tile imp in the data if(value[0] == NEW_TILEIMP[i]) { // and new improvement has the same number InitialPw = player[0].publicworkslevel; // Search for previous amout of PW FinalPW = InitialPw + PW_BONUS[i]; // Give a 50 PW bonus setPW(player[0], FinalPW); // and set the new player's PW amount } } } }
any question i am here.
Copy this code in any included .slc of the folder \default\gamedata\ I recommend the script.slc wich is included for sure for the original game (The included files are in the end of this file and you can include new one you created by writting the line:
This means the AnyFile.slc is included. if this file doesnt exist you get slic errors.Code:#include "AnyFile.slc"
2) The building time is in the TI data in the tileimp.txt just change for the improvement you want the value of its entry:
and there you goCode:ProdutionTime
PS: did you fixed the errors you were getting from your last modding attept?
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Thx for the help... and yes, I got the last error fixed (I haven't finished my first game yet, so I can't be sure, but I haven't had any problem yet...)
I now get an slic error when starting the game...
Last edited by Adagio; September 13, 2002 at 10:18.
This space is empty... or is it?

But you still get errors when loading CTP2?
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
I only get the new slic error... The other error got fixed
What does the number in [] mean? this might be what causes the error...OLD_TILEIMP[0]
NEW_TILEIMP[0]
PW_BONUS[0]
OLD_TILEIMP[1]
NEW_TILEIMP[1]
This space is empty... or is it?
Hmmm... how come it says, Pedrunn was the last one to reply... even after tons of refreshing of the browser..?
This space is empty... or is it?
Those are arrays Pedrunn uses - when you define a variabel like the following int_t number[]; you'll have a dynamically growing array. Now if you want to write an integer into that array you have to say which index it shall have. They start at 0.
If you want to get into SLICing start reading Locutus' and IW's documentations, mavbe even the activision one...
Ok, let's see if I understud it. If I make more of those in Pedrunns example, I have to do like this: (?)
Ok, I didn't check if I spelled right... But is it something like that?OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINE);
NEW_TILEIMP[0] = TerrainImprovementDB(TILEIMP_ADVANCED_MINE);
PW_BONUS[0] = 50;
OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_FARM);
NEW_TILEIMP[1] = TerrainImprovementDB(TILEIMP_ADVANCED_FARM);
PW_BONUS[1] = 30;
OLD_TILEIMP[2] = TerrainImprovementDB(TILEIMP_FARM);
NEW_TILEIMP[2] = TerrainImprovementDB(TILEIMP_Hydronic_FARM);
PW_BONUS[2] = 30;
This space is empty... or is it?
That's what you want, yes.
Ok, thx for the help![]()
This space is empty... or is it?

DP
Last edited by Pedrunn; September 13, 2002 at 14:28.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

There are actually three errors:
1) A missing ';' after
2) A missing ')' ater the line (you can see that i open two '(' but i dont get one of them closedCode:int_t InitialPw
3) The names of the improvements. In the tileimp.txt you will find that they are in plural not in singular form as i wrote.Code:if(TileHasImprovement(location[0], OLD_TILEIMP[i]) {
The number is just something to relate the OLD_TILEIMP[] with the NEW_TILEIMP[] and the PW_BONUS[]. Since the code works like that. (A slic lesson here).
Try this code it is esier to understand and has new improvements:
Code:HandleEvent(CreateImprovement) 'PWBonunWhenBuildingOneSameType' pre { int_t i; int_t InitialPw; int_t FinalPW; int_t OLD_TILEIMP[]; int_t NEW_TILEIMP[]; int_t PW_BONUS[]; OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINES); NEW_TILEIMP[0] = TerrainImprovementDB(TILEIMP_ADVANCED_MINES); PW_BONUS[0] = 30; OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_ADVANCED_MINES); NEW_TILEIMP[1] = TerrainImprovementDB(TILEIMP_MEGA_MINES); PW_BONUS[1] = 50; OLD_TILEIMP[2] = TerrainImprovementDB(TILEIMP_FARMS); NEW_TILEIMP[2] = TerrainImprovementDB(TILEIMP_ADVANCED_FARMS); PW_BONUS[2] = 40; OLD_TILEIMP[3] = TerrainImprovementDB(TILEIMP_ADVANCED_FARMS); NEW_TILEIMP[3] = TerrainImprovementDB(TILEIMP_MEGA_FARMS); PW_BONUS[3] = 60; // TEMPLATE obs: * need to be filled //OLD_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); //NEW_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); //PW_BONUS[*] = *; i = 0; // 'i' is zero for the last loop while(i < OLD_TILEIMP.#) { // if 'i' is smaller then the biggest number inside OLD_TILEIMP[] if(TileHasImprovement(location[0], OLD_TILEIMP[i])) { // if tile has tile imp equal to OLD_TILEIMP[i] if(value[0] == NEW_TILEIMP[i]) { // if new improvement has the same number InitialPw = player[0].publicworkslevel; // Search for previous amout of PW FinalPW = InitialPw + PW_BONUS[i]; // Give a 50 PW bonus setPW(player[0], FinalPW); // and set the new player's PW amount } } i = i + 1; } }
Last edited by Pedrunn; September 14, 2002 at 08:21.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Just use copy (mark a line and press Ctrl and c on the same time), then go to the target document and press Ctrl + v.Originally posted by ADG
Ok, I didn't check if I spelled right... But is it something like that?
-Martin
Civ2 military advisor: "No complaints, Sir!"
Yeah, I know, but I was just too tired at that moment to open all the documents again, and try to fix around with them... but thx anywayOriginally posted by Martin Gühmann
Just use copy (mark a line and press Ctrl and c on the same time), then go to the target document and press Ctrl + v.
-Martin![]()
This space is empty... or is it?
It says there's a syntax error on this line:
Code:if(TileHasImprovement(location[0], OLD_TILEIMP[i])) {
This space is empty... or is it?

That is why i hate slic. one small typo and frustation comes to you.
It is a missing '{' in the line before. I edited the code from its post it should work now.
Sorry.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Ok, thx, it works now (Well...it starts without complaining, haven't tested if the code works
Can't wait til the day, were I might be able to see what the errors mean (Just started learning java last week, so there's still a long way)...
This space is empty... or is it?
I just loaded a savegame to test if it works, but I don't get the bonus...
This space is empty... or is it?
EDIT: Woops, I ment to edit instead of reply...Originally posted by ADG
I just loaded a savegame to test if it works, but I don't get the bonus...
Is it because in this line, you sets the number of the player. Shouldn't it be something like the i in PW_BONUS[i]? Otherwise the player who gets the bonus is always the same player... or am I mistaking here?
Code:setPW(player[0], FinalPW);
This space is empty... or is it?

When you load a saved game. the slic codes are the same as the ones you saved. So my slic code is not part of.
To tell the PC that you have a new code in your game data you must press ' and the chatbox will open.
Then type
And press enter. The game will search for new codes and changes in the code in your game data.Code:/reloadslic
New games dont need this procedure.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Ah, ok, thx for the help, it now works fine, now I only need to finish the code, so it works for the other TI's too![]()
![]()
This space is empty... or is it?

You just loaded a save game? In that case this is to less. You have also to reloadslic to do it just open the chat window by typing the apostrophe key (') and enter /reloadslic. Alternatively you can also open the cheat editor and press the reloadslic button. BTW the cheat editor is a great tool to test such code, but don't expect if you place a tile improvement with the cheat that you get the bonus you have to do it regulary. But you can first place a tile improvement and then close the cheat editor and place then the upgrate improvement.Originally posted by ADG
I just loaded a savegame to test if it works, but I don't get the bonus...
-Martin
Civ2 military advisor: "No complaints, Sir!"

Hey you are already commenting codes. Big step in slic learning.Originally posted by ADG
Is it because in this line, you sets the number of the player. Shouldn't it be something like the i in PW_BONUS[i]? Otherwise the player who gets the bonus is always the same player... or am I mistaking here?
Code:setPW(player[0], FinalPW);
Let me aswer you:
Check this part:
The SetPW(int_tCode:InitialPw = player[0].publicworkslevel; FinalPW = InitialPw + PW_BONUS[i]; SetPW(player[0], FinalPW);, int_t) function works not adding the value of the second argument (int_t) to the player PW amount but replacing.
So in this piece of code:
line1: i get the player PW (InitialPW)
line2: make a new value(FinalPW) adding to the InitialPW value the PW_BONUS[i]
line3: Change the PW reserve of the player[0] to be equal to FinalPW
Remember: the TI entry names can be foun in the tileimp.txt
PS: I learnt slic in less than two days reading the info in this thread and locutus slic manual:
http://apolyton.net/forums/showthrea...threadid=33181
Of course. Make codes that actually worked took me a little while
EDIT: I never had experience in any coding language. Slic was the first.
Last edited by Pedrunn; September 14, 2002 at 09:33.
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Bookmarks