[Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

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

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

HelicopterGearbox
Posts: 17
Joined: Tue, 1. Aug 23, 20:35
x4

[Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by HelicopterGearbox » Fri, 1. Sep 23, 05:09

Is there a way to make an energy weapon (IE, pulse laser) have shots that track their targets like missiles?

Been messing with the Teladi Main battery macro file for a few hours.

Code: Select all

<macros>
  <macro name="bullet_tel_l_laser_01_mk1_macro" class="bullet">
    <component ref="bullet_tel_l_laser_01_mk1" />
    <properties>
      <bullet speed="1659" lifetime="6.3" amount="1" barrelamount="1" icon="weapon_laser_mk1" timediff="0.002" angle="0.03" maxhits="1" ricochet="0" scale="0" attach="0" />
      <heat value="475" />
      <reload rate="1.44" />
      <damage value="1169" repair="0" />
      <effects>
        <impact ref="impact_gen_l_laser_01_mk1" />
        <bigobjectimpact ref="impact_gen_l_laser_01_mk1_bigobject" inside="impact_gen_l_laser_01_mk1_bigobject_inside" />
        <launch ref="muzzle_gen_l_laser_01_mk1" />
      </effects>
      <weapon system="weapon_standard" />
    </properties>
  </macro>
</macros>
It would seem based on the missile torpedo macro that you could tack

Code: Select all

guided="1"
onto the properties line, but this doesn't work. I

Code: Select all

<macros>
  <macro name="missile_torpedo_light_mk1_macro" class="missile">
    <component ref="missile_torpedo_light_mk1" />
    <properties>
      <identification name="{20105,6144}" basename="{20105,6141}" description="{20105,6142}" />
      <ammunition value="1" />
      <missile amount="1" barrelamount="1" lifetime="50" range="3000" guided="1" icon="hud_ms_torpedo_light_mk1" retarget="0" tags="torpedo" />
      <explosiondamage value="4791" />
      <reload time="10" />
      <hull max="8" />
      <effects>
        <explosion ref="missile_explosion_heavy_01" />
        <launch ref="missile_torpedo_muzzle" />
      </effects>
      <weapon system="torpedo" />
      <countermeasure resilience="0.98" />
       <physics mass="0.329">
        <inertia pitch="0.264" yaw="0.264" roll="0.264" />
        <drag forward="0.066" reverse="0.263" horizontal="0.472" vertical="0.472" pitch="0.125" yaw="0.125" roll="0.125" />
      </physics>
    </properties>
    <connections>
      <connection ref="con_engine01">
        <macro ref="engine_missile_guided_mk1_macro" connection="ship" />
      </connection>
    </connections>
  </macro>
</macros>
It seems like weapons are either unguided projectiles or guided missiles which require ammunition.

linolafett
EGOSOFT
EGOSOFT
Posts: 3380
Joined: Mon, 26. Mar 12, 14:57
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by linolafett » Fri, 1. Sep 23, 09:50

I just poked around, this is not possible at the moment, but would be indeed very cool!
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff

HelicopterGearbox
Posts: 17
Joined: Tue, 1. Aug 23, 20:35
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by HelicopterGearbox » Fri, 1. Sep 23, 14:00

linolafett wrote:
Fri, 1. Sep 23, 09:50
I just poked around, this is not possible at the moment, but would be indeed very cool!
Ok, thanks.

Is it possible to make a missile weapon that doesn't require ammunition? That might be the other way to do it.

Rothank
Posts: 53
Joined: Mon, 11. Aug 14, 22:48
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by Rothank » Sat, 2. Sep 23, 01:37

This (https://discord.com/channels/3370982909 ... 0603857971) Egosoft modding channel Discord post suggests that if you set up your weapon as a missile, but do NOT define an ammo ware - it should have infinite ammo.

I have not tried, but you could try giving it a shot.
Image Image
Image

HelicopterGearbox
Posts: 17
Joined: Tue, 1. Aug 23, 20:35
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by HelicopterGearbox » Sat, 2. Sep 23, 23:43

Rothank wrote:
Sat, 2. Sep 23, 01:37
This (https://discord.com/channels/3370982909 ... 0603857971) Egosoft modding channel Discord post suggests that if you set up your weapon as a missile, but do NOT define an ammo ware - it should have infinite ammo.

I have not tried, but you could try giving it a shot.
Thanks. Is this what you mean-IE, comment out the ammo ware from the weapon macro?:

Code: Select all

<diff> 
<replace sel="//macros">
<macros>
	 <macro name="weapon_tel_l_destroyer_01_mk1_macro" class="missilelauncher">
    <component ref="weapon_tel_l_destroyer_01_mk1" />
    <properties>
      <identification name="{20105,1164}" basename="{20105,1161}" shortname="{20105,1165}" description="{20105,1162}" unique="0" mk="1" />
<!--		<ammunition  tags="torpedo"/>-->
      <bullet class="bullet_tel_l_laser_01_mk1_macro" />
      <reload />
      <hull max="500" hittable="0" />
    </properties>
  </macro>
</macros>
</replace>
</diff>
This doesn't work-how do I set it up without a ware? Am I missing a file where the connection between the ammunition ware and the weapon firing is defined?

Rothank
Posts: 53
Joined: Mon, 11. Aug 14, 22:48
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by Rothank » Sun, 3. Sep 23, 10:58

HelicopterGearbox wrote:
Sat, 2. Sep 23, 23:43

Thanks. Is this what you mean-IE, comment out the ammo ware from the weapon macro?:

Code: Select all

<diff> 
<replace sel="//macros">
<macros>
	 <macro name="weapon_tel_l_destroyer_01_mk1_macro" class="missilelauncher">
    <component ref="weapon_tel_l_destroyer_01_mk1" />
    <properties>
      <identification name="{20105,1164}" basename="{20105,1161}" shortname="{20105,1165}" description="{20105,1162}" unique="0" mk="1" />
<!--		<ammunition  tags="torpedo"/>-->
      <bullet class="bullet_tel_l_laser_01_mk1_macro" />
      <reload />
      <hull max="500" hittable="0" />
    </properties>
  </macro>
</macros>
</replace>
</diff>
This doesn't work-how do I set it up without a ware? Am I missing a file where the connection between the ammunition ware and the weapon firing is defined?
That will definitely not work. You are still calling using bullet_tel_l_laser_01_mk1_macro.
If there is any chance of it working, you need to define you own custom macro based on a missile weapon and only remove the ammunition tag.
And, again, this is only my theory - I have not played around with infinite missiles myself yet.
Image Image
Image

HelicopterGearbox
Posts: 17
Joined: Tue, 1. Aug 23, 20:35
x4

Re: [Help] Can you make a guided "bullet" or non-missile energy weapon with guided shots?

Post by HelicopterGearbox » Sat, 9. Sep 23, 05:16

Rothank wrote:
Sun, 3. Sep 23, 10:58
HelicopterGearbox wrote:
Sat, 2. Sep 23, 23:43

Thanks. Is this what you mean-IE, comment out the ammo ware from the weapon macro?:

Code: Select all

<diff> 
<replace sel="//macros">
<macros>
	 <macro name="weapon_tel_l_destroyer_01_mk1_macro" class="missilelauncher">
    <component ref="weapon_tel_l_destroyer_01_mk1" />
    <properties>
      <identification name="{20105,1164}" basename="{20105,1161}" shortname="{20105,1165}" description="{20105,1162}" unique="0" mk="1" />
<!--		<ammunition  tags="torpedo"/>-->
      <bullet class="bullet_tel_l_laser_01_mk1_macro" />
      <reload />
      <hull max="500" hittable="0" />
    </properties>
  </macro>
</macros>
</replace>
</diff>
This doesn't work-how do I set it up without a ware? Am I missing a file where the connection between the ammunition ware and the weapon firing is defined?
That will definitely not work. You are still calling using bullet_tel_l_laser_01_mk1_macro.
If there is any chance of it working, you need to define you own custom macro based on a missile weapon and only remove the ammunition tag.
And, again, this is only my theory - I have not played around with infinite missiles myself yet.
Yes, I realized that very rapidly. Thanks.

Return to “X4: Foundations - Scripts and Modding”