[Questions] A couple of questions

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

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

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

[Questions] A couple of questions

Post by Max Bain »

Hi,

I got some questions that make me a lot of trouble because I can not find the answers in a short time it seems. Maybe someone here can help me?
  1. How can i change the pool the computer choses the modules from, when selecting a loadout (for example highest = only beam turrets)? I want to change the weapons taken by auto-fitting.
  2. Where can I find the blueprints for ships for example?
  3. I asked this in another thread, but I think it makes sense to ask it again here: How can I set the order in which turrets are placed inside a group (by clicking on the arrows to increase number of turrets in group)? It is not the name or the position inside the xml.
  4. I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Questions] A couple of questions

Post by teleportationwars »

Max Bain wrote: Wed, 30. Oct 19, 16:27 Hi,

I got some questions that make me a lot of trouble because I can not find the answers in a short time it seems. Maybe someone here can help me?
  1. How can i change the pool the computer choses the modules from, when selecting a loadout (for example highest = only beam turrets)? I want to change the weapons taken by auto-fitting.
  2. Where can I find the blueprints for ships for example?
  3. I asked this in another thread, but I think it makes sense to ask it again here: How can I set the order in which turrets are placed inside a group (by clicking on the arrows to increase number of turrets in group)? It is not the name or the position inside the xml.
  4. I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
1. the connection tags on the ship and weapon, the price, threshold, and faction of the ware.
2. the ware is the blueprint
4. loadout has a variation set in defaults.xml
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: [Questions] A couple of questions

Post by UniTrader »

4. loadout has a variation set in defaults.xml
If its in this file it can be changed individually for each ship macro because the data in this file is applied to every macro of the respective class unless specified in the macro. Just in case you encounter outliers where the changes to the defaults doesn't have the intended effect.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Questions] A couple of questions

Post by Max Bain »

teleportationwars wrote: Thu, 31. Oct 19, 07:31
Max Bain wrote: Wed, 30. Oct 19, 16:27 Hi,

I got some questions that make me a lot of trouble because I can not find the answers in a short time it seems. Maybe someone here can help me?
  1. How can i change the pool the computer choses the modules from, when selecting a loadout (for example highest = only beam turrets)? I want to change the weapons taken by auto-fitting.
  2. Where can I find the blueprints for ships for example?
  3. I asked this in another thread, but I think it makes sense to ask it again here: How can I set the order in which turrets are placed inside a group (by clicking on the arrows to increase number of turrets in group)? It is not the name or the position inside the xml.
  4. I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
1. the connection tags on the ship and weapon, the price, threshold, and faction of the ware.
2. the ware is the blueprint
4. loadout has a variation set in defaults.xml
Thank you for the answers.

To point 1: how does threshold work? There are values between 0 and 1, what exactly do they mean? Does it mean that when 2 turrets got the same threshold, both will be taken at the same chance? Or how does it work? Threshold would not be a good naming then...
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [Questions] A couple of questions

Post by Shuulo »

Max Bain wrote: Thu, 31. Oct 19, 10:25
To point 1: how does threshold work? There are values between 0 and 1, what exactly do they mean? Does it mean that when 2 turrets got the same threshold, both will be taken at the same chance? Or how does it work? Threshold would not be a good naming then...
If ware has threshold 0.5 it will be chosen for auto-fitting for job ships with level = 0.5 and higher.
Threshold in ware file is basically the indication of the minimum level that is required from job file for this weapon to be used. Then it considers the price and has more chance to select more costly weapon.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Questions] A couple of questions

Post by Max Bain »

Shuulo wrote: Thu, 31. Oct 19, 13:29
Max Bain wrote: Thu, 31. Oct 19, 10:25
To point 1: how does threshold work? There are values between 0 and 1, what exactly do they mean? Does it mean that when 2 turrets got the same threshold, both will be taken at the same chance? Or how does it work? Threshold would not be a good naming then...
If ware has threshold 0.5 it will be chosen for auto-fitting for job ships with level = 0.5 and higher.
Threshold in ware file is basically the indication of the minimum level that is required from job file for this weapon to be used. Then it considers the price and has more chance to select more costly weapon.
So I can not make it that ships will be fitted with some randomness? I dont like that always the most expensive turrets will be chosen. I was hoping that I could just give a chance for aturret to be chosen...
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Questions] A couple of questions

Post by teleportationwars »

