[MOD] Foundation of Conquest and War V. 7.2

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

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

AtilaElari
Posts: 60
Joined: Tue, 28. Jul 20, 08:59

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by AtilaElari » Sat, 10. Jul 21, 14:45

I think I understand how it works.
But what does <quota galaxy="1"/> in Jobs mean? If the number of fleets of this job is controlled by ExistingDestroyerThreshold, will this Quota variable affect anything? Or will those two variables get multiplied?

And regarding the ships used for the job - as an example, Argon Destroyer job - <category faction="argon" tags="[military, destroyer]" size="ship_l"/> Am I understanding correctly that it doesn't specify exact ship, but rather chooses from any that correspond to the specified parameters (Size L, Argon, Military, Destroyer)? So it will use any ship that fits those tags, if more than 1 are present (say, with any ship pack)?


I changed Xenon Carrier fleet job to include a destroyer escort and set ExistingDestroyerThreshold to 3. If all goes well I should have up to 3 fleets of I's with escorts roaming around. Looking forward to that.

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Sun, 11. Jul 21, 22:58

AtilaElari wrote:
Sat, 10. Jul 21, 14:45
I think I understand how it works.
But what does <quota galaxy="1"/> in Jobs mean? If the number of fleets of this job is controlled by ExistingDestroyerThreshold, will this Quota variable affect anything? Or will those two variables get multiplied?

And regarding the ships used for the job - as an example, Argon Destroyer job - <category faction="argon" tags="[military, destroyer]" size="ship_l"/> Am I understanding correctly that it doesn't specify exact ship, but rather chooses from any that correspond to the specified parameters (Size L, Argon, Military, Destroyer)? So it will use any ship that fits those tags, if more than 1 are present (say, with any ship pack)?


I changed Xenon Carrier fleet job to include a destroyer escort and set ExistingDestroyerThreshold to 3. If all goes well I should have up to 3 fleets of I's with escorts roaming around. Looking forward to that.
The quota for the galaxy is what jobs uses to determine the number of those fleets which will be built. So, that number doesn't do anything at all with the ships my mod adds. I left it there because it is a requirement of the code to be there, but it doesn't actually affect anything. Just use the ExistingDestroyerThreshold to do the same thing.

As for how ships are picked with <category faction="argon" tags="[military, destroyer]" size="ship_l"/> These are specifications, so any ship which belongs to faction argon and has the tag of military or destroyer and is of size l can be used for this. That means any ship added by any mod as long as they have the specifications.

AtilaElari
Posts: 60
Joined: Tue, 28. Jul 20, 08:59

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by AtilaElari » Sat, 17. Jul 21, 07:46

One more question - in most cases the script checks for ship orders every 90 minutes. Why did you make that large of a window? Does it impacts the performance, or makes other jobs too hard to build if the check was to run more often?

ravenlor
Posts: 11
Joined: Mon, 10. Aug 15, 20:29
x3ap

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by ravenlor » Sat, 17. Jul 21, 16:30

Hey Blackrain,

are you thinking about of a different approach to make the xenon stronger? currently they seem to struggle to get enough ressources so giving them more fleets and miners doesnt really help. Those additional miners then travel outside of their sectors (as there are no other ressources left) and get destroyed in most cases. Additional fleets dont matter, since they seem to struggle to fill even the initial ones. After only a few dozen hours their sectors seem to be dead and empty. Maybe lowering ressource costs would help instead?

Cheers!

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Sat, 17. Jul 21, 21:54

AtilaElari wrote:
Sat, 17. Jul 21, 07:46
One more question - in most cases the script checks for ship orders every 90 minutes. Why did you make that large of a window? Does it impacts the performance, or makes other jobs too hard to build if the check was to run more often?
There are a few reasons. Too many ships might get ordered (even though I did my best to account for this it could still potentially happen if the check is too quick). Also, it will make it more difficult to build ships as resources may not be able to keep up with normal ordering of ships and additional ships, etc.

