Help with Weapon Modding

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

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

Imp0815
Posts: 3
Joined: Wed, 17. Mar 21, 18:26
x4

Help with Weapon Modding

Post by Imp0815 »

EDIT: Ok the .wav fieles i got for my turret are not THE .wav files X4 likes. No idea why.
EDIt2: Ok i got it working now. It seems a 16bit Mono .wav is very important. I converted it with audacity and found the clue to it in this thread:
viewtopic.php?t=184570 The post from Laureati

Hey i just started Weapon modding and got one weapon kinda working.
It can be bought and equip on ships. It is shooting. But not as i wanted it too but this i will get it to work somehow.

The Main problem is that i set up Weapon sounds but they wont work.
I want a big Gun that shoots two projectiles with a high reload time.
This is how it looks like:
libraries/effects.xml snipped:

Code: Select all

<element id="4" ref="effect_dummy_macro" forkeffect="none" duration="3.0" forklod="none">
        <sound ref="wpn_620mm_turret_shoot"></sound>
      </element> 
libraries/sound_library.xml snipped:

Code: Select all

<add sel="//soundlibrary">
	<sound id="wpn_620mm_turret_shoot" description="620mm shooting" repeat="1" is3d="1" preload="1"
        <sample selection="random">
          <select start="extensions\ImpWeaponPack\sfx\weapons\620mm_Cannon_01"/>
        </sample>
        <volume start="1.5" distance="11"/>
    </sound>
As i see it it should use the .wav file in my sfx weapons folder but it does not.

Anybody got an idea why?

btw.: The File structure is a mess I can build a new weapon in Starsector in two files and here i need 6 to 8 and that's just XML not even the Graphics and such.

P.S.

Code: Select all

<ammunition value="1" reload="10" />
      <bullet speed="22000" lifetime="1.75" amount="1" barrelamount="2" icon="weapon_laser_mk1" angle="0.05" delay="0" maxhits="1" ricochet="0" scale="0" attach="0" selfdestruct="0"/>
      <reload rate="1" />
      <damage value="4500" repair="0" />
Is there an Overview what each variable does?
ammunition value = Magazin Size
reload = Time it takes to reload the magazin
amount = Bullets at the same time
barrelamount = amount times Bullets at the same time
angle ?
delay ?
maxhits ?
ricochet ?
scale ?
attach ?
selfdestruct ?
reload rate ?
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13486
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Help with Weapon Modding

Post by euclid »

Imp0815 wrote: Tue, 23. Mar 21, 18:16 ..................
Is there an Overview what each variable does?
ammunition value = Magazin Size
reload = Time it takes to reload the magazin
amount = Bullets at the same time
barrelamount = amount times Bullets at the same time
angle ?
delay ?
maxhits ?
ricochet ?
scale ?
attach ?
selfdestruct ?
reload rate ?
Not that I'm aware of. However, I've tested some of the above although not thoroughly, so take the following with a pinch of salt ;-)
  • angle .... bullets travel within a cone, similar to a shotgun;
  • delay .... time before the effect of a hit is applied (not sure);
  • maxhits ... a single shot usually hit once;
  • ricochet ... as the common sense reveals, a bullet can bounce and hit a nearby target;
  • scale ... not sure but I suspect it refers to the area of impact (i.e. bullet size);
  • attach ... DoT (damage over time), the bullet sticks to the target;
  • selfdestruct ... no clue at all;
  • reload rate ... as one would expect, the time required befor you can shoot again.
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Imp0815
Posts: 3
Joined: Wed, 17. Mar 21, 18:26
x4

Re: Help with Weapon Modding

Post by Imp0815 »