Max Bain wrote: Thu, 31. Oct 19, 13:53
Shuulo wrote: Thu, 31. Oct 19, 13:29
Max Bain wrote: Thu, 31. Oct 19, 10:25
To point 1: how does threshold work? There are values between 0 and 1, what exactly do they mean? Does it mean that when 2 turrets got the same threshold, both will be taken at the same chance? Or how does it work? Threshold would not be a good naming then...
If ware has threshold 0.5 it will be chosen for auto-fitting for job ships with level = 0.5 and higher.
Threshold in ware file is basically the indication of the minimum level that is required from job file for this weapon to be used. Then it considers the price and has more chance to select more costly weapon.
So I can not make it that ships will be fitted with some randomness? I dont like that always the most expensive turrets will be chosen. I was hoping that I could just give a chance for aturret to be chosen...
Well, thats what the variation does. Not that it works well with so few weapons. In places like god, jobs, create_ship you can set the loadout level the ship should spawn with. You can use min= and max= to define a range or override the variation value itself on the loadout node of the ship.
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [Questions] A couple of questions

Post by Shuulo »

Fitting is still random if you have prices in approximate the same range. It's just that more expensive things have more chance to be selected.
If you want toally random selection than set all prices for weapons the same
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Questions] A couple of questions

Post by teleportationwars »

Shuulo wrote: Sat, 2. Nov 19, 14:12 Fitting is still random if you have prices in approximate the same range. It's just that more expensive things have more chance to be selected.
If you want toally random selection than set all prices for weapons the same
is this with or without variation?
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: [Questions] A couple of questions

Post by Shuulo »

teleportationwars wrote: Sat, 2. Nov 19, 19:59
Shuulo wrote: Sat, 2. Nov 19, 14:12 Fitting is still random if you have prices in approximate the same range. It's just that more expensive things have more chance to be selected.
If you want toally random selection than set all prices for weapons the same
is this with or without variation?
variation influences level of the job ship. It has impact only on threshold of the ware.
e.g.:
level min is 0.5 and max 0.6 (or level=0.55 and variation=0.05) on job file
we have 3 guns with threshold 0.0, 0.5, 0.6

If during ship build it will randomize to 0.5, only guns with 0.0 and 0.5 thresholds will be selected to choose from, then it compares prices.
If during ship build it will randomize to 0.6, than all 3 guns will be selected to choose from, then it compares prices.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Questions] A couple of questions

Post by Max Bain »

I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
Does no one know the answer of this question? It really frustrates me that some weapon groups wont be used by autofitting. I also fear that the AI has the same problem when using custom ships... I tried everything I know to analyse or fix the problem but I have absolutely no clue about this :(.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Questions] A couple of questions

Post by teleportationwars »

Max Bain wrote: Mon, 4. Nov 19, 10:16
I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
Does no one know the answer of this question? It really frustrates me that some weapon groups wont be used by autofitting. I also fear that the AI has the same problem when using custom ships... I tried everything I know to analyse or fix the problem but I have absolutely no clue about this :(.
At a guess, the maximum loadout is still subject to the variation defined in defaults.xml. And yes, you cannot actually guarantee the connections will be full if the variation in defaults is not overridden.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Questions] A couple of questions

Post by Max Bain »

teleportationwars wrote: Mon, 4. Nov 19, 11:39
Max Bain wrote: Mon, 4. Nov 19, 10:16
I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
Does no one know the answer of this question? It really frustrates me that some weapon groups wont be used by autofitting. I also fear that the AI has the same problem when using custom ships... I tried everything I know to analyse or fix the problem but I have absolutely no clue about this :(.
At a guess, the maximum loadout is still subject to the variation defined in defaults.xml. And yes, you cannot actually guarantee the connections will be full if the variation in defaults is not overridden.
Can you tell me how I can change this? I dont see where I can change the loadouts or variations in default.xml. I only see one node with ship_l for example but there are no loadout elements. I have no idea how I can add a loadout there:
Spoiler
Show
<dataset class="ship_l">
<properties>
<radar range="40000"/>
<explosioneffect strength="15000" />
<effects>
<scuttle ref="scuttle_l" />
<collision light="light_collision_l" medium="medium_collision_l" strong="strong_collision_l" />
<!--commented out: sustain="ongoing_collision_l" -->
<explosion ref="ship_explosion_generator" />
<damage>
<effect chance="0.20" threshold="75" location="weapon" ref="sparkles_s" />
<effect chance="0.30" threshold="40" location="hull" ref="surfaceexplosions_s" />
<effect chance="1.0" threshold="15" location="hull" ref="surfaceexplosions_s" />
</damage>
</effects>
<capture allow="true" />
<docksize tag="dock_l" />
<relation>
<attack>
<tolerance threshold="-1.0" change="-0.25" decay="0.25" delay="5" />
<boost absolute="-1.0" decay="0.02" delay="540" />
</attack>
<kill>
<faction change="-0.01" bonus="0.005" />
</kill>
<police change="-0.002" bounty="300000"/>
</relation>
<wreck deceleration="40" />
<people capacity="70"/>
<storage countermeasure="20" deployable="250"/>
<statistics>
<max>
<hull value="148800.000000" />
<shield value="259646.109375" />
<weapon burst="1893.091064" sustained="1806.918701" />
<dock ship_m="1" ship_s="4" />
<engine forward="592.268066" acceleration="163.657333" boost="1592.996704" travel="19886.896484" yaw="0.552475" pitch="0.400311" roll="0.430744"/>
<capacity crew="226" container="55200" solid="28800" liquid="26400" ship_m="10" ship_s="80" unit="14" missile="164" countermeasure="20" deployable="254" />
<radar range="48000.000000" />
</max>
</statistics>
<internalsound engine="0.50" />
<modification>
<paint scale="16.0" />
</modification>
</properties>
<connections>
<connection name="con_playercontrol" tags="playercontrol" value="-1" match="all" />
<connection name="defencenpc" tags="defence" value="-1" match="all" />
<connection name="engineernpc" tags="engineer" value="-1" match="all" />
<connection name="parking" tags="parking" value="1" />
<connection name="tradecomputer" tags="tradecomputer" value="-1" match="all" />
</connections>
</dataset>
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Questions] A couple of questions

