View Full Version : Modding Corporations in Beyond the Sword


bruizar
Jul 18, 2007, 10:55 AM
With the addition of corporations we've got new options for modding. For my mod, I'd like to use real corporations instead of the ones that are made up by Firaxis. (Seems totally out of character, regardless of any trademark issues they might have regarding the use of actual businesses, corporations are undeniably part of history too).

First example: I'd like to add Boeing and Airbus as competing corporations. PreReq technology should be Flight. Bonus Prereqs should be Aluminium and Oil. Airbus should give 2 additional trade routes per city, where Boeing should only give 1, read on.

Question number 1: How can we add a traderoute to Corporations?

Second example: For more strategic depth, I'd like to include corporation-dependent unique units to the MOD. This means that the headquarter, and all cities with the corporation present, gets to train a unique unit.

In this example Boeing competes against Lockheed Martin. A city with Boeing gets to build the B-2 Spirit stealth bomber alongside the 1 additional traderoute he got already. A city where Lockheed Martin is present gets to build the Joint Strike Fighter and receives 20% production increase for SS components. Nasa however, would grant your city +75% production increase for SS components.

Question number 2: How do you link units to corporations?

Third example: For even more strategic depth, I'd also like to include corporation-dependent unique buildings.

Morgan Stanley competes against Goldman Sachs, Lehman Brothers and Merrill Lynch

A company with either of the following corporations gets to build a National Bank (National Wonder).

The National Bank allows investment banking with other civs where your corporation has spread.

Question number 3: How do you link buildings to corporations?

Once you've established your corporation in another player's civ, you can purchase futures, options, swaps, stocks and bonds with a country where your corporation has spread to. This way you can bankrupt a civ. Bankrupting a civ means that all sliders will drop to zero setting you up for an easy win.

Question number 4: I'm not even going to ask... :-)

<Civ4CorporationInfo xmlns="x-schema:CIV4GameInfoSchema.xml">
<CorporationInfos>
<CorporationInfo>
<Type>CORPORATION_1</Type>
<Description>TXT_KEY_CORPORATION_1</Description>
<Civilopedia>TXT_KEY_CORPORATION_1_PEDIA</Civilopedia>
<TechPrereq>NONE</TechPrereq>
<FreeUnitClass>NONE</FreeUnitClass>
<iSpreadFactor>200</iSpreadFactor>
<iSpreadCost>50</iSpreadCost>
<iMaintenance>100</iMaintenance>
<PrereqBonuses>
<BonusType>BONUS_WHEAT</BonusType>
<BonusType>BONUS_CORN</BonusType>
<BonusType>BONUS_RICE</BonusType>
</PrereqBonuses>
<HeadquarterCommerces>
<iHeadquarterCommerce>5</iHeadquarterCommerce>
<iHeadquarterCommerce>0</iHeadquarterCommerce>
<iHeadquarterCommerce>0</iHeadquarterCommerce>
</HeadquarterCommerces>
<BonusProduced>NONE</BonusProduced>
<CommercesProduced>
<iCommerceProduced>0</iCommerceProduced>
</CommercesProduced>
<YieldsProduced>
<iYieldProduced>75</iYieldProduced>
</YieldsProduced>
<Button>,Art/Interface/Buttons/TechTree/Corporation.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,1,6</Button>
<MovieFile>NONE</MovieFile>
<MovieSound>NONE</MovieSound>
<Sound>AS2D_BUILD_BANK</Sound>
</CorporationInfo>


This is the XML shipped with Beyond the Sword. I don't really understand what everything in CvPediaCorporation.py and CvCorporationScreen.py meant, but those are the only python scripts I could find.

Does anyone feel like giving this a try? I'm curious to see if we can make something nice out of the corporation system.

snipperrabbit!!
Jul 19, 2007, 05:42 AM
Q1 : In the same way castles already add 1 trade route to the city they are in !
Q2 : There is a modcomp dealing with prerequisite building for units.
Q3 : In the same way some buildings require others (FC req. courthouses ...)
Q4 : ????

bruizar
Jul 19, 2007, 11:15 AM
Q1: Thanks
Q2+Q3: Yes I found it as well, <PrereqCorporation>NONE</PrereqCorporation> applies to both buildings and units
Q4: I'd like to create Foreign Exchange System.

Each CIV should have a currency value. This is determined by inflation, maintainance, total commerce, total # of traderoutes, total # of resources. The exact formula I haven't thought out yet, but ultimately this would form a number that is the value of your currency.

You should be able to write futures and options with an expiry date of 3 turns. The difference in the currency value is then substracted from the opponent and added to your own treasury.

This adds significant strategic diversity. You can use privateers to block traderoutes while buying futures. You can invest in countries with a golden age and reap the rewards from their GA. You can pillage towns, resources and destroy trade routes and capitalize on war like in the real world.

The question is... How?

