[Question] changing missile variables

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

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

Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

[Question] changing missile variables

Post by Newsparta »

Does anyone know how or where to edit missile effects?

I've been trying to find the files that govern how missile damage is calculated and I cannot find anything. I know how to change the explosion damage but I cannot change how the explosion works (splash damage range) or even changing its damage type.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!--Exported by: Matthias (192.168.3.104) at 21.11.2018_12-58-12-->
<macros>
  <macro name="missile_dumbfire_light_mk1_macro" class="missile">
    <component ref="missile_dumbfire_light_mk1" />
    <properties>
      <identification name="{20105,6004}" basename="{20105,6001}" description="{20105,6002}" />
      <ammunition value="1" />
      <missile amount="1" barrelamount="1" lifetime="12" range="9000" guided="0" icon="missile_dumbfire_mk1" tags="dumbfire" />
      <explosiondamage value="2200" />
      <reload time="1.5" />
      <hull max="21" />
      <effects>
        <explosion ref="missile_explosion_light_01" />
        <launch ref="missile_dumbfire_muzzle" />
      </effects>
      <weapon system="missile_dumbfire" />
      <countermeasure resilience="1" />
      <physics mass="0.27">
        <inertia pitch="0.198" yaw="0.198" roll="0.099" />
        <drag forward="0.054" reverse="0.216" horizontal="0.387" vertical="0.387" pitch="0.235" yaw="0.235" roll="0.117" />
      </physics>
    </properties>
    <connections>
      <connection ref="con_engine01">
        <macro ref="engine_missile_dumbfire_mk1_macro" connection="ship" />
      </connection>
    </connections>
  </macro>
</macros>
This is all I have found concerning missiles and I can edit the values in here but I want to be able to change how the explosion behaves and I don't know what "explosiondamage" points to and what other variables I can place in "properties" that would have any effect here. I have already tried inserting

Code: Select all


<diff>

  <replace sel="//macros/macro/properties/explosiondamage/@value">0</replace>

  <add sel="//macros/macro/properties">
    <damage value="3960">
  </add>

</diff>
to try and give it pinpoint damage like regular weapons but this has no effect. Does anyone else have any helpful information regarding this?
7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Question] changing missile variables

Post by 7ate9tin11s »

Newsparta wrote: Fri, 11. Jan 19, 00:34 Does anyone know how or where to edit missile effects?

...

to try and give it pinpoint damage like regular weapons but this has no effect. Does anyone else have any helpful information regarding this?
What you are looking for are influences. For the missile, look at the emp missile, then look in libraries/influenceconfigurations.xml to set up direct non-aoe damage using the influence.

I use these in Improved Kha'ak to not do damage, but cause other effects and that mod could be a decent reference too.
Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] changing missile variables

Post by Newsparta »

Thank you so much, I was scouring that library folder but just didn't know what I was looking for.
Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] changing missile variables

Post by Newsparta »

Still can't seem to get them setup correctly. I've tried this editing just a dumbfire missile, and I've tried straight copying the EMP missile and using this influence instead, I can't seem to get any results from it. I don't know if its just not compiling right or if there is a setting I am missing somewhere.

Side note, why do you not use <diff> inside the influencelistconfigurations.xml?

Code: Select all

<influencelistconfigurations>

   <influencelist name="missile_damage">
     <influences>
       <influence type="shieldhulldamage">
         <profile type="ticking" startvalue="3960" />
       </influence>
     </influences>
   </influencelist>

</influencelistconfigurations>

Code: Select all

<diff>

  <replace sel="//macros/macro/properties/explosiondamage/@value">0</replace>

  <replace sel="//macros/macro/properties/missile">
    <missile amount="1" barrelamount="1" lifetime="21.6" range="10000" influencelist="missile_damage" guided="0" icon="missile_dumbfire_mk1" tags="dumbfire" />
  </replace>

</diff>
Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] changing missile variables

Post by Newsparta »

I seem to get it to work for "envelope" profiles used for things like slowing ships down but I cannot get it to work for any of the damage examples. Maybe the examples the devs have in the files are obsolete? does anyone know of a list of accepted "profile" options to put in there?
7ate9tin11s
Posts: 813
Joined: Fri, 11. Nov 05, 23:18
x4

Re: [Question] changing missile variables

Post by 7ate9tin11s »

Newsparta wrote: Fri, 11. Jan 19, 06:39 Still can't seem to get them setup correctly. I've tried this editing just a dumbfire missile, and I've tried straight copying the EMP missile and using this influence instead, I can't seem to get any results from it. I don't know if its just not compiling right or if there is a setting I am missing somewhere.

Side note, why do you not use <diff> inside the influencelistconfigurations.xml?
Not sure if there is just no internal capabilities for the damage application, I just recall reading it was there...my bad if it does not work, never tried it :oops:

For why I am not using a diff for that in IK, I am pretty much just cheating there :D . If you are adding a direct subnode to an existing root like the 'macro' node in:

Code: Select all

<macros>
  <macro name="missile_dumbfire_light_mk1_macro" class="missile">...
  </macro>
 </macros>
Then the engine will just tack it onto the end as if you used <diff><add sel="/macros">...</add></diff> instead of <macros></macros>

When I was learning to mod these XML files I saw several examples doing that and just fall back to that method for simple library additions is all.
Newsparta
Posts: 9
Joined: Fri, 21. Dec 18, 22:58

Re: [Question] changing missile variables

Post by Newsparta »

Gotcha, makes sense. Thanks for your help though. Just seems silly for the devs to comment examples in their code that don't even work. Maybe there are some settings that need to be changed to get them to work and those are just old examples idk.

Return to “X4: Foundations - Scripts and Modding”