[MOD] FOCW Corporations REVISED V.3.2

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

[MOD] FOCW Corporations REVISED V.3.2

Post by BlackRain » Tue, 23. Feb 21, 18:42

Starting a new thread for this because it is fundamentally different from the other Corporations mod (albeit with similarities).

Changes from FOCW Corporations:
1) Governments and Corporations are completely separated now. That means, at the start of a game, all stations and trade ships belong to the governments and not Corporations. In FOCW Corporations, governments were completely removed from the economic side for the most part. This mod can now be placed into any game and doesn't require a new game because of this. Corporations all start from scratch.

FOCW Corporations Revised Features:

1) There are 21 corporations (3 per faction for now) which could arise as the game progresses. Which corporations build stations or develop is completely random. That means, each gameplay is different. However, you can help corporations by destroying other ones as they arise.
2) There is a limit to how many stations can be built in total for all Corporations. Currently, this limit is set to 210 and could change in future versions. That means, only 210 stations can be built so whichever corporation builds the most, will obviously be the strongest. Destroy a corporations stations to weaken them or get rid of them completely. They can make a comeback, but that is only assuming there are station slots available to be built. Keep destroying their assets to keep them out.
3) Corporations will build ships and stations obviously. They will trade with anyone they have neutral to good relations with and they will defend their assets and/or attack their enemies.
4) It takes time for Corporations to grow and develop. You can help them grow by delivering construction materials to help build their stations faster. They order ships from shipyards so if there isn't a healthy economy going on and the shipyards are stuck, then they might not be able to order ships but will still do so over time.
5) You will receive some information in news reports stating how healthy a company might be or if they are trying to order mercenary ships and fleets occasionally.
6) Can recruit better employees, employees range from 1 star to 4 stars.
7) You can recruit pilots and managers when building ships or refitting them, etc.
8 ) Includes Dynamicwarconversations script by DeadAir, this script will allow you to check relations between factions by speaking with a manager belonging to a specific faction or your own manager. You can also pay credits to improve relations with two different factions.

Should be compatible with pretty much anything I think except for those which make excessive changes to JOBS.

There are many ways to customize the mod if you know how. For example, currently the max number of stations which will be built by the corporations is 150. That is the total number that can be built by this mod as it is set right now, but you can higher or lower this depending on what you want.

Open the corplogic.xml in the md folder in this mod's folder.

Do a search for:
<set_value name="$ExistingTotalFactoryThreshold" exact="150"/>

There are ten entries of this. Just change the 150 to whatever number you want. If you some things about editing scripts, you can even look through the cues and change the number of individual types of stations and such which will be built within the total of 150. A lot of different ways to fool around with it.

The corpstrength.xml is the script which handles what squadrons are ordered (these are righters and scouts). Corpstrengthfleets.xml handles fleets led by a destroyer. corpstrengthtrade.xml is for freighters and miners. These are more complicated to edit but is highly customizable if you know what you are doing. Feel free to ask if you have any questions.


Download link - FOCW CORPORATIONS REVISED V. 3.2


Thanks to DeadAir for letting me use one of his scripts.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by BlackRain » Tue, 23. Feb 21, 18:43

FOCW Corporations REVISED V.3.2
1) Now, the Boron Corporations will only be active if you have completed the plot. They will not be active at all until the plot is done or if you start a new game with the boron plot completed

FOCW Corporations REVISED V.3.1
1) Fixed an issue with Hatikvah shipyard not having XL engines or L travel drive.
2) Fixed Boron fighter squadrons (corps couldn't order them).
3) some minor fixes to code.

FOCW Corporations REVISED V.3.0

Many changes and fixes so the version is now 3.0

1) Fully compatible now with Boron DLC. 3 Boron Corporations have joined the Universe!
2) Changed initial corporation activation, now there will be 8 Corporations activated at game start, and generally 1 corporation for Each faction will activate at game start.
3) Fixed a number of bugs and issues.
4) Fixed crash when hiring Boron Pilots and Managers.
5) Increased number of Trade and mining ships that Corporations will purchase and use.
6) Hatikvah will now build a shipyard and a wharf and may take over one or two of the unowned sectors causing corporations to focus on building stations in those sectors (Corporations will build in Hatikvah sectors in addition to their main faction sectors). This essentially creates neutral sectors where crime may be higher but there is a lot of economic activity. Mercenaries and Corp trade ships will begin to accumulate in these areas over a long period of time.

