Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > I've got a few q's about modding
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 16:42
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
I've got a few q's about modding Put an end to popups!

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?

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:22
  Old Post 13-09-2002 17:10
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, pre-order Civilization IV

2. Change all the TIME_SCALE values in DiffDB.txt for each difficulty level.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 17:25
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Enter the AD-FREE zone

Thx

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 13-09-2002 17:29
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Full PM-box? Change here!

DP. and if you copied the code that was in here try the next post one

Last edited by Pedrunn on 13-09-2002 at 17:37

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 13-09-2002 17:31
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

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

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 } } } }

Obs: UNTESTED, UNTRIED and MAY GIVE SLIC SYNTAX ERRORS.
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:
code:
#include "AnyFile.slc"

This means the AnyFile.slc is included. if this file doesnt exist you get slic errors.

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:
code:
ProdutionTime

and there you go

PS: did you fixed the errors you were getting from your last modding attept?

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 19:07
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Inflate your Upload Space

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 on 13-09-2002 at 19:18

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 13-09-2002 19:15
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

But you still get errors when loading CTP2?

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 19:26
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Get a bigger avatar today!

I only get the new slic error... The other error got fixed

quote:

OLD_TILEIMP[0]
NEW_TILEIMP[0]
PW_BONUS[0]

OLD_TILEIMP[1]
NEW_TILEIMP[1]


What does the number in [] mean? this might be what causes the error...

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 20:48
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Enter the AD-FREE zone

Hmmm... how come it says, Pedrunn was the last one to reply... even after tons of refreshing of the browser..?

mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 13-09-2002 22:34
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Suffering from ads?

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...

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 22:46
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Get a bigger avatar today!

Ok, let's see if I understud it. If I make more of those in Pedrunns example, I have to do like this: (?)

quote:
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;


Ok, I didn't check if I spelled right... But is it something like that?

mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 13-09-2002 22:49
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Support Apolyton buy from Amazon

That's what you want, yes.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 13-09-2002 22:54
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Ok, thx for the help

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 13-09-2002 23:21
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Enter the AD-FREE zone

DP

Last edited by Pedrunn on 13-09-2002 at 23:28

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 13-09-2002 23:22
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Increase the size of your Attachments

There are actually three errors:
1) A missing ';' after

code:
int_t InitialPw


2) A missing ')' ater the line (you can see that i open two '(' but i dont get one of them closed
code:
if(TileHasImprovement(location[0], OLD_TILEIMP[i]) {


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.


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 on 14-09-2002 at 17:21

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:22
Post  Old Post 14-09-2002 03:25 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by ADG
Ok, I didn't check if I spelled right... But is it something like that?


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

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 16:49
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally 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


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 anyway

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 17:12
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

It says there's a syntax error on this line:

code:
if(TileHasImprovement(location[0], OLD_TILEIMP[i])) {

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 14-09-2002 17:24
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Avatar Enlargement: We've got the solution

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.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 17:31
Edit/Delete Message Reply w/Quote
#20 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

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 )...

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 17:35
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Suffering from ads?

I just loaded a savegame to test if it works, but I don't get the bonus...

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 17:40
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by ADG
I just loaded a savegame to test if it works, but I don't get the bonus...


EDIT: Woops, I ment to edit instead of reply...

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);

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 14-09-2002 17:56
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Support Apolyton, buy Call to Power 2

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

code:
/reloadslic

And press enter. The game will search for new codes and changes in the code in your game data.
New games dont need this procedure.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:22
  Old Post 14-09-2002 18:00
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Support Apolyton buy from Amazon

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

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:22
Post  Old Post 14-09-2002 18:01 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by ADG
I just loaded a savegame to test if it works, but I don't get the bonus...


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.

-Martin

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 14-09-2002 18:14
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

quote:
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);


Hey you are already commenting codes. Big step in slic learning.
Let me aswer you:
Check this part:

code:
InitialPw = player[0].publicworkslevel; FinalPW = InitialPw + PW_BONUS[i]; SetPW(player[0], FinalPW);

The SetPW(int_t, 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/showthre...&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 on 14-09-2002 at 18:33

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:22.
Apolyton Time is 00:22.
    top of page
Rate This Thread:
archivepost
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0540 seconds (91.67% PHP - 8.33% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net