June 14, 2001, 09:32
|
#1
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
New Mod
Prisoners of War/Traitors Mod
Readme:
One thing I missed in CTP and CTP2 from Civ2 was the diplomat/spy ability to bribe enemy units to join your army. To simulate this effect exactly would be very difficult to do, but I have been able to write some code that enables the player to capture enemy units in battle, and force them to fight for you.
To capture units in battle, stack a slaver with your army, which will enable the capture code to work.
The capturing takes place right at the end of the battle, because during testing I had found a way to attack and retreat with loads of different units, suffer few casualties, and double my army size... (This no longer works). Due to the difficulties in collecting equipment and materials, once you have captured the enemy soldiers, you are given a choice of how they should be incoporated into your army. All the choices are basically infantry units.
Age 1:
-Warrior
-Hoplite
-Archer
Age 2:
-Pikeman
-Samurai
-Archer
Age 3:
-Pikeman
-Infantryman
-MachineGunner
Age 4:
-Machine Gunner
-Paratrooper
-Marine
Age 5:
-Hover Infantry
-Marine
-Paratrooper
__________________________________
It always annoyed me, not having that "bribe" feature, but this is the best I can (or would be prepared to) do to bring it back.
Hope you all like it, it will be on the Way of the Wombat soon, but I'll attatch it here, because its basically only a slic file.
|
|
|
|
June 14, 2001, 12:06
|
#2
|
Emperor
Local Time: 05:51
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
|
Ben,
Does this code work both ways??? - will the AI be able to also use this code to capture units???
...if so, I will be putting it in Cradle then.
after I test it.
hey, your avatar isn't stabbing anymore!!!
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
|
|
|
|
June 14, 2001, 14:28
|
#3
|
Chieftain
Local Time: 07:21
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Dallas, TX USA
Posts: 89
|
That's pretty cool, but the AI does not seem to use slavers in an army stack. Seems like another unfair advantage to the human player. Also aren't slavers eventually phased out with the Emancipation Wonder? Any way to have it happen with any unit? Still pretty cool. Let me just say that the modders on CTP II come up with some of the neatest things. CTP II seems to be able to do a lot of things (with a lot of work).
|
|
|
|
June 14, 2001, 19:29
|
#4
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
The AI will also be able to capture units. Whether or not they could figure the buttons out is another matter, but if they can't, then some simple code will sort that, and the AI will get a certain unit per age, or a randomly chosen one.
Quote:
|
Also aren't slavers eventually phased out with the Emancipation Wonder?
|
Oops, forgot about that... But yes, it is possible to easily change the enabling unit to anything you want. "Battlemaster" or something. Details of the SLIC line to change are included in the readme.
No, my avatar isn't stabbing anymore I found the quality was poor (not that this one is much better) and it just seemed too assertive, and soooo cheesy. Maybe I will make an even better one someday. (When this is finished, Mars is done, my LOTR mentoring finished...)
Glad you like it. I thought you might want to use it Dave
Ben
|
|
|
|
June 15, 2001, 09:23
|
#5
|
Emperor
Local Time: 05:51
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
|
Ben,
What I would like to do is tie this coding into all of my wonder units (and possibly a couple others) instead of the slaver unit. Is it possible to code for multiple units?
I also would like to limit the coding to the weakest unit available in each age - i.e warrior/hoplite for the ancient, man-at-arms/infantryman for the medieval and machine gunner for modern/future. I think I can handle that part of the coding though.
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
|
|
|
|
June 15, 2001, 13:19
|
#6
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
Yeah, that would be good.
Probably this will work, though this code gave me a few problems due to built-in SLIC bugs
Code:
|
HandleEvent(VictoryMoveOrder) 'capture' pre {
tmpArmy = army[0];
tmpNum = tmpArmy.size;
tmpPlayer = army[0].owner;
for(i = 0; i < tmpNum; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
tmpNum2 = tmpUnit.type;
if(tmpNum2 == 56 || tmpNum2 == 99){
// number of unit. this example is slaver - || = "or", add as many as you need, with the correct numbers.
age = WOUTER_GetAge(tmpPlayer);
if(age == 5){
message (tmpPlayer, 'five');
}
elseif(age == 4){
message(tmpPlayer, 'four');
}
elseif(age == 3){
message(tmpPlayer, 'three');
}
elseif(age == 2){
message(tmpPlayer, 'two');
}
elseif(age == 1){
message(tmpPlayer, 'one');
}
}
}
} |
If you were limiting it to one unit per age, then you can dispense with the messageboxes completely, as just put the CreateUnit event into the above code, instead (or as well as) the message. Also the buttons would not be needed. Just email me if it starts causing problems.
Ben
|
|
|
|
June 15, 2001, 15:50
|
#7
|
Emperor
Local Time: 05:51
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
|
When you mentioned SLIC problems, what were they?
I'm a bit confused as to how I can implement this coding - I glanced at it yesterday and noticed the section that referrred to the slaver.
if(tmpNum2 == 56 || tmpNum2 == 99){
I'm assuming that the above line is the one that I need to be concerned with. I'm assuming that I also need to cut and paste the entry
tmpNum2 == 56 ||
using it for each unit that I want to have the ability and then replacing the numbers with the numbers in units.txt that correspond to each unit.
I'm also looking at getting the following progression too. In looking at the coding again, I'm also a bit confused as to how I will code in the following info, as my setup is different from the default game. This is how I would like to see it happen
Captured unit becomes Spearman
Enable Advance is Toolmaking,
Obsolete Advance is Bronze Working
Captured unit becomes Hoplite
Enable Advance is Bronze Working,
Obsolete Advance is Dark Ages
Captured unit becomes Man at Arms
Enable Advance is Dark Ages,
Obsolete Advance is Flintlock
Captured unit becomes Infantryman
Enable Advance is Flintlock,
Obsolete Advance is Advanced Infantry Tactics
Captured unit becomes Machine Gunner
Enable Advance is Advanced Infantry Tactics,
Obsolete Advance is Chaos Theory
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
Last edited by hexagonian; June 15, 2001 at 16:46.
|
|
|
|
June 16, 2001, 06:06
|
#8
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
The problems were difficulties getting it to work. They are solved (I hope) or I wouldn't have released it.
Quote:
|
I'm a bit confused as to how I can implement this coding - I glanced at it yesterday and noticed the section that referrred to the slaver.
if(tmpNum2 == 56 || tmpNum2 == 99){
I'm assuming that the above line is the one that I need to be concerned with. I'm assuming that I also need to cut and paste the entry
tmpNum2 == 56 ||
using it for each unit that I want to have the ability and then replacing the numbers with the numbers in units.txt that correspond to each unit.
|
That is correct, but the last unit in that line does not need the || after it, as the double line means "or", so the last tmpNum2 = xx does not need it.
Because you are only doing it with one unit being captured, you can leave out the buttons, and just have the alertboxes to make you aware that it has happened.
So...
If you look at the WOUTER_GetAge function that I took from the militia code, you can remove the "&& HasAdvance(tmpPlayer, ID_ADVANCE_XXX) bit from each line, then replace the first advance on each line with the advance you want there.
Because you want the code to obsolete at Chaos Theory, it will need an extra line or two.
You've done it in reverse really, I had it start late, and not finish, you have it set to start at the beginning and finish early.
|
|
|
|
June 16, 2001, 06:16
|
#9
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
Here is the code to make it work, note that you will probablt want to change the messages in scen_str.txt, because they were set up for a choice of captured units.
|
|
|
|
June 16, 2001, 22:30
|
#10
|
Emperor
Local Time: 05:51
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
|
Thanks Ben,
I got a really good game going now and I am hoping that plugging this coding into the current game will not effect it.
Do all I need to do is make my SLIC alterations and then reload SLIC via the cheat mode?
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
|
|
|
|
June 17, 2001, 15:36
|
#11
|
Prince
Local Time: 11:51
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
If you use the chat mode to reload the SLIC , (press ' , then /reloadslic ) then you can keep your score.
I think that should be fine.
|
|
|
|
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 06:51.
|
|