Zebra 9
Jul 19, 2007, 06:05 PM
Those python files you mentioned are the Pedia screen for corperations (no biggy) and the other is the screen where you can do what ever w/ corperations (I don't have BtS yet, oh this screen is probably like the religion screen).

Impaler[WrG]
Jul 19, 2007, 07:09 PM
Keep in mind that the Corporate HeadQuarters is a WONDER (aka in one city) but the corporation is spread religion style to other cities and dose not normally add any additional buildings. If you were to add some kind of building 'Branch Office' or what not that would be a temple equivilent and requires the Corporation then its a simple matter to attach to it any effect that a building can produce. If you want the Corporation ITSELF to do something like add a trade route that will require an SDK mod.

Ekmek
Jan 10, 2008, 01:11 PM
Can anyone explain the difference to these:

I assume this is what the HQ gains per corporation, the first one gold? but are the rest hammers and food?????????
<HeadquarterCommerces>
<iHeadquarterCommerce>5</iHeadquarterCommerce>
<iHeadquarterCommerce>0</iHeadquarterCommerce>
<iHeadquarterCommerce>0</iHeadquarterCommerce>
</HeadquarterCommerces>

Not sure what this does... maybe health, culture, and something else??????
<CommercesProduced>
<iCommerceProduced>0</iCommerceProduced>
</CommercesProduced>

75 is huge, is this gold food hammers
<YieldsProduced>
<iYieldProduced>75</iYieldProduced>
</YieldsProduced>

Is there a way to get it to consume culture?

Shqype
Jan 10, 2008, 01:18 PM
As for the 75 being huge, they made it kinda like a percentage .... where 75% would be 0.75, the 75 here means 3/4 of a unit of food. So for every resource, you produce .75 food ... having 4 resources will give you +3 food.

snipperrabbit!!
Jan 10, 2008, 02:30 PM
I'm not sure health is a commerce in that sense !
commerce order is :gold: :culture: :science: :espionage:
and it works like shqype said i.e. divided by 100 to obtain the benefit per resource consumed.
150 = 7 :culture: with 5 resources

Gaius Octavius
Jan 10, 2008, 02:36 PM
I'm glad I found this thread, because I have a very important question about buildings that require corporations.

Suppose for the sake of argument that I made a new corp. called McDonalds, and a new building (called McDonalds Franchise) that requires it. Suppose I also made another corp. that competes with it, called Burger King, which also has a Burger King Franchise building.

Now let's say I spread McDonalds to a city and build the local franchise there. My question is this: if I then spread Burger King to that city (buying out the existing McDonalds corporation), and build the Burger King Franchise, what happens to the old McDonalds building? Does it get destroyed?

I am asking this because, if the old buildings do not disappear, it would seem that you could buy out rival corporations but keep their buildings, which means you could theoretically get the effects of several corporations for the maintenance cost of only one.

snipperrabbit!!
Jan 10, 2008, 03:52 PM
Part of the response is in the other thread, GO. It currently doesn't work like that !
IT IS the religion like corporation that provide the bonus ; spreading a concurrent corp will remove a religion like corp and add a religion like corp, thus changing the benefit.
Actually, I'm not aware of a building that is deleted upon completion of a new one. Perhaps it is already achieved in a mod, I don't know.

Gaius Octavius
Jan 10, 2008, 04:05 PM
Well, that's not exactly what I'm talking about... I really did not want to say too much without revealing my own plans for something, but here goes. :D

Suppose I mod in two corps with two buildings, each of which has one specific effect.

If I spread CORP1 to a city and build its building, then buy it out and spread CORP2 to that same city, what happens to the original building? Does the game know to demolish it? If it doesn't, then you'd have the first plus the second - meaning you'd get two effects for the maintenance cost of one corporation!

Dom Pedro II
Jan 10, 2008, 04:13 PM
EDIT: Nevermind.

Gaius Octavius
Jan 10, 2008, 04:18 PM
That's exactly what I suspected. :crazyeye: So in effect, Firaxis has given us a "broken" feature in the game, only they didn't worry about it, because regular Civ doesn't use it. :lol:

Now that I can do SDK I suppose I can look into it, or at the very least, come up with some kind of Python code that removes the old franchise. So it's all good. :)

EDIT: I think I am going to have to test this to see if it works...

Refar
Jan 10, 2008, 04:19 PM
Another interesting question would be, if those plants will be disabled, when you switch to Staate Propertie...

snipperrabbit!!
Jan 10, 2008, 04:36 PM
Good point, Refar. What about building is obsolete only if corp is not present in the city then ? ( Requires Python or SDK, IDon'tK )

Dom Pedro II
Jan 10, 2008, 05:18 PM
Another interesting question would be, if those plants will be disabled, when you switch to Staate Propertie...


No. They won't. Basically it seems that the prerequisite only a prerequisite for construction. After that, the building is entirely independent of the corporation.

Removing these buildings is, theoretically, rather simple. But what if you just want to deactivate them? Now that's getting a little trickier. Only certain bonuses from buildings are calculated on the spot per building. Most are just dumped into some variables and arrays in the city class.

So you could use the same mechanic that's used for obsolete buildings, but at the expense that it will only affect those building attributes affected by obsolescence.. i.e. happiness, health, commerce changes, yield changes, etc.

You could do it another way (which might actually be something I'll do in the future), but that'll involve a big change to the code. And since this is not an issue I'm working on right now and Civ4 still has me waking up screaming with all the modcomps I've got left to do, I can't do much to help.