[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: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by Scoob »

Hi,

I've used this for ages with TC, usually with things turned down to a minimum so bails are rare and a nice surprise.

I'm currently using it with X3:AP and I don't think it's working. Despite turning the bail chance and hull level up quite high (5 & 5, usually 1 & 1 for me) the ONLY ships I've found that have bailed without my help are Argon Discos. Really, I find at least one of these in every sector where there's been a fight.

I do often see bunches of Astronauts that have evidently bailed from a ship, however there's never a ship!

I recall that ages ago I used NPC Bailing in TC along with LV's Race Response Fleets and RRF ships NEVER bailed. I'm assuming that's what's happening here, as RRF is part of X3:AP, however it's not just military ships that aren't bailing.

It's no big deal, just that I liked having the very slim chance of encountering a bailed ships I had to "rescue" :)

Edit: Ok, after much testing and near prooving it to myself that NPC bailing wasn't working. Not five minutes after posting I get an M2 Boreas bailing OOS. I was deliberately monitoring ALL sectors and I'd not had a peep of anything bailing prior to that - just astronauts. Guess it IS working after all, though the bail rate is MUCH lower than for the same settings in TC.

Thought: Possibly RRF adjusts NPC pilot settings making them less likely to bail - I think NPC Bailing uses certain pilot settings that control agression etc. not 100% sure though.


Scoob.
User avatar
Retrox
Posts: 370
Joined: Thu, 9. Nov 06, 14:59
x4

Post by Retrox »

When I used this script in AP, there are some bailed ships available - if you put the destroy timer under 2^5 with 2^6 (or was it 2^7) the ships are destroyed immediately (maybe thats the cause of your Astronauts). Another reason may be that the NPC-ships are overkilling the bailed ones (need verification). How do you claim the big ships in AP? I know that Cycrows non-cheat-claimscript does'nt work anymore.
Intel i7 8700, Gtx 1070, 16gb RAM. I think i'm ready for X4. Bring it on, Egosoft! [edit 2025: this signature didnt age well :lol: ]
Scoob
Posts: 11184
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob »

Hi,

I use this script to claim stuff - and a load of other stuff besides. Good script :)

Note: this script can also spawn random freebie ships, as well as generating a handful instantly after it's installed.

Scoob.
mrscribbler
Posts: 172
Joined: Thu, 13. Sep 07, 15:30
x3tc

Post by mrscribbler »

InFlamesForEver wrote:I have fixed the issue, it seems that setting the self destruct time to max causes it to kill them instantly.

Kinda strange really.
It's a programming thing. Depending on whether it's signed or not, the last bit in an integer flips the sign. So if you have a 32-bit integer (0 to 4,294,967,295), 31 bits (0 to 2,147,483,647) are used for the number, and 1 bit is used for the sign (1000 0000 0000 0000 0000 0000 0000 0000 = -2,147,483,647).

But the standard C input assumes the programmer will figure out what they want and program for it, so it doesn't make a distinction and simply codes a high number like 4,294,967,295 to (1111 1111 1111 1111 1111 1111 1111 1111), which is then interpreted as -1. All this means is that any sufficiently high number will roll-over to a negative number.

The problem is compounded by the fact that the input field is in minutes but the timer is in seconds. That means any number you use is going to be multiplied by 60, so your 54 million is going to be multiplied to 3 billion, or negative 1 billion or so.

And that's why making the number too high will cause the ships to explode.

Regardless, it's not a game-breaking problem (in this instance). I usually go with 9898 minutes, which equals to ~165 hours; if I don't bother getting it in 6.8 days of game time, I'm probably not going to. But any number below 35,791,393 should be safe (can't test this as I don't currently have it installed).
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

mrscribbler wrote:
InFlamesForEver wrote:I have fixed the issue, it seems that setting the self destruct time to max causes it to kill them instantly.

Kinda strange really.
It's a programming thing. Depending on whether it's signed or not, the last bit in an integer flips the sign. So if you have a 32-bit integer (0 to 4,294,967,295), 31 bits (0 to 2,147,483,647) are used for the number, and 1 bit is used for the sign (1000 0000 0000 0000 0000 0000 0000 0000 = -2,147,483,647).

But the standard C input assumes the programmer will figure out what they want and program for it, so it doesn't make a distinction and simply codes a high number like 4,294,967,295 to (1111 1111 1111 1111 1111 1111 1111 1111), which is then interpreted as -1. All this means is that any sufficiently high number will roll-over to a negative number.

The problem is compounded by the fact that the input field is in minutes but the timer is in seconds. That means any number you use is going to be multiplied by 60, so your 54 million is going to be multiplied to 3 billion, or negative 1 billion or so.

And that's why making the number too high will cause the ships to explode.

Regardless, it's not a game-breaking problem (in this instance). I usually go with 9898 minutes, which equals to ~165 hours; if I don't bother getting it in 6.8 days of game time, I'm probably not going to. But any number below 35,791,393 should be safe (can't test this as I don't currently have it installed).
Thanks, god I hate binary sometimes, its bad enough in my computing exams lol
In Flames We Trust
Listening to Whitechapel soothes the soul!! :D     ¹ ¤ ¹      But, the nuns are watching...
Samuel Creshal wrote:Keyboards: What separates the men from the boys.
XRM Trailer - XRM Installation Guide Video
mrscribbler
Posts: 172
Joined: Thu, 13. Sep 07, 15:30
x3tc

Post by mrscribbler »

