How to change boost duration time like hull and shield?

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

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

ambit Yang
Posts: 4
Joined: Wed, 13. Aug 25, 10:28

How to change boost duration time like hull and shield?

Post by ambit Yang »

Code: Select all

<actions>
<do_all exact="md.$iseeu0modifyships.count" counter="$j">
<set_object_min_hull object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_min_shield object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_engine_min_boost_duration object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<find_object_component name="$components" object="md.$iseeu0modifyships.{$j}" multiple="true"/>
<do_all exact="$components.count" counter="$c">
<set_object_min_hull object="$components.{$c}" exact="event.param2.{1}"/>
<set_object_min_shield object="$components.{$c}" exact="event.param2.{1}"/>
<set_object_engine_min_boost_duration object="$components.{$c}" exact="event.param2.{1}"/>
</do_all>
</do_all>
</actions>
like the XML function

Code: Select all

<set_object_min_hull object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_min_shield object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
It can change your select object's shield and hull
Which function can change the boost duartion?
I have tried the following XML,all dosen't work.

Code: Select all

<set_object_engine_min_boost_duration object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_min_boost_duration object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_min_boost_time object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
<set_object_min_boost_capacity object="md.$iseeu0modifyships.{$j}" exact="event.param2.{1}"/>
if you know how to change this attribuation,please tell me,and thank you very much :)
by the way:(the base mod and code is from steam workshop,thank issue0 for the excellent work)
User avatar
ChemODun
Posts: 439
Joined: Mon, 12. Feb 07, 21:58
x4

Re: How to change boost duration time like hull and shield?

Post by ChemODun »

If it possible - not miss the indentation, to make a code more readable.
And there is no any command which contains 'min_boost'

there are 4 main files for coding scripts:
  • scriptproperties.xml - contains a data types and keywords
  • common.xsd - common commands for AI and MD files
  • aiscripts.xsd - commands used in aiscripts
  • md.xsd - the same for md
if you use the vscode for edits - I can recommend to install at least [urlhttps://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml]redhat.vscode-xml extension[/url]
Multiply entropy by absolute zero

Freedom in space
User avatar
ChemODun
Posts: 439
Joined: Mon, 12. Feb 07, 21:58
x4

Re: How to change boost duration time like hull and shield?

Post by ChemODun »

And I have explanation, why the min shield and hull sets exists.
They are useful for scenarios / missions to be sure that some ships will be not destroyed too early.

If you want to do something with boost - looks in assets\props\Engines\macros:
for example:

Code: Select all

<macros>
  <macro name="engine_arg_l_allround_01_mk1_macro" class="engine">
    <component ref="engine_arg_l_allround_01_mk1" />
    <properties>
      <identification name="{20107,3004}" basename="{20107,3001}" shortname="{20107,3005}" makerrace="argon" description="{20107,3002}" mk="1" />
      <boost duration="59" thrust="2" attack="10" release="1" />
      <travel charge="20" thrust="31" attack="75" release="22.5" />
      <thrust forward="4206" reverse="4627" />
      <hull max="4033" threshold="0.3" />
      <effects>
        <boosting ref="arg_boost_fx_l" />
      </effects>
      <sounds>
        <enginedetail ref="enginedetail_ship_l_01" />
      </sounds>
    </properties>
  </macro>
</macros>
You can try to mod some engines, but pay an attention - possible it will effect on only newly built ships, and it iwll work on any ship equipped by ... not only yours
How to make a diffs - read [TUTORIAL] XML Patch Guide
Multiply entropy by absolute zero

Freedom in space
ambit Yang
Posts: 4
Joined: Wed, 13. Aug 25, 10:28

Re: How to change boost duration time like hull and shield?

Post by ambit Yang »

ChemODun wrote: Thu, 14. Aug 25, 16:26 If it possible - not miss the indentation, to make a code more readable.
And there is no any command which contains 'min_boost'

there are 4 main files for coding scripts:
  • scriptproperties.xml - contains a data types and keywords
  • common.xsd - common commands for AI and MD files
  • aiscripts.xsd - commands used in aiscripts
  • md.xsd - the same for md
if you use the vscode for edits - I can recommend to install at least [urlhttps://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml]redhat.vscode-xml extension[/url]
thanks for you help.I will check the documents that you mentioned.
And i will notice my code indentation.
ambit Yang
Posts: 4
Joined: Wed, 13. Aug 25, 10:28

Re: How to change boost duration time like hull and shield?

Post by ambit Yang »

ChemODun wrote: Fri, 15. Aug 25, 00:00 And I have explanation, why the min shield and hull sets exists.
They are useful for scenarios / missions to be sure that some ships will be not destroyed too early.

If you want to do something with boost - looks in assets\props\Engines\macros:
for example:

Code: Select all

<macros>
  <macro name="engine_arg_l_allround_01_mk1_macro" class="engine">
    <component ref="engine_arg_l_allround_01_mk1" />
    <properties>
      <identification name="{20107,3004}" basename="{20107,3001}" shortname="{20107,3005}" makerrace="argon" description="{20107,3002}" mk="1" />
      <boost duration="59" thrust="2" attack="10" release="1" />
      <travel charge="20" thrust="31" attack="75" release="22.5" />
      <thrust forward="4206" reverse="4627" />
      <hull max="4033" threshold="0.3" />
      <effects>
        <boosting ref="arg_boost_fx_l" />
      </effects>
      <sounds>
        <enginedetail ref="enginedetail_ship_l_01" />
      </sounds>
    </properties>
  </macro>
</macros>
You can try to mod some engines, but pay an attention - possible it will effect on only newly built ships, and it iwll work on any ship equipped by ... not only yours
How to make a diffs - read [TUTORIAL] XML Patch Guide
I just want to lock the boost pool like old version, you have infinite shield and you can boost all the time.
Now it seem there is only one solution.
I have tried to write a S level engine.It can work.
can i change the oner faction to set the engine only can build by player?
in the libraries\wares

Code: Select all

<owner faction = "court">
<!--
<owner faction = "argon">
-->
<owner faction = "player">
have two questions:
  • Is legal to set owner only to player? if not how to set?
  • which regime name court?
thanks a lot
User avatar
ChemODun
Posts: 439
Joined: Mon, 12. Feb 07, 21:58
x4

Re: How to change boost duration time like hull and shield?

Post by ChemODun »

Regarding engines it is possible to make a doubles for existing ones, with needed to you properties.
And then only you will have a blueprints.
But, I think it will require to add a lot of files.

I'm mostly interesting in scripting :-)

So, the better is to join x4_modding channel onEgosoft Discord, there ae a lot of experts in modding, which can better answer on your questions.
Multiply entropy by absolute zero

Freedom in space
ambit Yang
Posts: 4
Joined: Wed, 13. Aug 25, 10:28

Re: How to change boost duration time like hull and shield?

Post by ambit Yang »

ChemODun wrote: Fri, 15. Aug 25, 10:10 Regarding engines it is possible to make a doubles for existing ones, with needed to you properties.
And then only you will have a blueprints.
But, I think it will require to add a lot of files.

I'm mostly interesting in scripting :-)

So, the better is to join x4_modding channel onEgosoft Discord, there ae a lot of experts in modding, which can better answer on your questions.
ok,thank you.
I also agree that make a "new" engine is not a eazy job.even it just modify by game self.

Return to “X4: Foundations - Scripts and Modding”