The biggest problem is this, I never found the perfect way to check how many ships are ordered and to stop ships from being over ordered. What I mean is, the script runs and a ship is ordered. However, that ship may not get built for a long time or ever depending on resources and then it would keep ordering more and more. This was a problem with earlier versions and in the end, there would be way too many ships ordered. I put in some code to prevent this but it isn't perfect but should be decent.

I could have went the jobs route, but the jobs route doesn't always guarantee that the number of ships you want built get built. I believe there is some stuff hardcoded in this (for example it would delete an order if the order wasn't carried out for too long of a time, etc.).

So anyway, time checks was one of the couple of methods I use to control what is being done. It could probably be decreased but I haven't done enough testing and fooling around with it (after putting in the last checks I put in) to see if I can lower it or not. Some ships need a long time though, like the destroyers or larger size ships as they take longer to build and require much more resources, etc.

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Sat, 17. Jul 21, 21:55

ravenlor wrote:
Sat, 17. Jul 21, 16:30
Hey Blackrain,

are you thinking about of a different approach to make the xenon stronger? currently they seem to struggle to get enough ressources so giving them more fleets and miners doesnt really help. Those additional miners then travel outside of their sectors (as there are no other ressources left) and get destroyed in most cases. Additional fleets dont matter, since they seem to struggle to fill even the initial ones. After only a few dozen hours their sectors seem to be dead and empty. Maybe lowering ressource costs would help instead?

Cheers!
It is certainly a possibility, but I have never seen such serious resource shortages with xenon as you are saying. What other mods are you using?

Ashitaka-san
Posts: 74
Joined: Sun, 28. Aug 05, 01:36
x4

Re: [MOD] Foundation of Conquest and War V. 6.6

Post by Ashitaka-san » Wed, 1. Sep 21, 09:53

BlackRain wrote:
Sat, 1. May 21, 03:01
FOCW Version 6.7

1) Support for Trinity and Yaki with new options.
2) Some minor fixes.


By the way, if you didn't notice the file I attached in this thread a little up from this post, take a look. If you are not using FE and would like to see more action, download the additional aiscript file. This will definitely get some larger fights in your game. I have already witnessed many nice battles where each side had several or more destroyers and a few dozen fighters battling it out. Very cool to watch.

I use FOCW, VRO, the aiscript change I attached up above and deadairaitweaks if anyone is wondering and my game has been excellent so far. I had started a new game with all of these and am now on 4 days 9 hours of in game time. Fights are still going strong and the universe is humming along.
Just to clarify, for the aiscript that you mentioned, it just has that one file "order.move.recon". I'm assuming you replaced that same file in the deadairtweaks. Is that correct?

It seems like deadairtweaks was already modifying the invasion calculation, but the aiscript that you included modified it even further. So, I just replaced it as that seems like the right thing to do.

Ashitaka-san
Posts: 74
Joined: Sun, 28. Aug 05, 01:36
x4

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by Ashitaka-san » Wed, 1. Sep 21, 10:02

Furthermore, I want to really thank you for making such an excellent mod.

I do have a couple of questions / requests.

The newer factions (Split, Terran, Trinity) have more options than the original factions in terms of modifications. Do you intend to streamline this so that all factions have the same modifications available? That would be really nice.

Also, have you considered adding the Kha'ak in here? It would be really cool if we could make the Kha'ak spawn faster and increase their ability to build up.

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Thu, 2. Sep 21, 19:03

Ashitaka-san wrote:
Wed, 1. Sep 21, 10:02
Furthermore, I want to really thank you for making such an excellent mod.

I do have a couple of questions / requests.

The newer factions (Split, Terran, Trinity) have more options than the original factions in terms of modifications. Do you intend to streamline this so that all factions have the same modifications available? That would be really nice.

Also, have you considered adding the Kha'ak in here? It would be really cool if we could make the Kha'ak spawn faster and increase their ability to build up.
Hello, all of the factions have all the same options it is just that when I originally made the scripts I lumped them into fewer settings. All of the main and original factions are controlled by the same options. Maybe at some point I can come back to it and break them all up separately but I don't have enough time to really work on the mod much.

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