euclid wrote: Thu, 25. Mar 21, 18:05 Not that I'm aware of. However, I've tested some of the above although not thoroughly, so take the following with a pinch of salt ;-)
  • angle .... bullets travel within a cone, similar to a shotgun;
  • delay .... time before the effect of a hit is applied (not sure);
  • maxhits ... a single shot usually hit once;
  • ricochet ... as the common sense reveals, a bullet can bounce and hit a nearby target;
  • scale ... not sure but I suspect it refers to the area of impact (i.e. bullet size);
  • attach ... DoT (damage over time), the bullet sticks to the target;
  • selfdestruct ... no clue at all;
  • reload rate ... as one would expect, the time required befor you can shoot again.
Cheers Euclid
  • angle .... Just bare bones accuracy. higher values increase the spread;
  • delay .... i tested it and i still dont know what this does. i thought the time between barrel alteration?;
  • maxhits ... i dont know what this calculates;
  • ricochet ... as the common sense reveals, a bullet can bounce and hit a nearby target;
  • scale ... not sure but I suspect it refers to the area of impact (i.e. bullet size);
  • attach ... DoT (damage over time), the bullet sticks to the target;
  • selfdestruct ... i think a value to tell a projectile to self destruct.;
  • reload rate ... Nope this is just the fireing rate. higher values means faster firing. <ammunition value="500" reload="10"<-This is the time to relaod />
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Help with Weapon Modding

Post by Max Bain »

Can anyone explain to me how the heat works?
What does

Code: Select all

<heat value="30" />
mean?

And what does

Code: Select all

 <heat initial="1000" value="292" />
?
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
Imp0815
Posts: 3
Joined: Wed, 17. Mar 21, 18:26
x4

Re: Help with Weapon Modding

Post by Imp0815 »

Max Bain wrote: Thu, 8. Apr 21, 00:01 Can anyone explain to me how the heat works?
What does

Code: Select all

<heat value="30" />
mean?

And what does

Code: Select all

 <heat initial="1000" value="292" />
?
I think the <heat value="30" is the heat per shot.

<heat initial="1000" value="292" />
Don't know - maybe that the weapon start with this amount of heat when firing?
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Help with Weapon Modding

Post by Shuulo »

delay is delay in seconds between first and next round if you have amount or barrleamount more than 1
Max Bain wrote: Thu, 8. Apr 21, 00:01 Can anyone explain to me how the heat works?
What does

Code: Select all

<heat value="30" />
mean?

And what does

Code: Select all

 <heat initial="1000" value="292" />
?
Initial is heat generated by first shot if heat was 0

Guess ill make my own weapons/missiles/turrets modding guide, there are some other parameters that you wont find in vanilla weapons but that are possible to use
User avatar
Shuulo
Posts: 1633
Joined: Mon, 14. Apr 08, 17:03
x4

Re: Help with Weapon Modding

Post by Shuulo »

some other
Imp0815 wrote: Mon, 29. Mar 21, 20:45
  • angle .... cone in degrees
  • maxhits ... how many time projectile can hit the target, if it ricocheted or if it hits thorough the target if scale parameter is used
  • ricochet ... percent of a projectile to ricochet
  • scale ... can be 0 or 1, used in beams and railguns, means that projectile is a scaled beam-like thing, hitting target with any point of that beam will be a hit. if used without attach, it will penetrate the target and do amount of hits = maxhits
  • attach ... can be used only if scale is 1, attached beam to move with the turret barrel for beam weapons
  • selfdestruct ... self destruct on max range reached
j.harshaw
EGOSOFT
EGOSOFT
Posts: 2189
Joined: Mon, 23. Nov 15, 18:02

Re: Help with Weapon Modding

Post by j.harshaw »

Imp0815 wrote: Thu, 8. Apr 21, 12:59 I think the <heat value="30" is the heat per shot.
yup
Imp0815 wrote: Thu, 8. Apr 21, 12:59 <heat initial="1000" value="292" />
Don't know - maybe that the weapon start with this amount of heat when firing?
mostly used for beam weapons since they continuously generate heat while being fired. initial heat is applied when the weapon is first fired. heat value is heat per second, although, unless i'm mistaken, i believe a fractional amount of this is applied at proportional fractions of a second such that the application of heat appears continuous.

Return to “X4: Foundations - Scripts and Modding”