Please let me know if there are any issues, I did not have an extended time to test yet.

Version 2.5
1) Compatibility of Extended Conversation Menu mod.

Version 2.4
1) Really fixed mining ships from corporations now. Last fix wasn't working, but I have now fixed the issue. All mining ships should work correctly. However, please keep in mind that existing mining ships in the game owned by corporations may not be working correctly. You could use the cheat mod to destroy these ships if you find them (you will see them just constantly flying around a wharf or shipyard). All newly built mining ships will work correctly.

Version 2.3
1) Fixed an issue with mining ships which were not assigned to stations sometimes not being able to ever find something to mine. Basically I changed the range to include the entire universe available (or it should be that way).

Version 2.2
1) Fixed issue with mining ships, mining ships were not be assigned to stations correctly, should be fixed now.

Version 2.1
1) Fixed a major issue I didn't realize existed with the modules.xml file. Certain modules weren't given the right factions causing stations to not be built correctly. Also, some might be missing storage modules. This has been fixed, stations should now construct correctly and there may be large stations built (with up to 10 production modules).

Version 2.0
1) Should have fixed issue with trade ships with no loadout.
2) Hopefully fixed issue with some trade ships having no orders (please let me know if you still see it happening).
These two fixes will only work on new ships built, not existing ones!


BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by BlackRain » Tue, 23. Feb 21, 20:41

Shuulo wrote:
Tue, 23. Feb 21, 19:33
Ill grab this to test with SWI mod, thanks
By the way, what is SWI mod?

Falcrack
Posts: 4929
Joined: Wed, 29. Jul 09, 00:46
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by Falcrack » Tue, 23. Feb 21, 20:57

BlackRain wrote:
Tue, 23. Feb 21, 20:41
Shuulo wrote:
Tue, 23. Feb 21, 19:33
Ill grab this to test with SWI mod, thanks
By the way, what is SWI mod?
Star Wars Interworlds.

Falcrack
Posts: 4929
Joined: Wed, 29. Jul 09, 00:46
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by Falcrack » Tue, 23. Feb 21, 20:58

Do corporations have a finite amount of money? Will they attempt to make a profit, and if not, can they potentially go bankrupt?

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by BlackRain » Tue, 23. Feb 21, 21:04

Falcrack wrote:
Tue, 23. Feb 21, 20:58
Do corporations have a finite amount of money? Will they attempt to make a profit, and if not, can they potentially go bankrupt?
Hello Falcrack, I tried to make it simulate as much as possible if they were real. However, they do not have finite money. I put in various checks/instructions for how they function. You could say they are technically bankrupt when they have no stations. The less stations they have, the less "Money" they have to use for ships, etc. You can ultimately get rid of them entirely, but they could come back. However, once maximum number of stations are reached and nothing changes to decrease this number, they can't come back. I will play around with this more to balance it, but it should honestly feel no different than if they had actual finite money in my opinion.

Falcrack
Posts: 4929
Joined: Wed, 29. Jul 09, 00:46
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by Falcrack » Tue, 23. Feb 21, 21:20

BlackRain wrote:
Tue, 23. Feb 21, 21:04
Falcrack wrote:
Tue, 23. Feb 21, 20:58
Do corporations have a finite amount of money? Will they attempt to make a profit, and if not, can they potentially go bankrupt?
Hello Falcrack, I tried to make it simulate as much as possible if they were real. However, they do not have finite money. I put in various checks/instructions for how they function. You could say they are technically bankrupt when they have no stations. The less stations they have, the less "Money" they have to use for ships, etc. You can ultimately get rid of them entirely, but they could come back. However, once maximum number of stations are reached and nothing changes to decrease this number, they can't come back. I will play around with this more to balance it, but it should honestly feel no different than if they had actual finite money in my opinion.
Regarding maximum number of stations, is there also a limit to maximum number of production modules per station? Will corporations expand upon an already built station?