Re: [MOD] Foundation of Conquest and War V. 6.6

Post by BlackRain » Thu, 2. Sep 21, 19:04

Ashitaka-san wrote:
Wed, 1. Sep 21, 09:53
BlackRain wrote:
Sat, 1. May 21, 03:01
FOCW Version 6.7

1) Support for Trinity and Yaki with new options.
2) Some minor fixes.


By the way, if you didn't notice the file I attached in this thread a little up from this post, take a look. If you are not using FE and would like to see more action, download the additional aiscript file. This will definitely get some larger fights in your game. I have already witnessed many nice battles where each side had several or more destroyers and a few dozen fighters battling it out. Very cool to watch.

I use FOCW, VRO, the aiscript change I attached up above and deadairaitweaks if anyone is wondering and my game has been excellent so far. I had started a new game with all of these and am now on 4 days 9 hours of in game time. Fights are still going strong and the universe is humming along.
Just to clarify, for the aiscript that you mentioned, it just has that one file "order.move.recon". I'm assuming you replaced that same file in the deadairtweaks. Is that correct?

It seems like deadairtweaks was already modifying the invasion calculation, but the aiscript that you included modified it even further. So, I just replaced it as that seems like the right thing to do.
Yes, I modified it.

lhedarko
Posts: 1
Joined: Sat, 25. Jul 20, 08:09
x4

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by lhedarko » Fri, 3. Sep 21, 17:38

Hi There,

I am getting an error saying that I require COH extension. I have that installed. Is this error dispalying because I am using the Beta ?

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Wed, 8. Sep 21, 17:21

lhedarko wrote:
Fri, 3. Sep 21, 17:38
Hi There,

I am getting an error saying that I require COH extension. I have that installed. Is this error dispalying because I am using the Beta ?
I am not really sure what you mean? What kind of error and where are you seeing this error?

Valinir
Posts: 19
Joined: Sun, 4. Oct 20, 22:18
x3ap

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by Valinir » Tue, 14. Sep 21, 21:09

anyone know if that mod works with 4.1 too?

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Tue, 14. Sep 21, 23:26

Valinir wrote:
Tue, 14. Sep 21, 21:09
anyone know if that mod works with 4.1 too?
It should always work. I can't think of anything that would break the mod.

Meme Turtle
Posts: 175
Joined: Thu, 27. Nov 14, 16:33

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by Meme Turtle » Fri, 17. Sep 21, 17:16

Looks like instructions on the first page are outdated.
What's the minimal set of options I need to enable to give all races(including xenon, split, terran) additional quotas for building ships(fighters and cap ships)? I want all factions to have the same amount of fleets but triple the number of ships per fleet.

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Sat, 18. Sep 21, 02:19

Meme Turtle wrote:
Fri, 17. Sep 21, 17:16
Looks like instructions on the first page are outdated.
What's the minimal set of options I need to enable to give all races(including xenon, split, terran) additional quotas for building ships(fighters and cap ships)? I want all factions to have the same amount of fleets but triple the number of ships per fleet.
I guess I should update the instructions.

In the focwsetup.xml You would need to set the options you want and then find the cues that they are for and change the following:

<set_value name="$ExistingDestroyerThreshold" exact="4"/> Change this to whatever number you want. This will establish how many fleets in total (but not the number of ships in a fleet).

Then you would need to edit the jobs.xml file. Find the job ships that the cues are calling for and change the subordinates there.

For example, in focwsetup you see the following:

Code: Select all