InFlamesForEver wrote:Thanks, god I hate binary sometimes, its bad enough in my computing exams lol
Yeah, but it's a programming failure on Egosoft's part that we even end up talking about it. You don't need to store data in a single integer, even in basic C, and the game should be using a standardized string class (copy, paste, etc.) for handling and normalizing/formatting all inputs.

I imagine, and most certainly hope, this is one of those things that Egosoft will have addressed in Rebirth.
i64man
Posts: 451
Joined: Sun, 7. Nov 10, 18:27
x3tc

Post by i64man »

has anyone here try this mod with AP? I can't get it to work even do, I have all the other requied and recommended scripts.
User avatar
Yacek
Posts: 3157
Joined: Wed, 18. Jul 07, 11:44
x3tc

Post by Yacek »

i64man wrote:has anyone here try this mod with AP? I can't get it to work even do, I have all the other requied and recommended scripts.
For me it works very well.
X3:AP 3.1+XRM 1.30d+MSP 1.7+LoCo 2.01+IR 2.0
Zapraszamy wszystkich chętnych na forum XUDB, gdzie znajdziesz FAQ, opisy skryptów, modów i fabuł, oraz Mamut HQ.
[ external image ]
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

i64man wrote:has anyone here try this mod with AP? I can't get it to work even do, I have all the other requied and recommended scripts.
Works perfectly for me in AP.
In Flames We Trust
Listening to Whitechapel soothes the soul!! :D     ¹ ¤ ¹      But, the nuns are watching...
Samuel Creshal wrote:Keyboards: What separates the men from the boys.
XRM Trailer - XRM Installation Guide Video
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

doesn't work fully in my game, its work after install with the standard settings but plugin menu does not display right...
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
User avatar
Yacek
Posts: 3157
Joined: Wed, 18. Jul 07, 11:44
x3tc

Post by Yacek »

garrry34 wrote:doesn't work fully in my game, its work after install with the standard settings but plugin menu does not display right...
Required: JSON parser library v1.1 (thread)
X3:AP 3.1+XRM 1.30d+MSP 1.7+LoCo 2.01+IR 2.0
Zapraszamy wszystkich chętnych na forum XUDB, gdzie znajdziesz FAQ, opisy skryptów, modów i fabuł, oraz Mamut HQ.
[ external image ]
garrry34
Posts: 911
Joined: Sun, 17. Jul 05, 14:43
x3tc

Post by garrry34 »

balls, I'm an aegit, I installed it from my HDD without reading the OP for the thread lol
PhenomII X4 940 black edition
8GB DDR2
ATI HD4890
Windows 7 64bit
JDCollie
Posts: 218
Joined: Sun, 18. Dec 11, 12:34
x3tc

Post by JDCollie »

I installed the plugin manager, JSON, and the bailing script itself, but when I go into AP, it shows Artificial Life settings as greyed out. Help?
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

JDCollie wrote:I installed the plugin manager, JSON, and the bailing script itself, but when I go into AP, it shows Artificial Life settings as greyed out. Help?
You need to use Cryows Community Plugin Configuration I think.
In Flames We Trust
Listening to Whitechapel soothes the soul!! :D     ¹ ¤ ¹      But, the nuns are watching...
Samuel Creshal wrote:Keyboards: What separates the men from the boys.
XRM Trailer - XRM Installation Guide Video
Wilson-MG-
Posts: 73
Joined: Sat, 7. Aug 10, 07:47
x4

Post by Wilson-MG- »

InFlamesForEver wrote:
JDCollie wrote:I installed the plugin manager, JSON, and the bailing script itself, but when I go into AP, it shows Artificial Life settings as greyed out. Help?
You need to use Cryows Community Plugin Configuration I think.
I'm using all of these, but I don't see the AL option either.
karabAs
Posts: 98
Joined: Sun, 7. Dec 03, 01:58
x3tc

Post by karabAs »

Wilson-MG- wrote:
InFlamesForEver wrote:
JDCollie wrote:I installed the plugin manager, JSON, and the bailing script itself, but when I go into AP, it shows Artificial Life settings as greyed out. Help?
You need to use Cryows Community Plugin Configuration I think.
I'm using all of these, but I don't see the AL option either.
Use Community Plugin Configuration in-game (by hotkey), not AL settings...
Wilson-MG-
Posts: 73
Joined: Sat, 7. Aug 10, 07:47
x4

Post by Wilson-MG- »

Thanks. To be honest, I couldn't remember where it was it's been over a year since I played last, but at first glance I wasn't seeing it. I'll try again.
JDCollie
Posts: 218
Joined: Sun, 18. Dec 11, 12:34
x3tc

Post by JDCollie »

I have Cryow's installed as per the instructions, and I can't find a hot-key in the controls... :(
Wilson-MG-
Posts: 73
Joined: Sat, 7. Aug 10, 07:47
x4

Post by Wilson-MG- »

Just as karabAs stated, the hotkey is actually the Plugin Configuration hotkey. Once you bind and press that you'll see the options to configure NPC Bailing. It's working great for me in AP and I'm already scoring some nice ships to boost my reputation (with Salvage Command Suite 4.06) and my credits without feeling like I've cheated.
JDCollie
Posts: 218
Joined: Sun, 18. Dec 11, 12:34
x3tc

Post by JDCollie »

Wilson-MG- wrote:Just as karabAs stated, the hotkey is actually the Plugin Configuration hotkey. Once you bind and press that you'll see the options to configure NPC Bailing. It's working great for me in AP and I'm already scoring some nice ships to boost my reputation (with Salvage Command Suite 4.06) and my credits without feeling like I've cheated.

I should have been more specific. Until KarabAs's post, I was unaware that there was a hotkey. My post was stating that I could not find the hotkey in the menus in order to configure it.

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