September 6, 2002, 06:07
|
#1
|
Deity
Local Time: 09:34
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Advance from city capture
I got an email today in which I was asked the following:
Quote:
|
[...]
Something else. One feature of CTP1 which was never carried over to Ctp2 was the ability to find an advance in a captured city. I really liked that feature and a number of CTP1 players I spoke to said that they didnt play ctp2 because this feature was missing. Any chance of a mod to change that?
[...]
|
I think we've tried this in the past, haven't we? Why did it never work out? I would like to have this back myself as well...
|
|
|
|
September 6, 2002, 06:53
|
#2
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
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?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 6, 2002 at 07:12.
|
|
|
|
September 6, 2002, 07:36
|
#3
|
Deity
Local Time: 09:34
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Ah, yes. Well, that isn't very hard then. It's a lot of work, but it isn't be hard. Modmakers could do this themselves, no need to rely on SLIC-coders for this. All we need now is someone willing to copy-paste the else-if clause 100+ times (per mod) and fill in the right advance names...
Quote:
|
Originally posted by Pedrunn
PS: Shouldnt this be in the Creation Forum?
|
Yes, I accidentally posted it in the wrong forum and notified Ming only seconds after posting the thread, but he doesn't seem to be online. (If only Markos would let me moderate these forums myself...)
|
|
|
|
September 6, 2002, 11:11
|
#4
|
Deity
Local Time: 00:34
Local Date: November 1, 2010
Join Date: Dec 2000
Location: Baron of Sealand residing in SF, CA
Posts: 12,344
|
Quote:
|
Originally posted by Locutus
(If only Markos would let me moderate these forums myself...)
|
I'm actually surprised that you don't have moderation powers for the CTP2 Forums....
__________________
____________________________
"One day if I do go to heaven, I'm going to do what every San Franciscan does who goes to heaven - I'll look around and say, 'It ain't bad, but it ain't San Francisco.'" - Herb Caen, 1996
"If God, as they say, is homophobic, I wouldn't worship that God." - Archbishop Desmond Tutu
____________________________
|
|
|
|
September 6, 2002, 11:55
|
#5
|
Deity
Local Time: 09:34
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
No, Markos only gives out modding powers when he thinks they are needed (yes, I know Scenario League has 3 mods, two of whom have never used their modding powers (the third one only once)).
Oh well, what can you do (besides harassing Ming every other day )?
|
|
|
|
September 6, 2002, 12:54
|
#6
|
Prince
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
|
Locutus you should be moderator very strange why your not ?????
This capture code would be very cool as long as it was a relativly small % chance say 25% or whatever works best.
|
|
|
|
September 6, 2002, 13:07
|
#7
|
Deity
Local Time: 09:34
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Tell Markos, don't tell me! It's not like Ming and I haven't asked for it (several times each)...
Yes, I agree, adding a chance element would be nice...
|
|
|
|
September 6, 2002, 13:41
|
#8
|
Super Moderator
Local Time: 09:34
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by SMIFFGIG's
This capture code would be very cool as long as it was a relativly small % chance say 25% or whatever works best.
|
Actual this is the original indented chance I found in my GM1_Const.txt.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
September 14, 2002, 02:58
|
#9
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
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.
|
|
|
|
September 14, 2002, 08:30
|
#10
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
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.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 14, 2002 at 08:42.
|
|
|
|
September 14, 2002, 08:38
|
#11
|
Emperor
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
|
Would you like me to write a little application to process any given advance.txt and spew out appropriate SLIC? I could do that really easily.
|
|
|
|
September 14, 2002, 08:47
|
#12
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
You mean make this repetitive lines for all mods with a couple of clicks?
For sure.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 14, 2002 at 08:58.
|
|
|
|
September 14, 2002, 10:29
|
#13
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
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.
|
|
|
|
September 15, 2002, 14:43
|
#14
|
Emperor
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
|
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.
Last edited by J Bytheway; September 16, 2002 at 09:36.
|
|
|
|
September 15, 2002, 20:22
|
#15
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
It just stops here and I cant anywhere else:
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
September 16, 2002, 09:39
|
#16
|
Emperor
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: England
Posts: 3,826
|
Sorry - I uploaded a previous version which didn't work, not the latest one . That's the second time I've made that mistake... I've changed the attachment above, it should work now. And incidentally, the default output is to temp.slc, (as you can see in Pedrunn's screenshot).
|
|
|
|
September 16, 2002, 15:33
|
#17
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
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 %.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 16, 2002 at 16:05.
|
|
|
|
September 16, 2002, 15:45
|
#18
|
Prince
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
|
Yes nice one peddy and JBytheway this is so class all the stuff comming out for ctp2 mod wise
wonder why they took this feature out of ctp2 from ctp1 anyway. did it work different in ctp1?
Anyway Pedrunn i REALLY thing you should change it to a 25% chance as it was in C:CtP otherwise i just dont think it will be balanced
anyway im in a rush but that is on my definates to download and should be in ALL mod packs i think it should have a news item maybe too ? Cause it could mean alot to quite alot of C:CtP players who dont play CtP2
I dunno just an idea
P.S. Pedrunn read my barbarian ideas thread ( please )
cya
__________________
Oxygen should be considered a drug
Tiberian Sun Retro
My Mod for Tiberian Sun Webmaster of
http://www.tiberiumsun.com
|
|
|
|
September 17, 2002, 01:52
|
#19
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
Help needed
I cant open SLC files. Whenever I try to open one or download it, I start to get the message window "You have chosen to download a file from this location etc". The window then starts flashing quickly and my computer locks up.
Any ideas pls?
I have Windows 98.
|
|
|
|
September 17, 2002, 07:08
|
#20
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Open them with the windows notepad, or the wordpad, or any other program that opens text file. Try this. This way you can include my code in the Apolyton mod (the line goes in the APOL_script) or in the GoodMod (GM1_script.slc) or any other mod that uses the original tech tree (city expansion, fixmod, visi wonder ...)
If you still can get to open (what will be very very very strange) in last case replace the script.slc for this one. The change will be for the original game. Keep me informed even if it worked and you need no further help, ok?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
September 17, 2002, 07:28
|
#21
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
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.
|
|
|
|
September 17, 2002, 07:50
|
#22
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Does this happens with others files other then slic ones?
What about mods? They work?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 17, 2002 at 07:56.
|
|
|
|
September 17, 2002, 07:58
|
#23
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
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.
|
|
|
|
September 17, 2002, 17:33
|
#24
|
Warlord
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Mar 2000
Location: Luxembourg, Europe
Posts: 116
|
Your computer almost certainly was assimilating the .slc extension with explorer (which could not read it).
Marc aka Caran...
|
|
|
|
September 17, 2002, 17:55
|
#25
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
Quick question, doesnt work with Cradle does it ?
|
|
|
|
September 17, 2002, 18:11
|
#26
|
Prince
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
no. the numbering is different, a different version needs to be made.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
|
|
|
|
September 17, 2002, 18:35
|
#27
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Craddle version 1.3 (should work for others versions),
Write this line in every CRA*_script (There is one for every modswapper option
Code:
|
# include"CRA_CityAdvance.slc" |
But i am waiting a word from hexagonia to know if it will be included in Craddle 1.33 or not?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
September 18, 2002, 03:54
|
#28
|
Local Time: 07:34
Local Date: November 1, 2010
Join Date: Feb 2002
Location: australia
Posts: 733
|
Sorry Pedrunn, can U be more specific about the placement of the above code. I'm not code literate (((((
|
|
|
|
September 18, 2002, 07:24
|
#29
|
King
Local Time: 04:34
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
copy the file in the ctp2_data\default\gamedata\ like the other file.
Then write
Code:
|
# include"CRA_CityAdvance.slc" |
in the CRA_script.slc,
in the CRAG_script.slc,
in the CRAI_script.slc ,
and in the CRARR_script.slc,
Every one of thes files changes multiple Cradde modswapper choices. Since i dont know wich ones i recommend you to paste that line in all these file. So all modswapper options game will have this feature.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
September 18, 2002, 08:27
|
#30
|
Prince
Local Time: 08:34
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
note: write that line right at the bottom to be safe.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
|
|
|
|
Posting 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
|
|
|
All times are GMT -4. The time now is 03:34.
|
|