 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:22
|
|
I have tried this myself but the problem is the arguments of the HasAdvance(int_t, advance ID) and the GrantAdvance(int_t, advance DB).
The ID of an advance does not equal its database number.
So the real problem is how to interact both functions after that the code will be piece of cake.
I had already imagined in create a new HasAdvance function that goes like this:
code:
NewHasAdvance(int_t thePlayer , int_t theAdvance) {
int_t tmpAdvance;
int_t tmpPlayer;
tmpPlayer = thePlayer;
tmpAdvance = theAdvance;
if(tmpAdvance == AdvanceDB(ADVANCE_ASTRONOMY)
if(HasAdvance(tmpPlayer, ID_ADVANCE_ASTRONOMY)) {
return 1;
}
elseif(tmpAdvance == AdvanceDB(ADVANCE_ARCOLOGIES)
if(HasAdvance(tmpPlayer, ID_ADVANCE_ARCOLOGIES)) {
return 1;
}
}
// ....
// for all advances
// ....
return 0;
}
The major problem is that every mod will have to make big changes in this function to fit all of its advances.
Yet once done. We would just need to write this code:
code:
HandleEvent(CaptureCity) 'GiveThePlayerAdvanceFromCity' pre {
int_t i;
int_t sucess;
while( sucess == 0 && i < 200) {
if(NewHasAdvance(player[1], i) && !NewHasAdvance(player[0], i) {
GrantAdvance(player[0], i);
sucess = 1;
}
i = i + 1;
}
}
done
PS: Shouldnt this be in the Creation Forum?
Last edited by Pedrunn on 06-09-2002 at 16:12
|
|
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:22
|
|
Hello all, I was the one who emailed Locutus.
I have been a gamer for many years and I look for games that are challenging, balanced, streamlined and fun to play.
I received Medieval Total War on tuesday and think after 4 days how a couple of concepts in the game just ruin the overall fun. So many games like Civ 3 and MTW seem to to equate difficulty levels with just giving the AI a heap of freebies and let U just suffer. In MTW you can wipe out a small factuin and the computer will just re-activate them later. Not so bad BUT it can just give the faction an overwhelming force out of the blue and just dump it in one or more of your provinces. In other words, no matter what U do, the this army, often bigger than the total army the faction fielded when when it was in play, and with no restriction of support, just is dumped on U.
What games need is a balancer to offset what some would say is playing against someone who cheats. Things like the advance from city capture are a nice balancer. In other words there is something the player can do to partially redress the advantages given to the AI.
Please dont forget this project and I hope someone is working on the mod to achieve it. if I knew anything about programming, I would be straight into it myself.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:22
|
|
I tested the code now! Something i hadnt done before. it needed some small changes in syntax and it worked amazingly. We just need someone to compile all advances to it.
stankarp, Dont you want to do this? It isnt hard at all. Even if you have any skill in coding. You just need to open the advance.txt found in the folder ctp2 main directory\ctp2_data\default\gamedata\
In this file you will find the data for all advances. Then replace the '*' for the advance entry name In the piece of code below. Then copy this piece of code after similar lines of the code.
code:
elseif(tmpAdvance == AdvanceDB(*)) {
if(HasAdvance(tmpPlayer, ID_*)) {
return 1;
}
}
I did for the first four advances. Here how it should look like:
code:
int_f NewHasAdvance(int_t thePlayer , int_t theAdvance) {
int_t tmpAdvance;
int_t tmpPlayer;
tmpPlayer = thePlayer;
tmpAdvance = theAdvance;
if(tmpAdvance == AdvanceDB(ADVANCE_ADV_INFANTRY_TACTICS)) {
if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_INFANTRY_TACTICS)) {
return 1;
}
}
elseif(tmpAdvance == AdvanceDB(ADVANCE_ADV_NAVAL_TACTICS)) {
if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_NAVAL_TACTICS)) {
return 1;
}
}
elseif(tmpAdvance == AdvanceDB(ADVANCE_ADV_URBAN_PLANNING)) {
if(HasAdvance(tmpPlayer, ID_ADVANCE_ADV_URBAN_PLANNING)) {
return 1;
}
}
elseif(tmpAdvance == AdvanceDB(ADVANCE_ADVANCED_COMPOSITES)) {
if(HasAdvance(tmpPlayer, ID_ADVANCE_ADVANCED_COMPOSITES)) {
return 1;
}
}
// TEMPLATE: where * must be replaced by a advance entry name from the advance.txt
// elseif(tmpAdvance == AdvanceDB(*)) {
// if(HasAdvance(tmpPlayer, ID_*)) {
// return 1;
// }
// }
// ....
// for all advances
// ....
return 0;
}
HandleEvent(CaptureCity) 'GiveThePlayerAdvanceFromCity' pre {
int_t i;
int_t sucess;
int_t Conqueror;
int_t conquered;
Conqueror = player[0];
conquered = city[0].owner;
while(sucess == 0 && i < 200) {
if(!NewHasAdvance(Conqueror, i) == 1
&& NewHasAdvance(conquered, i) == 1) {
GrantAdvance(Conqueror, i);
sucess = 1;
}
i = i + 1;
}
}
Obs: // is comment. nothing after this sign is part of the code.
Last edited by Pedrunn on 14-09-2002 at 17:42
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:22
|
|
Sorry, but I dont know the first thing about programming and changing codes. When i retire in 9 weeks time I might try to do some corses to give me some basic ideas. until then, please keep up the good work and I eagerly await the mod.
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:22
|
|
Here's a program which will do that and some more...
I've no time to write any documentation right now, but the short version is to unzip, put advance.txt into the same directory and run run.bat. You can fiddle with template.txt and run.bat to get different results, such as use units.txt for input. It should all be fairly obvious.
Attachment: ctptempl.zip
This has been downloaded 6 time(s).
Last edited by J Bytheway on 16-09-2002 at 18:36
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:22
|
|
Here it is what we all wanted. The code is ready.
Just open the folder:
ctp2 main directory\ctp2_data\default\gamedata\
copy this file inside it.
and in the same folder open the file:
script.slc
inside this file paste this line:
code:
# include"CityAdvance.slc"
I dont think any futher explanation is needed unless that You have a 25 % chance of getting the advance and if you do a message will show up.
Thanks Jonh. The aplication works beautifuly and it is pretty useful.
EDIT: Changed the chance from 50 % to 25 %.
Attachment: cityadvance.slc
This has been downloaded 9 time(s).
Last edited by Pedrunn on 17-09-2002 at 01:05
|
|
|  |
 |
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:22
|
|
Thanks Pedrun but I still have the same problem. My Windows 98 must be corrupted. Will have to reload or something. When i donloaded wither of your two files the same thin occured and if i try to open a SLC file in the CTP2 folder it also does it.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:22
|
|
Does this happens with others files other then slic ones?
What about mods? They work?
Last edited by Pedrunn on 17-09-2002 at 16:56
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:22
|
|
I have solved the problem with your help Pedrunn.
Found my computer was trying to open the files with Explorer rather than Notepad. Changed the file and now I can open it so i should be able to download now.
Thanks.
|
|
|  |
 |
|
stankarp
|
|
australia
Feb 2002 time: 05:22
|
|
Quick question, doesnt work with Cradle does it ?
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|