Handle pirates in sectors - help with mod

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

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

Necris
Posts: 36
Joined: Sun, 19. Aug 12, 17:30
x4

Handle pirates in sectors - help with mod

Post by Necris »

I have long dissliked the pirate mechanic in X4, but i dont simply want to remove them. Instead i think when you show enough control of an area you should be able to de-cloak them and attack them.
Therefore I think that a good solution would be to let the Wide Sensore Array de-cloak them.

There is an old mod I have found where they add satelies that de-cloak pirates and sets them to enemies. If that mechanic can be moved to the Wide Sensor array and affect every ship in its range then that would be my idea of an ideal solution.
Sector Setelies is the old mod that have simmilarfunctionality:
https://www.nexusmods.com/x4foundations/mods/4

I dont know X4 modding but found this section of code which i think looks relevant:

Code: Select all

            <do_for_each name="$scannedShip" in="$shipsToScan">
              <do_if value="$scannedShip.trueowner == faction.player or $scannedShip.trueowner.relationto.{faction.player} gt $scannedShip.trueowner.relation.neutral.max">
                <continue/>
              </do_if>
              <debug_text chance="$options.$debug" text="$shipsToScan.count + ' ' + $scannedShip.name + ' coverowner: ' + $scannedShip.coverowner + ' owner: ' + $scannedShip.owner + ' trueowner: ' + $scannedShip.trueowner"/>
              <do_if value="$options.$setUncoveredHostile">
                <set_relation_boost silent="true" object="$scannedShip" faction="faction.player" reason="relationchangereason.attackedobject" value="$scannedShip.owner.relation.kill.min" decay="1" delay="10min"/>
              </do_if>
              <signal_objects object="$scannedShip" param="'LoseCover'" param2="true"/>
            </do_for_each>
Can i please request help with this idea, or maybe some guidance to existing mods which i could have missed. There are SO many wanting a feature like this when searching internet about it.

Return to “X4: Foundations - Scripts and Modding”