[SCRIPT] NPC Bailing Addon v1.7.8 [2010-09-21]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

[SCRIPT] NPC Bailing Addon v1.7.8 [2010-09-21]

Post by ThisIsHarsh » Sat, 25. Oct 08, 08:12

NPC Bailing Addon

:arrow: This plugin allows for NPC vs. NPC battles to cause pilots of small and large (if enabled) craft to bail.


:arrow: Required: Community Configuration Menu by Cycrow

:arrow: Required: JSON parser library v1.1 (thread)

:arrow: Download: NPC Bailing Addon


:arrow: Highly recommended: Salvage Claim Software by Cycrow - required for claiming big ships

:arrow: Recommended: Salvage Commands and NPCs - automate salvaging and add NPC salvagers to add competition and help balance this plugin


:arrow: Details:
  • Pilots may bail from their ships during combat when their hull is severely damaged. A pilot's bravado is based on a combination of their morale, aggression and fight skill. The chance of bailing is based on the bravado and the bail rate factor. The amount of hull damage they must suffer before bailing is based on the bravado and the bail hull factor. A higher number indicates higher probability/hull percent. The bail rate and hull factors are configurable through the menu.
  • There are also separate Xenon and Khaak modifier options, allowing you to set a percentage modification of bail rate/hull factors - i.e. 200% means bail twice as often as other race ships, 0% disables bailing, etc.
  • Use the Community Configuration Menu to configure the plugin. Most options should be self explanatory. The option "Non-standard ship bailing", if enabled, could cause unintended side-effects, such as not being able to claim certain abandoned ships without using a third-party plugin.
  • If you have a Bioscanner and Freight scanner installed then you may scan ships for their pilot's bravado rating, which is related to their chance of bailing. This is done by performing a standard freight scan. The pilot's bravado will be reported as a subtitle at the bottom of your HUD.
  • German translation available, thanks to ThalonMook. French translation available, thanks to Emerson d'Anite.
  • For those who are interested, the formula for calculating the probability of bailing and the hull percent at which the pilot bails:
    SpoilerShow
    100 * factor^2 / (factor^2 + bravado)

    Where: "factor" is bail rate or bail hull factor in the menu; "bravado" is fight skill + aggression + morale.

    The same formula is used twice, once for probability of bailing, and again for hull percent at which the pilot bails at.
Changelog:
v1.7.8:
- Added: Khaak and Xenon modifiers.
- Fixed: Recon Drone bailing.
v1.7.7:
- Fixed: yet another debug log left in.
v1.7.6:
- Modified/fixed: handling fighters of bailed carriers.
- Fixed: missing entry in JSON text in French and German language files.
- Fixed: left some debug logging in.
v1.7.5:
- Added: French translation, thanks to Emerson d'Anite.
- Modified/fixed: additional big ship astronauts of pirate ships will now have a proper name.
- Fixed: infinite loop bug calculating wares where wares could be negative.
]v1.7.4:
- Fixed: issue with waits in signal script causing premature termination.
v1.7.3:
- Added/modified: more (higher) selections for bail hull and rate factors.
- Added/modified: zero/negative destruct timeout means infinite.
v1.7.2:
- Added: German tranlation, thanks to ThalonMook.
v1.7.1:
- Modified/fixed: another effort to reduce NPC ships going red on claim.
v1.7:
- Modified: new menu system.
- Modified: bail rate and hull damage required use separate, configurable, factor.
- Modified/fixed: equipment damage formula for tradeable items didn't work as intended.
- Modified/fixed: added back bravado scanner, with option to disable in config menu.
v1.6.4:
- Fixed: added exceptions to stop various drones from bailing.
- Fixed: added exception to stop Khaak/Xenon big ships from ejecting crew.
v1.6.3:
- Fixed: owned/docked ships of bailed carriers will undock and stay that way.
- Modified: allowed Orbital Weapon Platforms to be captured.
v1.6.2:
- Fixed: attempted relations fix to stop ships turning enemy upon claiming.
v1.6.1:
- Fixed: ReadText with "Extra" equipment damage option.
v1.6:
- Added: option to stop non-standard ships from bailing.
- Modified: increased wait time until explode to 6 hours (= 36 mins on SETA x10).
v1.5:
- Fixed: 2 hour unclaimed explode wasn't working.
- Fixed: stopped fighter drones and UFOs bailing.
- Modified: default bail rate lowered to 60%.
- Modified: better handling of Extra equipment option.
v1.4:
- Added: big and huge ship bailing with seperate bail rate setting.
- Modifed: configuration menu layout and extra options.
v1.3:
- Fixed: updated to use latest version of Community Configuration Menu.
- Fixed: "Extra" equipment option now works.
- Modified: removed hotkey option.
v1.2:
- Added: more bail rate percentage options.
- Added: "Extra" option for equipment remaining on ship after bail.
- Added: ships will explode after spending 2 hours unclaimed.
- Modified: bail rate now has much higher disparity between the settings.
v1.1
- Added: Bioscanner scan signal and hotkey to scan ship pilots for bravado (chance of bailing), and report using subtitle .
- Modified: config menu now highlights currently selected option.
- Modified: ship bailing rules modified to use non-linear function and some randomness.
- Modified: attempted fix for some ships not being claimable.
v1.0:
- Initial release.
Last edited by ThisIsHarsh on Mon, 18. Oct 10, 22:56, edited 57 times in total.