<cue name="job_activate_Xenonminers1" instantiate="true" checktime="player.age + 120s" checkinterval="5min">		
		<conditions>        
		<check_value value="md.FOCWsetup.Settings.$activateXenminers == 1"/>	
		</conditions>	 
	 <actions>	 
				
				<find_ship name="$Xenonminers1" job="'xenon_free_miner_m_mineral1'" space="player.galaxy" multiple="true"/>	                       
				<set_value name="$numship" exact="$Xenonminers1.count"/>
				<set_value name="$totalnumxenmin1" operation="add" exact="0"/>
                <set_value name="$ExistingDestroyerThreshold" exact="4"/> 				
				<do_if value="$totalnumxenmin1 gt $ExistingDestroyerThreshold * 2">
					<set_value name="$totalnumxenmin1" exact="0"/>				</do_if>
				
				
																		
					<do_if value="($numship + $totalnumxenmin1) lt $ExistingDestroyerThreshold">
						<find_station name="$XenonShipyard" space="player.galaxy" functional="true" multiple="false">	
							<match canbuildships="true"/>  <match owner="faction.xenon"/>
					 
						</find_station>
						<request_job_ship job="'xenon_free_miner_m_mineral1'" name="this.$Requested_Job_Ship" requester="$XenonShipyard" zone="$XenonShipyard.zone"/>						
						<set_value name="$totalnumxenmin1" operation="add" exact="1"/>						
                    </do_if>					
					<do_else><set_value name="$totalnumxenmin1" operation="add" exact="1"/>
					<cancel_cue cue="job_activate_Xenonminers1"/>										
					</do_else>
						 <remove_value name="$Xenonminers1"/>
                <remove_value name="$XenonShipyard"/>
				</actions>
	</cue>
In that cue, the job ship which it builds is "xenon_free_miner_m_mineral1". You would then open jobs.xml and find that particular job ship, look to see if it has subordinates. You can then add more subordinates if you know how to do so (either edit the subordinate already created there or add new subordinates, etc.)

Does that make sense?

Meme Turtle
Posts: 175
Joined: Thu, 27. Nov 14, 16:33

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by Meme Turtle » Sat, 18. Sep 21, 23:31

Not exactly what I meant. There are options in the beginning of focwsetup.xml. At the moment I have

Code: Select all

			<!-- Do you want to activate additional Xenon Miners and Xenon Energy Transport ships? 1 for Yes and 0 for No -->				
			<set_value name="$activateXenminers" exact="1" />
			<!-- Do you want to activate additional Xenon fighters? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXenfighter" exact="3" />
			<!-- Do you want to activate additional Xenon Capital ships? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXencapital" exact="3" />
			<!-- Do you want to activate additional fighters for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionsfight" exact="3" />
			<!-- Do you want to activate additional Capital ships for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionscap" exact="3" />
with everything else as 0. What will be the effect of these changes(quantitatively)? I am also using FE so that can have additional effects.

All in all it would be nice to have a few presets(as XML patches) to chose from so that there is no need to modify and maintain focwsetup.xml

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Sun, 19. Sep 21, 03:56

Meme Turtle wrote:
Sat, 18. Sep 21, 23:31
Not exactly what I meant. There are options in the beginning of focwsetup.xml. At the moment I have

Code: Select all

			<!-- Do you want to activate additional Xenon Miners and Xenon Energy Transport ships? 1 for Yes and 0 for No -->				
			<set_value name="$activateXenminers" exact="1" />
			<!-- Do you want to activate additional Xenon fighters? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXenfighter" exact="3" />
			<!-- Do you want to activate additional Xenon Capital ships? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXencapital" exact="3" />
			<!-- Do you want to activate additional fighters for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionsfight" exact="3" />
			<!-- Do you want to activate additional Capital ships for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionscap" exact="3" />
with everything else as 0. What will be the effect of these changes(quantitatively)? I am also using FE so that can have additional effects.

All in all it would be nice to have a few presets(as XML patches) to chose from so that there is no need to modify and maintain focwsetup.xml
Not really sure why you think presets would be somehow better when all you have to do is change the number from 0 to 3 in most cases here. 1 is considered light, 2 is considered medium, 3 is considered high. These are sort of like presets already. It says it right in there. At other times it is a simple 0 or 1 depending if you want those additional ships. You can customize further by editing a few simple things.

Code: Select all

