[MOD] Better piracy

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

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

shovelmonkey
Posts: 152
Joined: Wed, 29. Feb 12, 17:34
x4

Re: [MOD] Better piracy

Post by shovelmonkey » Mon, 25. May 20, 18:46

Alberto.Rota wrote:
Mon, 25. May 20, 18:29
Wow, a lot of good feedback there, let me go point by point:
shovelmonkey wrote:
Mon, 25. May 20, 17:14
Would be nice to designate who I want the corsair to prey on....
It's doable, but no vanilla command at all allows it (Patrol, Police, Protect position/station, etc.), because while nice in concept, it will add a lot of complexity to how to use the order, both conceptual and UX complexity, just for a very few gain.

Not on my roadmap.

Just spit balling here, but there isn't anyway to tie blacklists into managing this is there?

Alberto.Rota wrote:
Mon, 25. May 20, 18:29
shovelmonkey wrote:
Mon, 25. May 20, 17:14
Currently, it seems difficult for them to catch anything.
That's a vanilla issue indeed... If you set your traders to "Flee from pirates", how many of them will you lose? (Spoiler: less than 5% of them.)
Combat AI doesn't know how to handle fleeing/moving targets and will fail to engage them almost every single time unless both of them are actively attacking each other.

I can "fix" this by making your Corsair (Wing leader) to "taunt" his target so that it forcefully engage in combat against your Corsair (Adding an attack order to the top of their list), but then we have the other situation, no-one will never ever be able to scape...
Maybe I can make it work only sometimes, depending on pilot skill (30% for 3*, 60% for 4*, 90% for 5*)?

I will try to add something like this for the next update if it makes sense, feedback and opinions are welcome.

This sounds very interesting, though from reading your suggestions I think my primary problem is the position of my fleet.

Alberto.Rota wrote:
Mon, 25. May 20, 18:29
shovelmonkey wrote:
Mon, 25. May 20, 17:14
I stick them in a traffic lane by a station and generally, ships will travel drive right by them.
If you were going to hijack a car, you for sure will do it while it's parked, not in the middle of the highway at full speed. :wink:
Position your corsairs near areas where your target stops, not where they pass at full speed, that will dramatically improve their success rate.
I think you are correct here. I will try in better locations. I personally have trouble stopping a ship with travel drive engaged let alone the AI.

Alberto.Rota wrote:
Mon, 25. May 20, 18:29
shovelmonkey wrote:
Mon, 25. May 20, 17:14
... but my corsair continues to pursue unless manually cancelled. Make sure you cancel any subordinates as well as simply cancelling the commander doesn't reset all ships in the fleet. In one instance I wasn't paying close attention and found my little corsair fleet of 1 m and 3 s' clear across the map chasing a target they were never going to catch.
They will only pursue it within the same sector, they will never pursue it further, make sure that you have the latest version.
They will also stop if the target docks somewhere, so don't worry, you don't need to manually cancel them, they will desist and go back to the starting point.

I have witnessed them cancel after a target docks. I can say with absolute certainty, however, that I have seen at the very least the escorts pursuing a target multiple sectors away. I will double check, but I am fairly certain I am on the latest version.

Alberto.Rota wrote:
Mon, 25. May 20, 18:29
shovelmonkey wrote:
Mon, 25. May 20, 17:14
If I am flying and select the harass options my subordinates will invariably destroy the target regardless of whether they are set to defend, attack, or intercept.
That's a symptom of you having your subordinates equipped to KILL, not to SCARE.
Try reducing the number of subordinates to 2 or 3 S ships.
Also avoid plasma, shotgun, missiles, torpedos or any other high damage weapons, prefer Ion and mk1 weaponry in general.

Remember, you want to scare a merchant, not to take over a sector!

This is my exact fleet, a nemesis and 3 quasars all with mk1 pulse lasers. Maybe I will back this off abit as well.

All in all having thought about your remarks I think my positioning is a big factor. I will try camping a station and see what happens. I did camp the trade station in HC1 but the target always seemed to either dock or make it to the highway depending on which direction they were coming from. This led the corsair AI into cancellation or the forever chase scenario if they reached the highway.
“Not even once has life or the weather complained about a human being.”
― Mokokoma Mokhonoana

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Mon, 25. May 20, 20:17

shovelmonkey wrote:
Mon, 25. May 20, 18:46
This is my exact fleet, a nemesis and 3 quasars all with mk1 pulse lasers. Maybe I will back this off abit as well.
That adds up to:
5M weapons (Nemesis)
2M turrets (Nemesis)
12S weapons (Quasars)