I would be more interested if corporations were given a very large, finite lump sum of money to start out with, to know whether an AI run corporation in X4 actually would be able to generate a profit over the long term. Have they been shown to not be able to generate a profit over time, or is this just an untested hypothesis?

Maybe couple this with a return of the stock market, where if you invest money in a corporation and they generate a profit over time, their stock price goes up, but if they are unprofitable, their stock price goes down. But I digress...

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by BlackRain » Tue, 23. Feb 21, 21:26

Falcrack wrote:
Tue, 23. Feb 21, 21:20
BlackRain wrote:
Tue, 23. Feb 21, 21:04
Falcrack wrote:
Tue, 23. Feb 21, 20:58
Do corporations have a finite amount of money? Will they attempt to make a profit, and if not, can they potentially go bankrupt?
Hello Falcrack, I tried to make it simulate as much as possible if they were real. However, they do not have finite money. I put in various checks/instructions for how they function. You could say they are technically bankrupt when they have no stations. The less stations they have, the less "Money" they have to use for ships, etc. You can ultimately get rid of them entirely, but they could come back. However, once maximum number of stations are reached and nothing changes to decrease this number, they can't come back. I will play around with this more to balance it, but it should honestly feel no different than if they had actual finite money in my opinion.
Regarding maximum number of stations, is there also a limit to maximum number of production modules per station? Will corporations expand upon an already built station?

I would be more interested if corporations were given a very large, finite lump sum of money to start out with, to know whether an AI run corporation in X4 actually would be able to generate a profit over the long term. Have they been shown to not be able to generate a profit over time, or is this just an untested hypothesis?

Maybe couple this with a return of the stock market, where if you invest money in a corporation and they generate a profit over time, their stock price goes up, but if they are unprofitable, their stock price goes down. But I digress...
It is too much work honestly, lol. As for whether corporations will expand, that depends if I add that in. The game already has code for expanding upon stations based on shortages, etc. but it is too heavily focused on the factions (like argon, etc.) not sure if it would also include the corporations in its calculations. Then I would have to add it but not sure if it is necessary to do that as they can just build more stations. I am not sure yet if I will do anything with total modules, etc. but it is a possibility.

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by Shuulo » Wed, 24. Feb 21, 18:30

BlackRain wrote:
Tue, 23. Feb 21, 20:41
Shuulo wrote:
Tue, 23. Feb 21, 19:33
Ill grab this to test with SWI mod, thanks
By the way, what is SWI mod?
As already mentioned, that is Star Wars mod

Also, this corporations mod is cool and it will need patches to work with mods that add ships to jobs or redo jobs/shipgorups in some way, like SWI does.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by BlackRain » Wed, 24. Feb 21, 18:44

Shuulo wrote:
Wed, 24. Feb 21, 18:30
BlackRain wrote:
Tue, 23. Feb 21, 20:41
Shuulo wrote:
Tue, 23. Feb 21, 19:33
Ill grab this to test with SWI mod, thanks
By the way, what is SWI mod?
As already mentioned, that is Star Wars mod

Also, this corporations mod is cool and it will need patches to work with mods that add ships to jobs or redo jobs/shipgorups in some way, like SWI does.
Yeah, I don't change any existing job ships but I add job ships. So it will work fine with other mods that change jobs as long as they are using vanilla ships and such. A mod like SWI which uses completely different ships would need a patch. It is easy though, just a matter of changing the references. It would be easy to make it compatible with SWI. We could even make a version for SWI and change the name of companies and such to fit a star wars universe.

User avatar
Shuulo
Posts: 1629
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1

Post by Shuulo » Wed, 24. Feb 21, 18:57

BlackRain wrote:
Wed, 24. Feb 21, 18:44
Shuulo wrote:
Wed, 24. Feb 21, 18:30
BlackRain wrote:
Tue, 23. Feb 21, 20:41


