[MD API REQUEST] is_turret_target_los? for Vertical Launching System

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

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

alphoneex
Posts: 1
Joined: Sat, 10. Jan 15, 00:43
x3

[MD API REQUEST] is_turret_target_los? for Vertical Launching System

Post by alphoneex »

Hello,
Not sure if anyone from Egosoft also reads this page, but I want to request a new MD API for modding.

I started making a Vertical Launching System with existing assets.
I used the Argon medium tracking turret with smart missiles: changed its component movement range to straight up, then gave its macro 360 firing range.
These simple changes made the turret to behave like VLS. Missiles were launched straight up(only tested top mounted, but for any other surface, the shooting angle should be perpendicular to its mounting surface) and the turrets fired missiles for targets over the other side of their mounting surface. Smart missiles turned to track their targets.

So, in short, vanilla assets are already adequate to implement VLS turrets, except for 1 thing, which is the last piece I need.

Those modded turrets did not start shooting until they had a target in Line Of Sight at least once. Once the target hit the LOS of the turrets, they started shooting, even when the target was no longer in LOS.


Tracing down this behaviour, I found that aiscripts/fight.attack.object.[ship type].xml has set_turret_targets for passing the targets to the turrets, but that was the dead end in MD. So, my guess is that the rest is handled by the game codes that are not exposed.
set_turret_targets probably passes targets to a turret manager of some sort, and it issues firing cues based on LOS?

Based on this assumption, if an api 'is_turret_target_los' can be created to pass 'true' condition for LOS, missile turrets can shoot at any valid targets that passed through the attack logic.

Return to “X4: Foundations - Scripts and Modding”