That's... a lot, try with a Minotaur Raider (2M weapons + 2M turrets) and two Eclipse (2 Ion mk2 + 2 pulse mk1 each).
Is way cheaper and much more effective.
shovelmonkey wrote:
Mon, 25. May 20, 18:46
I did camp the trade station in HC1 but the target always seemed to either dock or make it to the highway depending on which direction they were coming from.
Remember that you can make the target area as small as needed in order to ensure that your ships will be in the right spot, sometimes it makes sense to keep it small (2 to 3 km).

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Fri, 29. May 20, 18:08

I've just updated the mod
  • Corsairs will taunt their target to force it to attack them, success dependant on Corsair piloting skill.
  • Added Japanese translation (By @Arkblade JP)
This should drastically improve their capability to operate in areas where the ships just "pass by", taunt success will vary from 60% (3* piloting skill) to 100% (5* piloting skill).

As always, feedback and bug reports are welcome!

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Fri, 29. May 20, 18:20

shovelmonkey wrote:
Mon, 25. May 20, 17:14
Currently it seem difficult for them to catch anything. I stick them in a traffic lane by a station and generally ships will travel drive right by them.
Should be "fixed" in the latest release:
  • A 5* piloting corsair (If you are ever available to get it) will NEVER let a target pass by.
  • For more "rookie" corsairs (3* and 4*) the situation should improve, but is still better to position them where the ships stop rather than where the ships pass at full speed.

Alberto.Rota
Posts: 78
Joined: Fri, 22. Feb 13, 17:34
x4

Re: [MOD] Better piracy

Post by Alberto.Rota » Sun, 31. May 20, 20:00

Is there anything anyone misses for their corsairs?
This week I plan to implement the "Advanced Corsair" and I'm open to adding things to it.

My initial idea is to add, on top of the existing order, two new fields:
  1. Re-stock marines at: (Shipyard or ward where the corsair will buy marines when they run out of them.)
  2. Send captured ships to: (Station where the captured ships will be ordered to dock, instead of idling where they are claimed)
As you can see both of them are targeted towards automating the last bit of the piracy process: Claiming the abandoned ships.

Please, restrain for proposing "Chose faction", "Faction whitelist", "Faction blacklist" or any other faction related target choosing feature, see the previous posts for a detailed explanation of why is something I'm not willing to do.

Further than that, I'm open to anything, so feel free to post your most crazy ideas! :wink:

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Mon, 1. Jun 20, 15:57

When I make a ship bail personally, I'll send it to a Support Ship - if I have one - for repairs. Would it be possible to both Tag a destination for a ship to go to, as you already suggest, and automate it being repaired if the destination supports it? I.e. if we set the destination to a Wharf / Equipment Dock it'll repairs at a credit cost, or if at a Support Ship / Carrier we own, it repairs for free. I'd expect the latter to be somewhat easier to implement, due to the repairs being free. Just guessing though.

My reasoning behind this is the potential of Corsairs to acquire a lot of ships while the player is elsewhere, and having to repair those one by one isn't ideal. I tend to keep most of my captured ships, using any Fighters to bolster my fleets, though even those I sell I want to repair to get maximum credits for them of course.

Just a thought :)

Scoob.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Tue, 2. Jun 20, 18:59

Hi,

It might be worth mentioning - unless I missed it - that the current version of Better Piracy - 0.13.0 - needs the latest version of Sirnukes support apis. I updated to BP 0.13.0 from 0.12.0 while still using version 1.71 of the support api and my game froze seconds after loading. Updating to version 1.75 of the support api sees my game load, and run, just fine.

Scoob.

Cedric_FP
Posts: 189
Joined: Thu, 13. Apr 06, 17:56
x4

Re: [MOD] Better piracy

Post by Cedric_FP » Thu, 18. Jun 20, 03:24

Hello,

First let me say I love this mod and it has greatly enhanced my current playthrough. I love capturing minotaur raiders!

However, now that I've got some funding in this save and trying to build a pirate fleet, I wanted to ask, if I set my fleet to 'Corsair' default behavior, who will they choose to target?

I am in a situation where I am neutral or better with every race.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Thu, 18. Jun 20, 12:18

I guess they'd target SCA ships? I too am on good terms with the main factions, so it's SCA I manually targets and I'd expect my Corsairs to do the same, once I level up a pilot enough to take the role.

Scoob.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Mon, 29. Jun 20, 18:22

I have a question re: Corsairs...

I'll sometimes agro an otherwise neutral ship cos I want it more than the current owner. These care just S and M-Class ships. If I were to agro a ship in an area where I have Corsairs operating, with this ship then become a valid target for them, or will the ship belonging to a Neutral faction exclude this?