Post by teleportationwars »

Max Bain wrote: Mon, 4. Nov 19, 13:09
teleportationwars wrote: Mon, 4. Nov 19, 11:39
Max Bain wrote: Mon, 4. Nov 19, 10:16

Does no one know the answer of this question? It really frustrates me that some weapon groups wont be used by autofitting. I also fear that the AI has the same problem when using custom ships... I tried everything I know to analyse or fix the problem but I have absolutely no clue about this :(.
At a guess, the maximum loadout is still subject to the variation defined in defaults.xml. And yes, you cannot actually guarantee the connections will be full if the variation in defaults is not overridden.
Can you tell me how I can change this? I dont see where I can change the loadouts or variations in default.xml. I only see one node with ship_l for example but there are no loadout elements. I have no idea how I can add a loadout there:
Spoiler
Show
<dataset class="ship_l">
<properties>
<radar range="40000"/>
<explosioneffect strength="15000" />
<effects>
<scuttle ref="scuttle_l" />
<collision light="light_collision_l" medium="medium_collision_l" strong="strong_collision_l" />
<!--commented out: sustain="ongoing_collision_l" -->
<explosion ref="ship_explosion_generator" />
<damage>
<effect chance="0.20" threshold="75" location="weapon" ref="sparkles_s" />
<effect chance="0.30" threshold="40" location="hull" ref="surfaceexplosions_s" />
<effect chance="1.0" threshold="15" location="hull" ref="surfaceexplosions_s" />
</damage>
</effects>
<capture allow="true" />
<docksize tag="dock_l" />
<relation>
<attack>
<tolerance threshold="-1.0" change="-0.25" decay="0.25" delay="5" />
<boost absolute="-1.0" decay="0.02" delay="540" />
</attack>
<kill>
<faction change="-0.01" bonus="0.005" />
</kill>
<police change="-0.002" bounty="300000"/>
</relation>
<wreck deceleration="40" />
<people capacity="70"/>
<storage countermeasure="20" deployable="250"/>
<statistics>
<max>
<hull value="148800.000000" />
<shield value="259646.109375" />
<weapon burst="1893.091064" sustained="1806.918701" />
<dock ship_m="1" ship_s="4" />
<engine forward="592.268066" acceleration="163.657333" boost="1592.996704" travel="19886.896484" yaw="0.552475" pitch="0.400311" roll="0.430744"/>
<capacity crew="226" container="55200" solid="28800" liquid="26400" ship_m="10" ship_s="80" unit="14" missile="164" countermeasure="20" deployable="254" />
<radar range="48000.000000" />
</max>
</statistics>
<internalsound engine="0.50" />
<modification>
<paint scale="16.0" />
</modification>
</properties>
<connections>
<connection name="con_playercontrol" tags="playercontrol" value="-1" match="all" />
<connection name="defencenpc" tags="defence" value="-1" match="all" />
<connection name="engineernpc" tags="engineer" value="-1" match="all" />
<connection name="parking" tags="parking" value="1" />
<connection name="tradecomputer" tags="tradecomputer" value="-1" match="all" />
</connections>
</dataset>
Sorry, it is actually in parameters.xml

Code: Select all

  
  <loadout level="0.5" variation="0.3" ammo="0.9" software="0.9">
    <units min="0.2" max="1.0">
      <defence min="0.2" max="0.8" />
    </units>
    <group threshold="0.75" />
  </loadout>
  
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Questions] A couple of questions

Post by Max Bain »

Arrrrrgghhhh!!!

I finally found the solution for this problem:
I also asked this somewhere else: What can be the reason why some turret groups are ignored when selecting maximum loadout, but I can manually place turrets for the whole group? At least one group was created by mirroring all elements, so it should be the same as another group that works fine.
It seems that you MUST have shields in the weapon group or you completely ruin your layout.I wasted way more than 5 hours to find this out myself. Who would have expected that you must have shields inside a group ... omg...
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Return to “X4: Foundations - Scripts and Modding”