[Help] xml patch not working or...? Want to enable throttle control in travel drive.

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

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

AkiraR
Posts: 35
Joined: Sun, 15. Apr 18, 02:05
x3tc

[Help] xml patch not working or...? Want to enable throttle control in travel drive.

Post by AkiraR » Sun, 25. Jun 23, 21:02

TL;DR - I found the following section in \libraries\controlschemes_default.xml in 08.cat all attempts at altering it have failed to produce any change in game.

Code: Select all

 
 <controlschemes>
   ---stuff---
  <scheme identifier="default" refspace="ship">
    ---stuff---
    <values>
      ---more stuff---
      
      <!--Forced max throttle when boosting or traveling (unless speed matching is active)-->
      
      <value id="input_z" basevalue="1" factors="max_v_z">
        <conditions>
          <condition id="player_boost_active" />
          <condition id="player_flightassist_active" />
        </conditions>
      </value>
      
      <value id="input_z" basevalue="1" factors="max_v_z">
        <conditions>
          <condition id="player_travelmode_charging" />
          <condition id="player_match_speed_active" inverted="true" />
          <condition id="player_flightassist_active" />
        </conditions>
      </value>
      
      <value id="input_z" basevalue="1" factors="max_v_z">
        <conditions>
          <condition id="player_travelmode_active" />
          <condition id="player_match_speed_active" inverted="true" />
          <condition id="player_flightassist_active" />
        </conditions>
      </value>
      
    </values>
  </scheme>
</controlschemes>
Finding this was very exciting for me as not being able to adjust speed in travel drive has been one of my top 10 gripes with the game since basically day one. I have tried a number of different ways of modifying this with an xml patch, from replacing the entire <scheme identifier="default"> node with a modified one to replacing the individual <value id="input_z"> nodes and nothing has worked or shown any change to behavior in game. My current patch looks like this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
	<remove sel="/controlschemes/scheme[@identifier='default']/values/value[@id='input_z']" />
	<remove sel="/controlschemes/scheme[@identifier='default']/values/value[@id='input_z']" />
	<remove sel="/controlschemes/scheme[@identifier='default']/values/value[@id='input_z']" />
	<add sel="/controlschemes/scheme[@identifier='default']/values">
		<value id="target_v_z" basevalue="1" factors="input_z max_v_z">
			<conditions>
				<condition id="player_travelmode_active" />
				<condition id="player_match_speed_active" inverted="true" />
				<condition id="player_flightassist_active" />
				<condition id="value" valueid="input_z" greater_than="0" />
			</conditions>
		</value>
	</add>
	<add sel="/controlschemes/scheme[@identifier='default']/values">
		<value id="input_z" basevalue="0.31">
			<conditions>
				<condition id="player_travelmode_active" />
				<condition id="player_match_speed_active" inverted="true" />
				<condition id="player_flightassist_active" />
				<condition id="value" valueid="input_z" less_than="0.3" />
			</conditions>
		</value>
	</add>
	<add sel="/controlschemes/scheme[@identifier='default']/values">
		<value id="input_z" basevalue="0.31">
			<conditions>
				<condition id="player_travelmode_charging" />
				<condition id="player_match_speed_active" inverted="true" />
				<condition id="player_flightassist_active" />
			</conditions>
		</value>
	</add>
</diff>
Am I doing something wrong here or is this some left over legacy xml file that the game engine doesn't even use anymore as the behavior is hardcoded? Does anyone have any ideas on how to achieve my desired goal of having control over your speed in travel drive by any other means?

User avatar
Dj_FRedy
Posts: 237
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Help] xml patch not working or...? Want to enable throttle control in travel drive.

Post by Dj_FRedy » Mon, 26. Jun 23, 14:19

Your diff might need some tweaking but try this way:

Code: Select all

    <remove sel="(//value[@id='input_z'])[1]"/>
    <remove sel="(//value[@id='input_z'])[2]"/>
    <remove sel="(//value[@id='input_z'])[3]"/>
    <add sel="//scheme[@identifier='default']/values">
        <value id="target_v_z" basevalue="1" factors="input_z max_v_z">
            <conditions>
                <condition id="player_travelmode_active"/>
                <condition id="player_match_speed_active" inverted="true"/>
                <condition id="player_flightassist_active"/>
                <condition id="value" valueid="input_z" greater_than="0"/>
            </conditions>
        </value>
        <value id="input_z" basevalue="0.31">
            <conditions>
                <condition id="player_travelmode_active"/>
                <condition id="player_match_speed_active" inverted="true"/>
                <condition id="player_flightassist_active"/>
                <condition id="value" valueid="input_z" less_than="0.3"/>
            </conditions>
        </value>
        <value id="input_z" basevalue="0.31">
            <conditions>
                <condition id="player_travelmode_charging"/>
                <condition id="player_match_speed_active" inverted="true"/>
                <condition id="player_flightassist_active"/>
            </conditions>
        </value>
    </add>
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

AkiraR
Posts: 35
Joined: Sun, 15. Apr 18, 02:05
x3tc

Re: [Help] xml patch not working or...? Want to enable throttle control in travel drive.

Post by AkiraR » Tue, 27. Jun 23, 19:36

Dj_FRedy wrote:
Mon, 26. Jun 23, 14:19
Your diff might need some tweaking but try this way:
*snip*
Alas no dice, thanks for the reply though. It's so frustrating because there is clearly some control, if you spin your scroll wheel down fast enough you can actually see your speed drop some before accelerating up again, and you can match speed to ships going slower than you. Based on how this xml is written it's as if they are directly overriding the target_v_z, the target z vector velocity relative to player ship. The fact this seems to be happening in some hard coded manner and not respecting what is laid out in this xml just makes it all the more infuriating. I really don't understand why they don't allow us to have some velocity adjustment, there are so many gameplay aspects that would feel worlds better if we could. Escort missions would be infinitely more enjoyable and less annoying, flying around in a formation with AI wingmen might actually work, if the AI could do it fleet cohesion would be vastly improved. From a game design standpoint it just makes absolutely no sense to take this control away from the player, it doesn't add any kind of meaningful challenge all it does is contribute to the overall janky feel this incredibly rough gem of a game has.

User avatar
Dj_FRedy
Posts: 237
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Help] xml patch not working or...? Want to enable throttle control in travel drive.

Post by Dj_FRedy » Wed, 28. Jun 23, 15:24

This offers 'some control' over increasing and decreasing the speed with the mouse wheel, on the other hand, it is not at all satisfactory as far as precision is concerned, still, I put it over here:

Code: Select all

    <!-- vanilla: factors="max_v_z" -->
    <replace sel="(//value[@id='input_z'])[2]/@factors">input_z</replace>
    <!-- vanilla: factors="max_v_z" -->
    <replace sel="(//value[@id='input_z'])[3]/@factors">input_z</replace>
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

GageDragon
Posts: 59
Joined: Tue, 26. Apr 16, 01:21
x4

Re: [Help] xml patch not working or...? Want to enable throttle control in travel drive.

Post by GageDragon » Mon, 10. Jul 23, 22:34

Not a modder and hate to code so not any help there but if you activate travel drive then match speed to a ship you stay in travel drive while matching speed, perhaps looking into that will help.

Return to “X4: Foundations - Scripts and Modding”