My thought was that I'd have some Corsairs patrolling an area and I would effectively be "marking" targets for them (while in a fast Scout ship) for them to harass.

Scoob.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Sat, 4. Jul 20, 03:12

Hi Alberto,

I hope you're well and still around, love this mod.

I think I might have found a slight bug. Scenario:

I started a Harass operation to capture a target, I got to the "Board" stage so did exactly that. I have several ships in my boarding fleet but some simply refused to launch their Marines. I tried time and time again and the same culprits would not launch Marines. It was eventually that I noticed that both the "Board target " AND "Harass" missions were still active. The ships that did not launch Marines were still "Harassing". The second I cancelled the "Harass" Mission - the "Board" Mission remained active of course - those ship also Launched their Marines.

So, when multiple ship are used in a boarding operation - I had 11 - the "Harass" part of the mission doesn't cancel when the "Board Target" stage occurs.

Now I know how to work around this - manually cancelling the stuck "Harass" mission, this does not cause me any trouble, but I imagine you'd like to look into this.

Cheers,

Scoob.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Thu, 26. Nov 20, 23:20

Hi,

I'm testing this Mod with the 4.0 Beta and while I've not spent much time with it so far, there is one issue:

When I claim a ship (right-click > Claim from within cockpit) said ship takes damage when the pod arrives.

Egosoft introduced a new way to claim ships in 4.0, where the player can select one of their ships then right-click > Claim on a target derelict. This causes damage in vanilla of course, though I expected it not to cause damage with BP installed.

I know it's the intent that claiming using a Marine aboard a pod (for S and M-Class ships) does NOT cause any damage, yet it does.

Note: I'm unsure whether it's related, however I do have all that "Damage Hull / Destroy Components" set to OFF in the settings.

Hopefully you plan to support this excellent mod into 4.0 and beyond, but thanks for all your work regardless :)

Scoob.

Polofix
Posts: 179
Joined: Thu, 6. Dec 18, 18:05

Re: [MOD] Better piracy

Post by Polofix » Sat, 28. Nov 20, 07:02

Hello,
I wanted to report here about a small bug.
Someone wrote, that the audio files in the MOD are not played.
This is because the path in the sound_library.xml does not match the path in the extension folder.

I downloaded my version from Github. There the Mod folder is called 'x4-Better-piracy-0.13.0'. In the sound_library.xml
but the path is called 'better_piracy'. Of course this has to be adapted. I don't know if this is also true for Steam and Nexus versions.

sound_library.xml:

Code: Select all

<sample start="extensions\better_piracy\voice\61538\normal" />

Must be changed to :

Code: Select all

<sample start="extensions\x4-Better-piracy-0.13.0\voice\61538\normal" />
Attention! The entry exists twice. Of course both entries have to be changed.

Bug:
When I shoot down the shield of a M-ship it can happen that the progress bar does not reach the end, although the shield already has 0 %. I cannot reach the next stage of the capture mission (get the hull down). My conclusion is that the weapons are bringing the target's shield down too fast. It works better with much weaker weapons. But the progress bar should be oriented to the percentage of the shield, which it does not do. (My Pilot has 5 Stars)
For me this is a bug.

Question:
The standard Corsair behaviour does not work for me. I have read that own NPC-AI ships only try to capture other ships when they are hostile. Don't Green Scale Pact ships with Faction rep of -5 count as hostile enough? These ships are ignored by the standard Corsair behaviour. At which rep ships are attacked by my NPC-AI ships ? from -20 ? Unfortunately, I am in good standing with all factions and therefore cannot test this.

OT:
The mod creator seems to have stopped the project.The last entry here in the forum is from 31.5.2020. I think it is a pity that often projects are finished without leaving a short message in the forum. Many questions remain open. To write a short message that the project is finished and there is no further support should be possible.
Then you don't have to spend further energy and attention in this matter.
Unfortunately I experience this more and more often. In my opinion you also have a certain responsibility towards the community, if you transfer such a project from the private to the public.
But that is only my personal opinion.

DaMuncha
Posts: 1394
Joined: Mon, 1. Nov 10, 10:00
x4

Re: [MOD] Better piracy

Post by DaMuncha » Sun, 21. Mar 21, 03:17

Where are the settings menu for this?
Just... another... bug.

Scoob
Posts: 10036
Joined: Thu, 27. Feb 03, 22:28
x4

Re: [MOD] Better piracy

Post by Scoob » Mon, 22. Mar 21, 01:09

