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 > Limits of 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
ahenobarb is offline ahenobarb
Prince

Nov 2001
time: 05:20
  Old Post 16-07-2002 22:55
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Limits of modding Support Apolyton

I'm trying to get a sense of the limits to the ability to mod CTP2 and have a few questions:

1) can you make government types that expire? Meaning can you make it so that a civilization cannot have a "city-state" government after the discovery of a certain advance (giving a new government type, for instance) or after a certain date in the game?

2) Is there an equivalent to the events.txt in Civ II? so that you could tell the game/scenario: on x turn, [DoSomething1] happens?

3) In a scenario, could you edit the territory borders around a city?

Thanks in advance.

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:20
  Old Post 17-07-2002 04:59
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Tired of ads?

quote:

2) Is there an equivalent to the events.txt in Civ II? so that you could tell the game/scenario: on x turn, [DoSomething1] happens?


I'll try to answer this one. In Civ2 you could have:

code:
@IF CityTaken city=New York attacker=English defender=Americans @THEN Text New York captured by the Redcoats! Enraged local citizens join the fight for liberty! EndText CreateUnit unit=Militia owner=Americans veteran=false homecity=none locations 84,22 84,23 79,31 endlocations @ENDIF


In CTP2 this could be done, pretty well literally, as:

code:
HandleEvent(CaptureCity) 'SampleHandler' pre { if (PlayerCivilization(player[0]) == CivilizationIndex("English") && PlayerCivilization(city[0].owner) == CivilizationIndex("American") && city[0].location==NewYorkLoc ){ message(city[0].owner,'NewYorkCaptured'); event:CreateUnit(city[0].owner,UnitDB(UNIT_MILITIA),SpawnRebelsLoc,0); } } messagebox 'NewYorkCaptured' { Show(); Text (ID_NewYorkCapturedMessage); // NewYorkCapturedMessage "New York captured by the Redcoats! // Enraged local citizens join the fight for liberty!" }


where:

i) NewYorkLoc is a (global) location variable that you've set to be New York's location,

ii) SpawnRebelsLoc is a (global) location variable that you've set to be the place where you want the Militia to appear,

and,

iii) the outcommented lines appear in the .txt file that you're using to save your text in.

The "CaptureCity" event occurs whenever a city is captured: player[0] is the capturing player and city[0] is the city (so city[0].owner is it's owner and city[0].location is it's location).

The only thing I've left out is a mechanism to check that SpawnRebelsLoc is a valid location to create a new unit on. There's more than one way to do this and no point on going off on a tangent.

Although I haven't looked into it in detail (the above is just the example on p32 of the Conflicts in Civilization Instruction Manual) it would appear to be a very straightforward matter to convert any of your existing triggers into SLIC.
(What would be very very tedious would be making the maps and units and all that kind of stuff.)

But anyway, SLIC is FAR more powerful than the triggers mechanism of Civ2. For one thing, the latter had seven events: CityTaken, Negotiation, RandomTurn, ScenarioLoaded, Turn, TurnInterval, and UnitKilled. SLIC has something like 238 events (if I counted them right, they're not numbered). Not all of them are interesting, nor even all that usable, but each of them is a 'hook' into the executable: they (and the ones in Civ2 for that matter) allow you to change the actual game's program.

'Actions' Once you've set your hook, Civ2 gave you 9 types of 'action' that you can perform: ChangeMoney, CreateUnit, DontPlayWonders, JustOnce, MakeAgression, MoveUnit, PlayCDTrack, PlayWaveFile, and Text/EndText. With SLIC what corresponds to an action is just any acceptable block of SLIC code. From this point of view there are literally infinitely many types of SLIC 'actions' because as a proper scripting language SLIC has all sorts of resources that enable you to specify what it is that you want the computer to do.

For example, in Civ3 you can get 'Generals'. But, on the one hand, I've read complaints that you don't get enough of them, and on the other, big deal: Immortal Wombat had already implemented a similar idea in Cradle before Civ3 was released. Hexagonian describes it as follows:

quote:

There is also a set of Wonder Units that are tied into the creation of certain Wonders. I tried to align them to a theme within the Wonder - hence the selection of certain leaders. They will grant veteran status to any units underneath them. They also operate as ranged units, so they will not be sitting on the front lines taking the early hits - and are generally stronger than their counterparts. There is a happiness penalty if the unit is disbanded or lost.



To do this, Immortal Wombat wrote a whole bunch of little handlers: a pair for each of the special Wonder units. Here's the pair for Hammurabi with my comments trying to explain what each line is doing:

code:
HandleEvent(CreateWonder) 'Hammurabi' post {//this triggers whenever a Wonder is created tmpWonder = value[0];//set tmpWonder equal to the Data Base value of the Wonder that was just created if(tmpWonder == WonderDB(WONDER_CODE_OF_HAMMURABI)) {//if this wonder was the CODE_OF_HAMMURABI tmpCity = city[0]; // set tmpCity equal to the city the wonder was created in tmpPlayer = tmpCity.owner;//and tmpPlayer equal to the owner of that city CreateUnit(tmpPlayer, UnitDB(UNIT_HAMMURABI), city[0].location, 0);//give HAMMURABI to tmpPlayer in the city DisableTrigger('Hammurabi');//do this once, i.e., only allow one HAMMURABI unit to be created } } HandleEvent(BeginTurn) 'UnhappinessChecker1' pre { foundHim = 0;//set foundHim to false if(PlayerHasWonder(Player[0], WonderDB(WONDER_CODE_OF_HAMMURABI))) { //if the player whose turn is beginning has the CODE_OF_HAMMURABI Wonder for(i = 0; i < player[0].units; i = i + 1) {// look through his units GetUnitByIndex(player[0], i, tmpUnit);// " if(tmpUnit.type == UnitDB(UNIT_HAMMURABI)) {//if one of them is HAMMURABI foundHim = 1; //set foundHim to true } } if (!foundHim) {//if we didn't find him (i.e. he just got killed or disbanded) for(j = 0; j < player[0].cities; j = j + 1) {//look through his cities GetCityByIndex(player[0], j, tmpCity); // " Event:AddHappyTimer(tmpCity, 3, -1, 12);// and make each of them unhappy DisableTrigger('UnhappinessChecker1'); // do this once, i.e. just when HAMMURABI is // killed/disbanded } } } }


Details aside, the real point here is to notice the incredible flexibility of what you can do with SLIC.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:20
  Old Post 17-07-2002 09:03
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Re: Limits of modding Support Apolyton, buy Civilization: The Boardgame

quote:
Originally posted by ahenobarb
I'm trying to get a sense of the limits to the ability to mod CTP2 and have a few questions:

1) can you make government types that expire? Meaning can you make it so that a civilization cannot have a "city-state" government after the discovery of a certain advance (giving a new government type, for instance) or after a certain date in the game?

I've heard that you can add the line ObsoleteAdvance in the government.txt inside the brackets of the gov you aim at.
but i never tested it myself
Ex

code:
ObsoleteAdvance ADVANCE_HUMAN_RIGHTS


quote:
Originally posted by ahenobarb
3) In a scenario, could you edit the territory borders around a city?