User avatar
Graxster
Posts: 814
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 25. Oct 08, 09:00

Sounds awesome! Question: Your description says "pilots of small craft". Exactly what craft? Is it just small fighter craft, or does it include Freighters? IMO, Freighter pilots being attacked by Pirates or Xenon should be the ones who bail most, after all, they're not Military pilots, just merchants.

-G

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 09:05

Since X3TC has Marines for capturing large ships, this plugin only affects small ships (fighters and freighters).
Freighter pilots will indeed bail more often as their morale, etc is often extremely low (that's what happens with prohibition).

User avatar
Graxster
Posts: 814
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 25. Oct 08, 09:47

First observations: Looks like it works great! I would suggest (and hope for, hehe) an addition that adds random equipment to the ship. The game's "Force Pilot Eject" removes all shields and upgrades IIRC (and it looks that way so far). The "normal" bailing that comes with the game leaves you random upgrades/shields. Would be nice to see the same here.

I would think you could (for example), have a random % chance that shields will be in cargo, then use <RetVar/If> get max shield type that can be installed, <>get number of shield bays, etc... then maybe a random chance at what shield(s) you might get (ie: a 5mj shield in a ship that can take 25mj shields). Then a random to install cargo bay extensions, rudder, and speed upgrades. Ditto with extensions, though I would set a fairly low max number on this one (like anywhere from 1 to 5). Gives you an opportunity to be disappointed when there's no shields, and jump for joy when you get 2 - 25mj shields, hehe. Oh, and ditto for weapons, especially in fighter craft (love the High Energy Plasma Throwers!).

I know that's alot to ask... what do you think? It's 4 AM, maybe I'm just rambling. :D

-Grax

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 10:02

Graxster wrote:First observations: Looks like it works great! I would suggest (and hope for, hehe) an addition that adds random equipment to the ship. The game's "Force Pilot Eject" removes all shields and upgrades IIRC (and it looks that way so far). The "normal" bailing that comes with the game leaves you random upgrades/shields. Would be nice to see the same here.

I would think you could (for example), have a random % chance that shields will be in cargo, then use <RetVar/If> get max shield type that can be installed, <>get number of shield bays, etc... then maybe a random chance at what shield(s) you might get (ie: a 5mj shield in a ship that can take 25mj shields). Then a random to install cargo bay extensions, rudder, and speed upgrades. Ditto with extensions, though I would set a fairly low max number on this one (like anywhere from 1 to 5). Gives you an opportunity to be disappointed when there's no shields, and jump for joy when you get 2 - 25mj shields, hehe. Oh, and ditto for weapons, especially in fighter craft (love the High Energy Plasma Throwers!).

I know that's alot to ask... what do you think? It's 4 AM, maybe I'm just rambling. :D

-Grax
Hmm, I will have to do a little more testing, but I thought the abandoned ship is left with the same equipment as if you caused the bail yourself (which is pretty crap in general). I know NPC ships are better equipped as your ranks increase, so maybe that's a factor in how much equipment is left over.

Saying this, I will consider adding an option to increase the amount of equipment left onboard.

Keep 'em coming!

lepidosteus
Posts: 34
Joined: Fri, 28. Jul 06, 15:47

Post by lepidosteus » Sat, 25. Oct 08, 10:16

People will vary greatly on what they think is a fair bail rate.
I don't know how the scripting works in the game, but I guess the best way to solve this wouldn't be to release 50 tweaked versions of the script but rather to give an option allowing to increase/decrease the % of bails.

How often would you say they bail right now ?

I'm very interested in this script since this is such a great gameplay improvement but I'm afraid it would be too high like "half of the ship bails" which would ruin it because I wouldn't be able to stop myself from selling all these ships :roll:

wolfmanjack321
Posts: 36
Joined: Wed, 30. Apr 08, 02:56
x3

Post by wolfmanjack321 » Sat, 25. Oct 08, 10:17

however you do it thanks :)