DaMuncha wrote:
Sun, 21. Mar 21, 03:17
Where are the settings menu for this?
Press "Esc" to bring up the Main Menu, then select "Extension Options" they're all in there.

Scoob.

DaMuncha
Posts: 1394
Joined: Mon, 1. Nov 10, 10:00
x4

Re: [MOD] Better piracy

Post by DaMuncha » Mon, 22. Mar 21, 02:15

THen its not working with the DLC. I have the APIs mod installed, and its turned on in the extensions but there is no options and I see nothing in the game.
Just... another... bug.

Leo and Friends
Posts: 4
Joined: Thu, 10. Oct 19, 09:40

Re: [MOD] Better piracy

Post by Leo and Friends » Mon, 22. Mar 21, 08:07

It works just fine for me. Download it from steam. Harass, you select it from the context menu and it will give you a list of instructions to follow, which ultimately leads to some crewmen abandoning ship.

DaMuncha
Posts: 1394
Joined: Mon, 1. Nov 10, 10:00
x4

Re: [MOD] Better piracy

Post by DaMuncha » Mon, 22. Mar 21, 23:48

I restarted the game again and now its working.
Just... another... bug.

dantebelmondo
Posts: 17
Joined: Sun, 22. Mar 15, 22:32
x4

Re: [MOD] Better piracy

Post by dantebelmondo » Mon, 22. Nov 21, 01:59

Love this mod. I tested with v4.1 and 2 DLCs. The result is surprisingly good. I fixed a few issues mentioned by other players.

1. 12/01/21 updated: Fixed the invalid patch that "Removed extra damage done when claiming with marines". Properly removed the damage done when claiming with marines in vanilla in favor of toggleable damage from the mod.

2. Scoob
I started a Harass operation to capture a target, I got to the "Board" stage so did exactly that. I have several ships in my boarding fleet but some simply refused to launch their Marines. I tried time and time again and the same culprits would not launch Marines. It was eventually that I noticed that both the "Board target " AND "Harass" missions were still active. The ships that did not launch Marines were still "Harassing". The second I cancelled the "Harass" Mission - the "Board" Mission remained active of course - those ship also Launched their Marines.

So, when multiple ship are used in a boarding operation - I had 11 - the "Harass" part of the mission doesn't cancel when the "Board Target" stage occurs.

Now I know how to work around this - manually cancelling the stuck "Harass" mission, this does not cause me any trouble, but I imagine you'd like to look into this.
12/01/21 updated: Need more information.

3. Polofix
When I shoot down the shield of a M-ship it can happen that the progress bar does not reach the end, although the shield already has 0 %. I cannot reach the next stage of the capture mission (get the hull down). My conclusion is that the weapons are bringing the target's shield down too fast. It works better with much weaker weapons. But the progress bar should be oriented to the percentage of the shield, which it does not do. (My Pilot has 5 Stars)
For me this is a bug.
The original script did check if the target's shield percentage < the threshold - 10 (i.e., if you set the threshold to be 30, the phase will change to damageHull if the shield is lower than 20). However, the check will fail if users set the threshold < 10. And it will stuck at the damageShiled phase forever. I changed the min to 11.

4. Polofix
The standard Corsair behaviour does not work for me. I have read that own NPC-AI ships only try to capture other ships when they are hostile. Don't Green Scale Pact ships with Faction rep of -5 count as hostile enough? These ships are ignored by the standard Corsair behaviour. At which rep ships are attacked by my NPC-AI ships ? from -20 ? Unfortunately, I am in good standing with all factions and therefore cannot test this.
-5 is neutral. So the corsair command will never capture SCA ships. I added another condition that if the ship's paintmod is SCA's default (makes more sense than knowing the true owner), corsair will start. SCA is the only pirate faction that has static reputation anyway.

Only modified files are included. Required the original file. Make sure to change the folder name from "x4-Better-piracy-0.13.0" to "better_piracy" for the sound files to work.

12/03/21: check the update post
Last edited by dantebelmondo on Sat, 4. Dec 21, 04:30, edited 4 times in total.

User avatar
Lord Dakier
Posts: 3243
Joined: Fri, 8. Dec 06, 13:45
x4

Re: [MOD] Better piracy

Post by Lord Dakier » Thu, 25. Nov 21, 19:26

dantebelmondo wrote:
Mon, 22. Nov 21, 01:59
Love this mod. I tested with v4.1 and 2 DLCs. The result is surprisingly good. I fixed a few issues mentioned by other players
Nice job, will give it a go with your patch!

Post Reply

Return to “X4: Foundations - Scripts and Modding”