By the way, what is SWI mod?
As already mentioned, that is Star Wars mod

Also, this corporations mod is cool and it will need patches to work with mods that add ships to jobs or redo jobs/shipgorups in some way, like SWI does.
Yeah, I don't change any existing job ships but I add job ships. So it will work fine with other mods that change jobs as long as they are using vanilla ships and such. A mod like SWI which uses completely different ships would need a patch. It is easy though, just a matter of changing the references. It would be easy to make it compatible with SWI. We could even make a version for SWI and change the name of companies and such to fit a star wars universe.
We plan to redo map and factions completely and I thought to use that chance to add corporations like that as well, maybe even with their own 1-2 sectors or just build inside other faction territory, like Kuat yards and Correlia companies.
If you would be interested to help with that, let me know in PM :)

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.1

Post by BlackRain » Fri, 26. Feb 21, 04:53

Version 1.1

1) Some minor fixes and edits.
2) Addition of DeadAir's dynamiconversations (Only includes that script). Allows you to pay to improve relations between two separate factions and also check relations between factions. Speak to a manager of another faction or your own manager for choices.

shovelmonkey
Posts: 152
Joined: Wed, 29. Feb 12, 17:34
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.1

Post by shovelmonkey » Fri, 26. Feb 21, 14:23

Max Bain wrote:
Fri, 26. Feb 21, 13:39
shovelmonkey wrote:
Fri, 26. Feb 21, 13:23
Any chance for a compatch or branch for Blackrain's Corporations Mod ( viewtopic.php?f=181&t=433943&sid=68874f ... 266c5c28f1 ) like you did for VRO?

It is an awesome mod FYI. As is yours! 8)
I have read about this mod and it indeed sounds very interesting. The only reason why I havent tried it yet is my fear about the performance impact :D.

But to your question:
The mod should already be compatible with most of my ships (all sizes except XL battleships).
I have added my ships to the vanilla ship groups (except battleships because there were no groups for them in vanilla). So the mod (if it uses vanilla ship groups) should already pick my ships.

The only ships that wont be picked by corporations would be battleships (from an immersive point of view, that even would make sense? i dont know). So only the big factions like argon, antigon, teladi have battleships.

if it does not work (maybe the mod works different than I thoughT), I would ask you to ask the author of the mod to add compatibility with my mod because I cant support any more mods right now. Actually I am working on a pretty big update of this mod that includes several new ships :) (release date with CoH - maybe 1-2 days after to check for bugs).

This is from Max Bain's XR Ship Pack thread, where I asked about compatibility to your mod so just reposting here. I'm going to start a playthrough shortly with both of your lovely mods enabled to see if they do work together. If they do not, or if you already know that will not; would you consider a compatch? XR Shipack is a pretty widely used mod AFAIK.

Either way, your corporation mod is an awesome idea and great job on implementing it.


Edited for spelling...
“Not even once has life or the weather complained about a human being.”
― Mokokoma Mokhonoana

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.1

Post by BlackRain » Fri, 26. Feb 21, 14:29

shovelmonkey wrote:
Fri, 26. Feb 21, 14:23
Max Bain wrote:
Fri, 26. Feb 21, 13:39
shovelmonkey wrote:
Fri, 26. Feb 21, 13:23
Any chance for a compatch or branch for Blackrain's Corporations Mod ( viewtopic.php?f=181&t=433943&sid=68874f ... 266c5c28f1 ) like you did for VRO?

It is an awesome mod FYI. As is yours! 8)
I have read about this mod and it indeed sounds very interesting. The only reason why I havent tried it yet is my fear about the performance impact :D.

But to your question:
The mod should already be compatible with most of my ships (all sizes except XL battleships).
I have added my ships to the vanilla ship groups (except battleships because there were no groups for them in vanilla). So the mod (if it uses vanilla ship groups) should already pick my ships.

The only ships that wont be picked by corporations would be battleships (from an immersive point of view, that even would make sense? i dont know). So only the big factions like argon, antigon, teladi have battleships.