Trick one. But i am almost 100% sure that you cant in a easy way .
The best way that comes to my mind is to create another player cities in the territory you dont want to have boders and them disband them right after. the territory wich the disbanded city occupied becomes neutral.

Lou Wigman is offline Lou Wigman
Warlord
Newcastle,Australia
Jun 2001
time: 15:20
  Old Post 17-07-2002 11:12
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton or Terrorists Win

It is quite easy to make governments obsolete by using the flag in government.txt. This eliminates that government from the 'pick list' after the enabling advance has been achieved. The problem is that if the player is running an 'obsolete' government at the changeover event then that civ will remain in that government. There appears to be no easy way to automatically kick the player out of the obsolete government.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:20
  Old Post 17-07-2002 13:21 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Inflate your Upload Space

As far as borders go, you can create tile improvements similar to the Fortress, that make the border expand. The radius of the expansion is determined by a variable that can be set, so you could simply create 1 (invisible) tile imp for every radius you would like and place them with SLIC (make sure cities themselves have a border radius of 0 or 1 then, or things could get screwed up). I've successfully tested this myself to simulate the expanding borders concept of Civ3. Only down-sides are shrinking borders and city radius. Making borders shrink properly is tricky, the 'real' border will shrink but some sort of remnant of the old border is left, which looks ugly on the map and causes a number of weird bugs; I haven't succeeded in making this work properly yet (but Pedrunn's trick is a good one, hadn't considered that yet - but it would be better to use tile imps rather than cities). The second problem is that the city radius *always* falls within the borders of a civ. If you edit cities so they have a border radius of 0 and then place a tile-imp with radius 1 through SLIC, it will work fine for 1-radius cities but when the city expands to size 9 (size 7 in the original game, IIRC), the city radius expands to 2 and the borders expand with it, whether you want to or not.

BTW, excellent explanation/comparison by Peter, that's one for the archives

Last edited by Locutus on 17-07-2002 at 13:28

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:20
  Old Post 17-07-2002 20:02 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton buy from Amazon

Just what I was thinking...

The one real pain translating Civ2 code to SLIC is the locations, which are bound to be different in the two games. God help whoever does Red Front.

ahenobarb is offline ahenobarb
Prince

Nov 2001
time: 05:20
  Old Post 17-07-2002 21:04
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton buy from Amazon

Thanks everybody!

Great explanation Peter, I went through it line by line and now have a much better sense how to do things like this with .slc files. Great example BTW, I am playing the Cradle Mod and have Hammurabi, it's nice to look at some of the code, so I can see how this works out in the game.

From everything that I've gathered today, it looks like the Civ III mod that I shelved while I waited for improvements to the game to come out, will be coming off the shelf and into a CTP2 environment. CTP2 can do about 95% of the things I wanted to do in the mod, now to make time to acutally do it.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:20
  Old Post 17-07-2002 22:26 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Help yourself to an AD-FREE life

Hey, that's great to hear Don't restrain yourself in providing us with juicy details, we love juicy details

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:20
  Old Post 18-07-2002 10:41
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Help yourself to an AD-FREE life


Just let us know about the other 5%. We probably can help you get those

Last edited by Pedrunn on 18-07-2002 at 10:47

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:20.
Apolyton Time is 00:20.
    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.0467 seconds (68.56% PHP - 31.44% 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