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 > Civilization: Call To Power > CtP-Creation > Some SLIC I haven't seen before
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
12.Sep: `CTP CHALLENGE LADDER` - SEPTEMBER UPDATE
09.Sep: EARLY BUILD SPRITE EDITOR
02.Aug: `SUPERLEAGUE` SIGN-UP

bottom of page
  - CIVILIZATION: CALL TO POWER @ GAMESTOP $9.99 - CIVILIZATION: CALL TO POWER @ AMAZON $9.99
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
  Old Post 10-05-2004 19:55
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Some SLIC I haven't seen before Support Apolyton

Okay, so like I finally got around to pulling this old game out from under a layer of dust and started to look at this huge mod I was working on a couple years ago...

Anyway, I found this SLIC code I did and thought someone might like to use it, as I haven't really seen anything like it here before. But I haven't been around much, so maybe I missed it?

This first one deals with unit upgrades. It allows you to pay gold to upgrade one or all of your units when you get the right techs:

Generic replace function:

code:
messagebox 'msgReplaceUnits' { Title(ID_TITLE_upgrade_query); MessageType("TP_QUEUE_EMPTY_AFTER_UNIT"); MessageClass(789); i = 0; onecost = 0; oldunitcount = 0; while (i < player.totalunits) { SetUnitByIndex(1, g.player, i); if (unit.type == oldunittype) { oldunitcount = oldunitcount + 1; } i = i + 1; } if(oldunitcount>0) { onecost = (newunitcost) - (oldunitcost); if (onecost <= player.gold) { KillClass(g.player,987); MessageClass(987); privoldunittype=oldunittype; privnewunittype=newunittype; privoldunitcost=oldunitcost; privnewunitcost=newunitcost; privtotalcost = (privnewunitcost*oldunitcount) - (privoldunitcost*oldunitcount); privonecost = privnewunitcost - privoldunitcost; if (privtotalcost <= player.gold && oldunitcount>1) { Button(ID_BUTTON_Do_upgrade) { AddGold(player, -privtotalcost); i = 0; while (i < player.totalunits) { SetUnitByIndex(1, player, i); if (unit.type == privoldunittype) { oldunitlocation = unit.location; // KillUnit(unit.1); SetOrder(1, 56); AddOrder(unit, oldunitlocation); CreateUnit(player, privnewunittype, oldunitlocation, 0); } else { i = i + 1; } } KillClass(g.player, 987); } } Button(ID_BUTTON_Do_one_upgrade) { AddGold(player, -privonecost); i = 0; while (i < player.totalunits) { SetUnitByIndex(1, g.player, i); if (unit.type == privoldunittype) { oldunitlocation = unit.location; SetOrder(1, 56); AddOrder(unit, oldunitlocation); CreateUnit(player, privnewunittype, oldunitlocation, 0); // KillUnit(unit.1); KillClass(player, 987); message(g.player,'msgReplaceUnits'); } else { i = i + 1; } } } Button(ID_BUTTON_LibraryNew) { LibraryUnit(privnewunittype); } Button(ID_BUTTON_LibraryOld) { LibraryUnit(privoldunittype); } if (oldunitcount>1) { Text(ID_TEXT_upgrade_query); } else { Text(ID_TEXT_upgrade_one_query); } } else { Abort(); } } else { Abort(); } }


example trigger:
code:
trigger 'IronWorking_trigReplaceUnits' when (HasAdvance(g.player, ID_ADVANCE_IRON_WORKING) ) { if(HasAdvance(g.player, ID_ADVANCE_EUROPEAN_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); } if(HasAdvance(g.player, ID_ADVANCE_AFRICAN_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); } if(HasAdvance(g.player, ID_ADVANCE_EASTERN_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_LEGION"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_LEGION); message(g.player,'msgReplaceUnits'); } if(HasAdvance(g.player, ID_ADVANCE_NATIVE_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_BERSERKER"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_BERSERKER); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_BERSERKER"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_BERSERKER); message(g.player,'msgReplaceUnits'); } if(HasAdvance(g.player, ID_ADVANCE_WESTERN_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_BERSERKER"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_BERSERKER); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_BERSERKER"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_BERSERKER); message(g.player,'msgReplaceUnits'); } if(HasAdvance(g.player, ID_ADVANCE_ASIAN_CIV)) { oldunittype = UnitType("UNIT_WARRIOR"); newunittype = UnitType("UNIT_SAMURAI"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_WARRIOR); SetString(1,ID_UNIT_SAMURAI); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_SWORDSMAN"); newunittype = UnitType("UNIT_SAMURAI"); oldunitcost = 100; newunitcost = 300; SetString(0,ID_UNIT_SWORDSMAN); SetString(1,ID_UNIT_SAMURAI); message(g.player,'msgReplaceUnits'); } }


I can post the whole file if anyone's interested, but it's fairly customized to my mod. I do have a version w/out the different civ types though.

Let me know if you see any errors I remember there being two issues with this: 1) I can't remember exactly, 2) It only works on the host server pc in multiplayer.

The next one is really simple. It just adds to the city size when a new one is built after arcologies is discovered:

code:
trigger 'GrowCity' when (city.built) { if (HasAdvance(g.player, ID_ADVANCE_ARCOLOGIES) ) { if (IsUnderseaCity(city) ) { AddPops(city,3); } // terraintype 13 = space - done this way because isspacecity function is broken elseif (TerrainType(city.location) == 13 ) { AddPops(city,1); } else { AddPops(city,5); } } }


The next script deals with having different units for different types of civilizations (ie: african, european, asian...). What I did here was I created a bunch of different advances to define each civilization type, and assigned them to the actual civs:

code:
trigger 'trigStartUpCiv' when ((g.year == 0) && (IsPlayerAlive(g.player))) { Message(g.player, 'msgStartUpCiv'); } messagebox 'msgStartUpCiv' { //civtype 0 = None - barbarian //civtype 1 = Native Indian - sioux, iroquois //civtype 2 = European - greek, russian, spanish, portugese, roman, phoenician, byzantine, italian //civtype 3 = Western/Eurpoean 2 - american, scottish, english, german, french, dutch, vikings, turkish, celtic, austrian, hungarian, swedish //civtype 4 = Asian - japanese, chinese, thai, polynesian, indonesian, korean, mongolian //civtype 5 = African/South American - zulu, mayan, incan, aztec, brazilian, mexican, ethiopian, bantu //civtype 6 = Middle Eastern - Arabian, persian, egyptian, hebrew, indian, assyrian nativeciv=177; europeanciv=178; africanciv=179; asianciv=180; easternciv=181; westernciv=182; //civtype 0 = None - barbarian if(PlayerCivilization(g.player) == CivilizationIndex("BARBARIAN")) { GrantAdvance(g.player,westernciv); GrantAdvance(g.player,easternciv); GrantAdvance(g.player,asianciv); GrantAdvance(g.player,nativeciv); GrantAdvance(g.player,africanciv); GrantAdvance(g.player,europeanciv); } //civtype 1 = Native Indian - sioux, iroquois if(PlayerCivilization(g.player) == CivilizationIndex("SIOUX")) { GrantAdvance(g.player,nativeciv); } if(PlayerCivilization(g.player) == CivilizationIndex("IROQUOIS")) { GrantAdvance(g.player,nativeciv); } //civtype 2 = European - greek, russian, spanish, portugese, roman, phoenician, byzantine, italian if(PlayerCivilization(g.player) == CivilizationIndex("GREEK")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("RUSSIAN")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("ITALIAN")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("ROMAN")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("PHOENICIAN")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("BYZANTINE")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("SPANISH")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("BYZANTINE")) { GrantAdvance(g.player,europeanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("PORTUGUESE")) { GrantAdvance(g.player,europeanciv); } //civtype 3 = Western/Eurpoean 2 - american, scottish, english, german, french, dutch, vikings, turkish, celtic, austrian, hungarian, swedish if(PlayerCivilization(g.player) == CivilizationIndex("AMERICANS")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("SCOTTISH")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("SLAVIC")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("ENGLISH")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("GERMAN")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("FRENCH")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("DUTCH")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("VIKING")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("TURKISH")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("CELTIC")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("AUSTRIAN")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("HUNGARIAN")) { GrantAdvance(g.player,westernciv); } if(PlayerCivilization(g.player) == CivilizationIndex("SWEDISH")) { GrantAdvance(g.player,westernciv); } //civtype 4 = Asian - japanese, chinese, thai, polynesian, indonesian, korean, mongolian if(PlayerCivilization(g.player) == CivilizationIndex("JAPANESE")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("CHINESE")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("THAI")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("POLYNESIAN")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("INDONESIAN")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("KOREAN")) { GrantAdvance(g.player,asianciv); } if(PlayerCivilization(g.player) == CivilizationIndex("MONGOL")) { GrantAdvance(g.player,asianciv); } //civtype 5 = African/South American - zulu, mayan, incan, aztec, brazilian, mexican, ethiopian, bantu if(PlayerCivilization(g.player) == CivilizationIndex("ZULU")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("MAYAN")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("INCAN")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("AZTEC")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("BRAZILIAN")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("MEXICAN")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("ETHIOPIAN")) { GrantAdvance(g.player,africanciv); } if(PlayerCivilization(g.player) == CivilizationIndex("BANTU")) { GrantAdvance(g.player,africanciv); } //civtype 6 = Middle Eastern - Arabian, persian, egyptian, hebrew, indian, assyrian if(PlayerCivilization(g.player) == CivilizationIndex("ARABIAN")) { GrantAdvance(g.player,easternciv); } if(PlayerCivilization(g.player) == CivilizationIndex("PERSIAN")) { GrantAdvance(g.player,easternciv); } if(PlayerCivilization(g.player) == CivilizationIndex("EGYPTIAN")) { GrantAdvance(g.player,easternciv); } if(PlayerCivilization(g.player) == CivilizationIndex("HEBREW")) { GrantAdvance(g.player,easternciv); } if(PlayerCivilization(g.player) == CivilizationIndex("INDIAN")) { GrantAdvance(g.player,easternciv); } if(PlayerCivilization(g.player) == CivilizationIndex("ASSYRIAN")) { GrantAdvance(g.player,easternciv); } //advance #'s zuluspearman=165; zuluwarrior=166; phalanx=167; warrior=168; swordsman=169; spearman=170; legion=171; samurai=172; berserker=173; espearman=174; slinger=175; archer=176; toolmaking=2; ironworking=11; bronzeworking=5; warriorcode=164; //civtype 0 = None - barbarian //civtype 1 = Native Indian - sioux, iroquois //civtype 2 = European - greek, russian, spanish, portugese, roman, phoenician, byzantine, italian //civtype 3 = Western/Eurpoean 2 - american, scottish, english, german, french, dutch, vikings, turkish, celtic, austrian, hungarian, swedish //civtype 4 = Asian - japanese, chinese, thai, polynesian, indonesian, korean, mongolian //civtype 5 = African/South American - zulu, mayan, incan, aztec, brazilian, mexican, ethiopian, bantu //civtype 6 = Middle Eastern - Arabian, persian, egyptian, hebrew, indian, assyrian //0: CTP1 warrior, Spearman, Mounted Archer, Archer, Chariot, Elephant, Samurai, Legion, Pikeman, Knight, Crusader, Horse Archer, Cavalry, Musketeers.... //1: CTP1 warrior, Spearman, Mounted Archer, Archer, Chariot, Elephant, Berserker, Pikeman, Horse Archer //2: Swordsman, Phalanx, Mounted Archer, Archer, Chariot, Elephant, Legion, Pikeman, Knight //3: Swordsman, Spearman, Mounted Archer, Archer, Chariot, Elephant, Berserker, Pikeman, Knight //4: Swordsman, Spearman, Mounted Archer, Archer, Chariot, Elephant, Samurai, Pikeman, Horse Archer //5: CTP1 Warrior, Zulu Phalanx, Mounted Archer, Zulu Spearman, Chariot, Elephant, Legion, Pikeman, Light Cavalry //6: Swordsman, Egyptian Spearman, Mounted Archer, Slinger, Chariot, Elephant, Legion, Pikeman, Light Cavalry Abort(); }


And then you can add certain units to each civ like this:

code:
trigger 'Toolmaking_trigGiveAdvance' when (HasAdvance(g.player, ID_ADVANCE_TOOLMAKING)) { if(HasAdvance(g.player, ID_ADVANCE_NATIVE_CIV)){ GrantAdvance(g.player, warrior); } if(HasAdvance(g.player, ID_ADVANCE_EUROPEAN_CIV)){ GrantAdvance(g.player,swordsman); } if(HasAdvance(g.player, ID_ADVANCE_WESTERN_CIV)){ GrantAdvance(g.player,swordsman); } if(HasAdvance(g.player, ID_ADVANCE_ASIAN_CIV)){ GrantAdvance(g.player,swordsman); } if(HasAdvance(g.player, ID_ADVANCE_AFRICAN_CIV)){ GrantAdvance(g.player,warrior); } if(HasAdvance(g.player, ID_ADVANCE_EASTERN_CIV)){ GrantAdvance(g.player,swordsman); } }


All I did was add a new tech for each unit, and only allow it when you have the prerequisite tech. The units are only altered (for now) in appearance in my mod. I just couldn't stand the thought of samurai in England and Hoplites in China.

Again, let me know if you see any errors/things I could've done better here. The civ type script concept here has just one major problem: The AI likes to trade the civ type techs! So Japan and Turkey will trade and then turkey can build samurai. Bah.

If I get enough feedback, I could post my mod, but it's fricken huge (like 100+ MB I think), because I added so many new techs, units, improvements (like space/undersea only ones), AI, sprites and library entries, all on top of Celestial Dawn's mod.

Hope these scripts are some help.

L8r.

Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
  Old Post 10-05-2004 20:20
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
I take it back Full PM-box? Change here!

The mod's 120MB, but I can zip it down to 30.7MB. :P

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:36
  Old Post 11-05-2004 03:41 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Get a bigger avatar today!

Thanks for sharing .

There was someone in the CTP2 forums looking for CTP1 unit updater code - I'll point him in this direction.

Code in messageboxes never works properly in MP games - the only way to fix it would be to copy all the messagebox code into the other function.

If you're short of upload space, then I'm sure there's someone around here who could spare some for a good cause .

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:36
  Old Post 11-05-2004 04:34
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Increase the size of your Attachments

Hi, Madd_Mugsey

Long time, no see!

Did you know that the source code for CTP2 has been released? Some of us are working on it:

http://apolyton.net/forums/showthre...threadid=112274

There's a very limited interest in CTP1 creation nowadays.

Tamerlin is offline Tamerlin
King
Toulouse (South-western France)
Apr 2002
time: 06:36
  Old Post 11-05-2004 05:19
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Inflate your Upload Space

quote:
Originally posted by J Bytheway
Thanks for sharing .

There was someone in the CTP2 forums looking for CTP1 unit updater code - I'll point him in this direction.


That's me, thank you J Bytheway.

Madd_Mugsey, I am very interested by a unit updater for Civ: CtP, as I posted it in the CtP2 forum the lack of updater was the last thing that was preventing me from giving Civ: CtP another chance. Needless to say I am interested by the full file.

When I have the time I will adapt this Updater to the Apolyton Pack but as I am new (a newbie actually) to Civ: CtP I don't know what I have to do with the code (do I have to copy it in a file or do I have to #include the file in an existing .slc? Where do I have to copy the Trigger and the unit arrays?).

Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
Thumbs up  Old Post 11-05-2004 19:45
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Wow Enter the AD-FREE zone

What a response! I wasn't expecting anyone to reply so quickly, I thought things were pretty much dead around here...

Here goes:

quote:

Code in messageboxes never works properly in MP games - the only way to fix it would be to copy all the messagebox code into the other function.


Hmmm... It's been like three years since I've looked at this, but if I remember correctly, aren't messageboxes the only way to do functions in SLIC1?

quote:

If you're short of upload space, then I'm sure there's someone around here who could spare some for a good cause .


That would be sweet. I'm just doing some basic testing of the mod now. It needs a serious playtest and balancing I think though. I'm going to move at least one city improvement to another tech and see if I can make a little notification every time a city starts to riot.

quote:

Did you know that the source code for CTP2 has been released? Some of us are working on it:


Nice! I didn't know that. I never bought CTP2 though; can I download the whole thing, or should I find somewhere to pick it up?

quote:

When I have the time I will adapt this Updater to the Apolyton Pack but as I am new (a newbie actually) to Civ: CtP I don't know what I have to do with the code (do I have to copy it in a file or do I have to #include the file in an existing .slc? Where do I have to copy the Trigger and the unit arrays?).


Ooh, this may be more work than you bargained for...

Okay, I attached both the slic and the string file in a zip file.
You have to add include lines for both of them.

Put the Update_scr.slc in the X:\\\\Civ CTP\ctp_data\default\gamedata folder. Edit the script.slc file there, add the line

#include "Update_scr.slc"

at the end.

Put the Update_str.txt in the X:\\\\Civ CTP\ctp_data\english\gamedata folder. Edit the Strings.txt file there, add the line

import "Update_str.txt"

at the end.


You'll need to make some serious alterations to the Update_scr.slc file to get this to work. I have completely redone the tech tree and the units associated with each tech for my mod, and this file reflects those changes. I left out the civ specific stuff, but this is a lot of work already... Here's what you need to do:


Okay you're going to see a whole bunch of triggers in the file that look like this:

code:
trigger 'Metallurgy_trigReplaceUnits' when (HasAdvance(g.player, ID_ADVANCE_METALLURGY) ) { oldunittype = UnitType("UNIT_PIKEMEN"); newunittype = UnitType("UNIT_MUSKETEERS"); oldunitcost = 200; newunitcost = 400; SetString(0,ID_UNIT_PIKEMEN); SetString(1,ID_UNIT_MUSKETEERS); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_GREEK_FIRE"); newunittype = UnitType("UNIT_MUSKETEERS"); oldunitcost = 200; newunitcost = 400; SetString(0,ID_UNIT_GREEK_FIRE); SetString(1,ID_UNIT_MUSKETEERS); message(g.player,'msgReplaceUnits'); oldunittype = UnitType("UNIT_HOPLITE"); newunittype = UnitType("UNIT_MUSKETEERS"); oldunitcost = 100; newunitcost = 200+400; SetString(0,ID_UNIT_HOPLITE); SetString(1,ID_UNIT_MUSKETEERS); message(g.player,'msgReplaceUnits'); }


What this does is it calls the big generic function at the top of the file if the player has the old unit type, and prompts him to replace them with the new unit type for the cost of (newunitcost-oldunitcost)*# units.

Each trigger is called when the player gets a unit giving advance (in this case ID_ADVANCE_METALLURGY). You'll need to make sure that you have triggers corresponding to each of the advances that you're using that give units.

And then, you'll need to put all the possible upgrades in each trigger, basically by copying and pasting this part:
code:
oldunittype = UnitType("UNIT_HOPLITE"); newunittype = UnitType("UNIT_MUSKETEERS"); oldunitcost = 100; newunitcost = 200+400; SetString(0,ID_UNIT_HOPLITE); SetString(1,ID_UNIT_MUSKETEERS); message(g.player,'msgReplaceUnits');

and replacing the old unit and new unit in the variable setting lines and the string setting lines, and altering the costs (which if I remember right are the cumulative production costs for the unit). You'll also need to make sure that this code chunk appears in the correct REVERSE order inside each trigger. For example, I have chosen to upgrade in the order of oldest and weakest unit first. So in this trigger, it goes: upgrade hoplite, upgrade archer, upgrade pikemen. I put the hoplites last and they will be upgraded first.

Okay that's it. Just a few final notes:

This thing will only upgrade one unit type at a time. Ie: You can't upgrade your warriors on the same turn as your hoplites.

I coded in "action" keys to turn the messages on/off. You should see them at the top of the slc file. "[" turns on the upgrade messages. "]" turns them off. I did this because I got tired of being harassed to upgrade when I didn't have any gold


That's it. Let me know if you have any questions.

L8r.

Attachment: update.zip
This has been downloaded 5 time(s).

Tamerlin is offline Tamerlin
King
Toulouse (South-western France)
Apr 2002
time: 06:36
  Old Post 11-05-2004 22:35
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Re: Wow Browse Apolyton AD-FREE

quote:
Originally posted by Madd_Mugsy
What a response! I wasn't expecting anyone to reply so quickly, I thought things were pretty much dead around here...


You are right, the Civ: CtP creation forum is not very active but many players, including many CtP2 modders, are still playing the game.

quote:
Ooh, this may be more work than you bargained for...


I have already reworked Peter Triggs' Updater2 for the CtP2 and the Super Apolyton Pack so I know what I am up to.

quote:
Okay, I attached both the slic and the string file in a zip file.
You have to add include lines for both of them.

Put the Update_scr.slc in the X:\\\\Civ CTP\ctp_data\default\gamedata folder. Edit the script.slc file there, add the line

#include "Update_scr.slc"

at the end.

Put the Update_str.txt in the X:\\\\Civ CTP\ctp_data\english\gamedata folder. Edit the Strings.txt file there, add the line

import "Update_str.txt"


As expected, it seems to work as in CtP2 but I wasn't sure as J Bytheway told me they were big differences between SLIC1 and CtP2's SLIC.

quote:
You'll need to make some serious alterations to the Update_scr.slc file to get this to work. I have completely redone the tech tree and the units associated with each tech for my mod, and this file reflects those changes. I left out the civ specific stuff, but this is a lot of work already... Here's what you need to do...


Thank you very much for all the explanations, I will design "update paths" and create all the unit arrays, though they are different from those of the CtP2 Updater2 the spirit is the same and it should not be a problem, the main problem will be to find the time to do all the work.

Thank you very much for your answer.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:36
  Old Post 11-05-2004 23:00 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Madd_Mugsy
Hmmm... It's been like three years since I've looked at this, but if I remember correctly, aren't messageboxes the only way to do functions in SLIC1?


Yep - that's why I said you'd have to copy-paste the code in. A better solution would be to use some kind of macro preprocessor (that's the kind of thing I often find myself putting together for badly-designed scripting languages, but in this case I think you could just copy/paste the messagebox code in at the bottom of the other function and it should work about right.

quote:
That would be sweet. I'm just doing some basic testing of the mod now. It needs a serious playtest and balancing I think though.


My Mars mod (see my website - link at top of the post) has been in that state for several years now. It's not easy to find playtesters...

quote:
Nice! I didn't know that. I never bought CTP2 though; can I download the whole thing, or should I find somewhere to pick it up?


You'll have to get hold of a copy somewhere. Second hand via Amazon marketplace, eBay, etc. are the best methods if you can't find it in your local bargain bin.

Grandpa Troll is offline Grandpa Troll

Immortal
I owe..I owe..it's off to work I go
Jul 2000
time: 00:36
  Old Post 11-05-2004 23:01
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Re: Wow Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by Madd_Mugsy


Hmmm... It's been like three years since I've looked at this, but if I remember correctly, aren't messageboxes the only way to do functions in SLIC1?




Actually..I do a small amount of using SLIC and to answer you dont "NEED" a message box..you can add a slic code and then it will wokr..I myself have half a dozen in a few scenario's that work fine

Of course.I know what they are and I dont use in MP or PBEM so its not an issue..

things like free public works, free units spawning..


Ok..Good luck..when I return from Honduras (building a church near Choluteca) in a week and a half i may try some of your inovations

Peace

Grandpa Troll

Attachment: excited programmer.gif
This has been downloaded 37 time(s).

Tamerlin is offline Tamerlin
King
Toulouse (South-western France)
Apr 2002
time: 06:36
  Old Post 12-05-2004 03:59
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Enter the AD-FREE zone

Madd_Mugsy, a question is haunting me: can the AI Civs update their units through the unit updater?

I have briefly read the SLIC code(though I know nothing about SLIC coding) and I have only seen references to the Human Player (the "g.player"), if the answer is no is there a way to tell the AI how to use the updater?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:36
  Old Post 12-05-2004 14:49 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Help yourself to an AD-FREE life

g.player refers to whoevers turn it is at the moment, not just the human player.

Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
  Old Post 12-05-2004 19:09
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Get a bigger avatar today!

quote:

Madd_Mugsy, a question is haunting me: can the AI Civs update their units through the unit updater?


Theoretically, it has access to the upgrade messages, but it doesn't do anything with them, so no it doesn't upgrade units...

BUT

I can make a couple quick changes to the SLIC to give the AI automatic upgrades. I'll post again with the changes.

Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
  Old Post 12-05-2004 20:27
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Change the main message box function to this:

code:
messagebox 'msgReplaceUnits' { Title(ID_TITLE_upgrade_query); MessageType("TP_QUEUE_EMPTY_AFTER_UNIT"); MessageClass(789); i = 0; onecost = 0; oldunitcount = 0; while (i < player.totalunits) { SetUnitByIndex(1, g.player, i); if (unit.type == oldunittype) { oldunitcount = oldunitcount + 1; } i = i + 1; } if(oldunitcount>0) { if(IsHumanPlayer(g.player)) { onecost = (newunitcost) - (oldunitcost); if (onecost <= player.gold) { KillClass(g.player,987); MessageClass(987); privoldunittype=oldunittype; privnewunittype=newunittype; privoldunitcost=oldunitcost; privnewunitcost=newunitcost; privtotalcost = (privnewunitcost*oldunitcount) - (privoldunitcost*oldunitcount); privonecost = privnewunitcost - privoldunitcost; if (privtotalcost <= player.gold && oldunitcount>1) { Button(ID_BUTTON_Do_upgrade) { AddGold(player, -privtotalcost); i = 0; while (i < player.totalunits) { SetUnitByIndex(1, player, i); if (unit.type == privoldunittype) { oldunitlocation = unit.location; SetOrder(1, 56); AddOrder(unit, oldunitlocation); CreateUnit(player, privnewunittype, oldunitlocation, 0); } else { i = i + 1; } } KillClass(g.player, 987); } } Button(ID_BUTTON_Do_one_upgrade) { AddGold(player, -privonecost); i = 0; while (i < player.totalunits) { SetUnitByIndex(1, g.player, i); if (unit.type == privoldunittype) { oldunitlocation = unit.location; SetOrder(1, 56); AddOrder(unit, oldunitlocation); CreateUnit(player, privnewunittype, oldunitlocation, 0); KillClass(player, 987); message(g.player,'msgReplaceUnits'); } else { i = i + 1; } } } Button(ID_BUTTON_LibraryNew) { LibraryUnit(privnewunittype); } Button(ID_BUTTON_LibraryOld) { LibraryUnit(privoldunittype); } if (oldunitcount>1) { Text(ID_TEXT_upgrade_query); } else { Text(ID_TEXT_upgrade_one_query); } } else { Abort(); } } else { // AI Player KillClass(g.player,978); MessageClass(978); privoldunittype=oldunittype; privnewunittype=newunittype; i = 0; while (i < player.totalunits) { SetUnitByIndex(1, player, i); if (unit.type == privoldunittype) { oldunitlocation = unit.location; KillUnit(unit.1); CreateUnit(player, privnewunittype, oldunitlocation, 0); } else { i = i + 1; } } KillClass(g.player, 978); } } else { Abort(); } }


and the AI will upgrade all its units automatically for free. We can put a gold check in there too, but I think the general consensus is that the ai is too damn easy anyway.

I thought this would take less than 5 min to do, but it ended up taking closer to 15. Turns out, you have to kill the AI units you're upgrading instead of disbanding them - otherwise it just sits in the loop forever. But disbanding actually works if you comment out the loop. This stuff is screwy.

But hey! It seems to work now

Tamerlin is offline Tamerlin
King
Toulouse (South-western France)
Apr 2002
time: 06:36
  Old Post 12-05-2004 21:41
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Enter the AD-FREE zone



Thank you very much Madd_Mugsy... I have already started working on the update path.

Keygen is offline Keygen
Emperor
Athens, Hellas
Jan 2000
time: 07:36
  Old Post 14-05-2004 00:10 Visit Keygen's homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Help yourself to an AD-FREE life

If you're in the need of space to host the mod let me know.
I might be able to host it

Madd_Mugsy is offline Madd_Mugsy
Settler
Vancouver, Canada
Feb 2001
time: 21:36
Arrow  Old Post 14-05-2004 00:50
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by Keygen
If you're in the need of space to host the mod let me know.
I might be able to host it


That would be excellent It's about 30MB in size and my PC's ftp server likes to give out part-way through downloads, so it would be much appreciated. Feel free to drop me an email w/the details.

Thanks!!

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:36.
Apolyton Time is 00:36.
    top of page
Rate This Thread:
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.0672 seconds (91.75% PHP - 8.25% MySQL) with 30 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