Been waiting for this

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 10:21

lepidosteus wrote:I don't know how the scripting works in the game, but I guess the best way to solve this wouldn't be to release 50 tweaked versions of the script but rather to give an option allowing to increase/decrease the % of bails.
Use the "Community Configuration Menu" to configure the bail rate.
There is already a % option, the default is 100%, the maximum. You can reduce it in steps of 20% down to a minimum of 20%. Have a play around and let me know which is the best option and if the options are comprehensive enough.

At 100% I would say almost all ships bail, with varying degrees of hull damage.

lepidosteus
Posts: 34
Joined: Fri, 28. Jul 06, 15:47

Post by lepidosteus » Sat, 25. Oct 08, 10:32

Great ! Sorry for misreading, I didn't see it first time.

May I suggest another option to allow the activation of bails for M6+ ships too ? That's not something I will use in my game, but I can see why some people would like to have that - including me one day.
If you do that, I think it would also call for either a 3rd option controlling M6+ bails rate, or a static (big) malus to it.

And if not, well, it's already great as-is !

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 10:32

My thinking on this script was that 'brave' pilots would wait until most of their hull was destroyed before ejecting. Really brave pilots would fight to the death.

(EDIT: Formula previously posted here is no longer valid)
Last edited by ThisIsHarsh on Sun, 26. Oct 08, 16:53, edited 3 times in total.

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 10:36

lepidosteus wrote:Great ! Sorry for misreading, I didn't see it first time.

May I suggest another option to allow the activation of bails for M6+ ships too ? That's not something I will use in my game, but I can see why some people would like to have that - including me one day.
If you do that, I think it would also call for either a 3rd option controlling M6+ bails rate, or a static (big) malus to it.

And if not, well, it's already great as-is !
Yeah, thing is there is the whole Marine boarding parties in X3TC now, which can be done with NPCs. So (to me at least) M6s bailing would seem like less of a fix and more like a cheat. However, if enough people want an option for big ship bailing I will consider it.

lepidosteus
Posts: 34
Joined: Fri, 28. Jul 06, 15:47

Post by lepidosteus » Sat, 25. Oct 08, 10:41

In 25+ hours in an heavy military game (almost no trade, engage in a lot of patrol, attacks, etc ...) I've never seen NPC boarding one of their opponents' ships, I actually didn't even know it could happen in the game.

I guess I've not looked well enough.

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 10:44

lepidosteus wrote:In 25+ hours in an heavy military game (almost no trade, engage in a lot of patrol, attacks, etc ...) I've never seen NPC boarding one of their opponents' ships, I actually didn't even know it could happen in the game.

I guess I've not looked well enough.
Hmm NPC vs. Player boarding parties are hinted at in the manual, but I'm not far enough to know if it actually ever happens, let alone NPC vs. NPC.

One thing I ultimately want to do is add NPC salvager ships to compete with. It seems unrealistic the player is the only salvager in the galaxy, given the money to be made. I suppose something similar will have to be done with boarding parties, but that's a much much more complex problem.

lepidosteus
Posts: 34
Joined: Fri, 28. Jul 06, 15:47

Post by lepidosteus » Sat, 25. Oct 08, 11:27

As long as I'm spamming your topic: if you have time, it would be nice to add some way to know which bail rate is active.

ThisIsHarsh
Posts: 1132
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 25. Oct 08, 11:58

lepidosteus wrote:As long as I'm spamming your topic: if you have time, it would be nice to add some way to know which bail rate is active.
OK good point and fairly simple to add. I'll change the bail rate options menu to highlight which option is currently active.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”