<!-- Do you want to activate additional Xenon Miners and Xenon Energy Transport ships? 1 for Yes and 0 for No -->				
			<set_value name="$activateXenminers" exact="1" />
			<!-- Do you want to activate additional Xenon fighters? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXenfighter" exact="3" />
			<!-- Do you want to activate additional Xenon Capital ships? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateXencapital" exact="3" />
			<!-- Do you want to activate additional fighters for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionsfight" exact="3" />
			<!-- Do you want to activate additional Capital ships for all factions? You can also choose from the following settings. Keep 0 to turn off, Put 1 for light, Put 2 for medium, Put 3 for heavy. This setting may impact performance depending on what setting you choose. -->
			<set_value name="$activateallfactionscap" exact="3" />
You set the following above to 3 for the fighters and capitals. So if you do a search for the following activateXenfighter in the focwsetup it will bring you to the code this option is for, look for the one which is set to 3, like so <check_value value="md.FOCWsetup.Settings.$activateXenfighter == 3"/> This is the option you activated.
If you look below you will see what the specified quota is:

<set_value name="$ExistingDestroyerThreshold" exact="10"/>

The quota here is 10, that means the maximum squads allowed for this particular squadron is 10. This particular squadron can have anywhere from 3 to 7 subordinates (this is specified in jobs). That means anywhere from 40 fighters to 80 fighters. 1 Squadron lead plus 3 subordinate fighters = 4 and 1 Squadron lead plus 7 subordinates = 8. 4 x 10 = 40 and 8 x 10 = 80. That is the range of allowed ships in this particular option.

You can simply change the following <set_value name="$ExistingDestroyerThreshold" exact="10"/> to any number like so: exact="8" to change how many squads are allowed to be built with this option. If you don't want to play with that at all just stick to the preset options of 1, 2, or 3. If you choose option 1 then it is maximum of 3 squads, Option 3 is maximum of 6 squads and option 3 is maximum of 10 squads. This is pretty much the same for every faction.

The fighter option also adds frigate squads which consist of 1 frigate and a number of fighters (dependent on which option you chose)

In terms of the Capital ships, Option 1 is 2 destroyer squads, Option 2 is 4 destroyer squads and Option 3 is 6 destroyer squads. These are light fleets though and only would consist of 1 K and anywhere from 3 to 7 fighters on option 3. I should also mention that Option 1 and 2 would have less maximum fighter squadrons as well. This is the same for the fighters above. Usually there are 1 or 2 less maximum ships. So Option 2 would probably be anywhere from 2 to 5 fighter subordinates and Option 1 would be like 1 to 3 fighter subordinates.

So basically, setting the options to 1, 2 or 3 are already Presets. This is the simplest and easiest way to maintain this.

You should also keep in mind that the following options, <set_value name="$activateallfactionsfight" exact="3" /> and <set_value name="$activateallfactionscap" exact="3" />, only add ships for the original vanilla factions and not the DLC factions. The DLC factions and some of the minor factions have their own separate options.

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

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by BlackRain » Mon, 27. Sep 21, 00:57

I am curious if anyone is interested in some ships spawning instead of building so that there would be more excitement in addition to the ships which already get built. These ships could be considered as having been built on a planet or something and there could be some rules to it. Like depending on how many sectors they are in control of they build a certain amount of ships or something like that. I am thinking of doing it for Xenon for now and seeing how it goes.

Gen.d.Pz.Tr.Seb
Posts: 39
Joined: Sun, 9. Jan 05, 18:53
x4

Re: [MOD] Foundation of Conquest and War V. 6.7

Post by Gen.d.Pz.Tr.Seb » Mon, 27. Sep 21, 12:19

I'd be interested, as long as it is as well configurable as all your other settings, and does not drown out the classical ship building. Also what rate (/system) are you thinking of? Some kind of '1 L per 30 minutes per owned sector', or something more sophisticated?
Iucundi acti labores

Post Reply

Return to “X4: Foundations - Scripts and Modding”