if it does not work (maybe the mod works different than I thoughT), I would ask you to ask the author of the mod to add compatibility with my mod because I cant support any more mods right now. Actually I am working on a pretty big update of this mod that includes several new ships :) (release date with CoH - maybe 1-2 days after to check for bugs).

This is from Max Bain's XR Ship Pack thread, where I asked about compatibility to your mod so just reposting here. I'm going to start a playthrough shortly with both of your lovely mods enabled to see if they do work together. If they do not, or if you already know that will not; would you consider a compatch? XR Shipack is a pretty widely used mod AFAIK.

Either way, your corporation mod is an awesome idea and great job on implementing it.


Edited for spelling...
The SHIP PACK? It just adds new ships right? It should work fine then I think. It makes some changes to vanilla jobs by letting them use the new ships but it shouldn't affect my changes to jobs with this.

shovelmonkey
Posts: 152
Joined: Wed, 29. Feb 12, 17:34
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.1

Post by shovelmonkey » Fri, 26. Feb 21, 14:35

Good to know and thank you for the quick reply!
“Not even once has life or the weather complained about a human being.”
― Mokokoma Mokhonoana

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.2

Post by BlackRain » Sat, 27. Feb 21, 16:32

Version 1.2
1) Corporations were building more ships than they were supposed to. This should have been fixed in this version.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.2

Post by BlackRain » Sat, 27. Feb 21, 18:26

Redownload as of this moment. I had forgotten one more thing, sorry about the inconvenience.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.2

Post by BlackRain » Mon, 1. Mar 21, 01:24

Some feedback for those interested. My current game where I am testing this mod is at 1 day 17 hours of game time (so approximately 41 hours).

The second Largest corporation in my game currently is the Mighty Monitors Corporation or MMC. They have a budget of 229 million. They would be reported in game as having a stable flow of income (as per the news report). Their power rating as per the mod code is a power rating of 20 (each level is in intervals of 5 with a maximum of 100). They are a Teladi aligned corporation.

They can order the following ships (maximum allowed):

2 Defense fleets (this would be a small fleet with a Destroyer, a couple of frigates and a dozen fighters or so) (Approximate value of all ships in 2 fleets is somewhere between 60 and 70 million)
1 Attack fleet (Same makeup as above) (Approximately 30 to 35 million)
5 Fighter Squadrons (These are usually 3 or 4 fighters for a total of 15 to 20 depending on whether they can order them from the shipyard that is) (Approximately 25 million)
1 Scout/Recon ship
2 Medium freighters (Approximately 1 to 1.5 million)
1 Large freighter (approximately 7 to 8 million)
2 medium mining ships (Approximately 1 to 1.5 million)

Maximum budget needed for all ships and fleets = Approximately 140 to 150 million). This is not including any ships which need to be replaced as they are destroyed. Anyway, this gives an idea of what is happening in game.

To compare with the other corporations in my current game:

Liberty United Corporation - 82 million
Pontifex's Grasp - 126 Million
True One's Trinkets - 121 million
Scale Plates Incorporated - 162 million
Magnite Corporation - 92 million
Free Enterprises Incorporated - 134 million
Pontifex's Breath - 227 million
Gecko Profits - 280 million
Orion Corporation -140 million
Family Dal - 66 million
Family Kayn - 95 million
Family Okar - 61 million
Family Uril - 168 million
Family Lorne - 155 million
Supreme Technologies - 131 million
Holy Artisan - 158 Million
Lordly Goods - 79 million
Mighty Monitors Corporation - 229 million
General Industries Incorporated - 172 million

19 of the Corporations have 2 or more stations.

2 of the Corporations have 1 or 0 stations. (Family Mantu has 0 stations and Radiance Corp has 1 station).

Newinger
Posts: 247
Joined: Mon, 11. Mar 19, 11:18
x4

Re: [WIP/MOD] FOCW Corporations REVISED V.1.2

Post by Newinger » Mon, 1. Mar 21, 11:10

How are the default fractions in comparison? Are there enough resources in 4.0 for all fractions + corporations? How are the wars affecting all?

Post Reply

Return to “X4: Foundations - Scripts and Modding”