[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

djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

since problem is definitelly caused by signal I'd search in this direction

I'd check also other signals. Maybe other signal is being sent (besides signal)captured) ?

for example {SIGNAL_RESPONDTOHELPREQUEST} is known to be active even after changed ownership. Maybe ships being captured sends also other one? since you are disabling race logic before bailing, maybe they work in some different way then (maybe race logic disables those signals during bailing procedure?)

I have never before had such reports, so it is clear for me that changed bailing procedure is causing trouble

AFAIK before it was

disable race logic
eject pilot
change race to neutral

and currently

disable logic
eject pilot
enable logic

so either process of changing race by script (not relying on automatic ownership change) is reason of changed behaviour, or doing it with disabled logic
Last edited by djrygar on Thu, 9. Sep 10, 21:36, edited 1 time in total.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

djrygar wrote:strange thing is that guardians have race logic disabled

and race logic enabled ships (jobs spawned military etc) do not react to bailing, just those with disabled logic
Waaait a second. I just remembered something I saw in !fight.attack.object. There is a line:

Code: Select all

  skip if not [THIS]->can be controlled by race logic
    [THIS]->set relations from notoriety: include player as target and race > teladi as owner=[FALSE]
So if race logic control is disabled, the relations will not be set back. Though a bit weird that this doesn't apply to player owned ships (race > teladi as owner=[FALSE]). In fact it's probably nothing, but your post made me wonder.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

djrygar wrote:since problem is definitelly caused by signal I'd search in this direction

I'd check also other signals. Maybe other signal is being sent (besides signal)captured) ?

for example {SIGNAL_RESPONDTOHELPREQUEST} is known to be active even after changed ownership. Maybe ships being captured sends also other one? since you are disabling race logic before bailing, maybe they work in some different way then (maybe race logic disables those signals during bailing procedure?)
AFAIK, there are no signals sent when a ship is claimed, only when it initially bails. But I'll look into SIGNAL_RESPONDTOHELPREQUEST, just in case.

djrygar wrote:I have never before had such reports, so it is clear for me that changed bailing procedure is causing trouble

AFAIK before it was

disable race logic
eject pilot
change race to neutral

and currently

disable logic
eject pilot
enable logic

so either process of changing race by script (not relying on automatic ownership change) is reason of changed behaviour, or doing it with disabled logic
Nah, the logic before was simply "eject pilot", I never messed with race logic (in fact if you disable race logic you can't claim the ship by the standard context menu). I never changed race to neutral, the "pilot eject from ship" command does that automatically.

I added the disable/enable logic lines in an effort to fix this bug. What appears to have happened instead is that I disable logic when it was already disabled, thus no effect, then enable it. So now you can claim the ship properly without 3rd party scripts, but it sounds like other ships can also then turn on it.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

yes, but before you were enabling it BEFORE bailing, now you are disabling it

so there is difference.

difference is that now it always bails with disabled logic.

and I had never heard about such problems (at least noone mentioned it in IR thread)

so it clearly makes things worse than better (or imaybe it fixes old problems, but creates new ones, that just look similar?)
Last edited by djrygar on Thu, 9. Sep 10, 21:51, edited 1 time in total.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Hmm OK, got a little theory developing.

In !fight.attack.object.std there is:

Code: Select all

[THIS]->set relation against $victim to {Foe}
at the beginning, then at the end is:

Code: Select all

skip if not [THIS]->can be controlled by race logic
  [THIS]->set relations from notoriety: include player as target and race > teladi as owner=[FALSE]
OK. So if race logic is enabled, then $victim remains a Foe for this ship. Under normal circumstances $victim would be dead or have left the sector before the script terminates.

My theory is that the engine has some special handling for bailed/neutral ships when it comes to the "is $victim a enemy" command, which reverts back to the ship's own friend/foe settings when the ship is claimed.

When $victim is claimed, the old Friend/Foe setting takes precedence again and $victim becomes an enemy once more.

Does that sound like it fits the pattern?


EDIT: just in case, no harm in changing back the race logic setting...
Last edited by ThisIsHarsh on Thu, 9. Sep 10, 22:02, edited 1 time in total.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Update v1.7.1

:arrow: Reverted some code layout and done a little tidying, mainly in an effort to reduce the NPC ships going red when claiming a nearby ship bug.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
Sunrayn
Posts: 85
Joined: Tue, 14. Oct 08, 00:59

Post by Sunrayn »

Tried out the new version. Found a bailed ship sitting in the perfect location with 3 Guardians, sent in a remote salvager to claim it. Soon as it changed to green, the Guardians went red and destroyed it and attacked the claiming ship.

Of course, thinking ahead, I saved just a minute before issuing the order so I could revert and possibly see what script kicks in after claiming...

They should move the Save and Load button apart from each other....


Strangely, the Shipyard went red as it spit out another guardian after my salvager destroyed one of the guardians, after the Guardian launched, the station went back to blue.
djrygar
Posts: 1842
Joined: Mon, 10. Aug 09, 02:09
x3ap

Post by djrygar »

another interesting thing I noticed;

found bailed xenon L
it bailed while using 1.7 (not 1.7.1)

since I have enabled detailed info in script editor, after claiming I looked at its notoriety sheet

and it had all races (except obvious like xenon, enemy race etc) as neutral, despite fact I am not neutral with every race. So it did not updated its notoriety values after claiming to player values, but stayed as neutral.

but it may be just special case as this ship was generated by MD (from plot mission - but it was not any special ship, just some escort). Yet I will now pay attention to this
User avatar
ThalonMook
Posts: 1296
Joined: Tue, 3. Feb 04, 12:11
x4

Post by ThalonMook »

Hi,

I wana update the script form Ver 1.6.4 to 1.7.1.
Is there anything to attend ?

Also I need to translate the languagefile into german. Which entrys can I change in the locals section. I think the title and descritpion text but I'm not sure.

CU Thalon
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

ThalonMook wrote:Hi,

I wana update the script form Ver 1.6.4 to 1.7.1.
Is there anything to attend ?

Also I need to translate the languagefile into german. Which entrys can I change in the locals section. I think the title and descritpion text but I'm not sure.

CU Thalon
For updating the only thing to bear in mind is that you need the JSON parser installed now. Otherwise nothing special.

For the translation, yeah the title and description, plus the title entries for the various menu items. In general, any entry with the word "title" can be changed without breaking anything. Then of course the independent t-entires, e.g. the ON, OFF, Remove, etc, can be changed as normal.

One thing to bear in mind, don't use tabs in the JSON text, just spaces - the string reading functions of X3TC don't like tabs. Shouldn't be a problem, but thought I should mention it.

If you would be so kind as to let me have your translated xml, I will include it in the package, with credit of course.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
User avatar
ThalonMook
Posts: 1296
Joined: Tue, 3. Feb 04, 12:11
x4

Post by ThalonMook »

Thx for the fast response.

Ok I have translated the language file.

I will send you a PM with the download link.


CU Thalon
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

Update v1.7.2

:arrow: Added German translation. Thanks to ThalonMook for that.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
User avatar
ThalonMook
Posts: 1296
Joined: Tue, 3. Feb 04, 12:11
x4

Post by ThalonMook »

Hi,

one question.

In the config menue the I can set a time until the bailed ships will selfdestruct. What value I must set that the ships never get destroyed ?

Atm I set it to 9999 whats the limit ?

CU Thalon
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

ThalonMook wrote:Hi,

one question.

In the config menue the I can set a time until the bailed ships will selfdestruct. What value I must set that the ships never get destroyed ?

Atm I set it to 9999 whats the limit ?

CU Thalon
There is no maximum. That's a good point, though. I should make it so that zero means infinite time. But it's not like that now. You can set it to a few million if you want, which may as well be infinite.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
User avatar
Novia Star
Posts: 120
Joined: Fri, 8. Dec 06, 04:06
x3

Post by Novia Star »

I love this add-on I use it a lot but on a low setting no big ships balling and a more rare small ship bail rate like 30% I think.

Because I don't use the big ship bail I don't know but Do big ships Spew out a crew ammount In retro to ship size?
I allways thought the large ships needed a crew to make the thing go.
dougeye
Posts: 2409
Joined: Sat, 7. Mar 09, 18:29
x3tc

Post by dougeye »

hi ive updated to the latest version and am a bit confused as to wether the 2 3 4 5 6 etc scale is the same as 0% 2 100% and how the hull factor works. its set 2 5 as default but what does the 5 stand for?
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

I would appreciate more reports on what bail rate and hull factors people use, and whether they use NPC salvagers. It would be nice to set the defaults to something generally acceptable.

Novia Star wrote:I love this add-on I use it a lot but on a low setting no big ships balling and a more rare small ship bail rate like 30% I think.

Because I don't use the big ship bail I don't know but Do big ships Spew out a crew ammount In retro to ship size?
I allways thought the large ships needed a crew to make the thing go.
They should indeed spew out crew, the code is there. I remember it working in previous versions, but someone pointed out recently that it doesn't happen in the latest versions. I made a couple of minor edits to make sure they do, but to be honest I haven't tested this feature. Any reports on whether or not this feature is functioning would be most appreciated.

dougeye wrote:hi ive updated to the latest version and am a bit confused as to wether the 2 3 4 5 6 etc scale is the same as 0% 2 100% and how the hull factor works. its set 2 5 as default but what does the 5 stand for?
Yeah the factors are the same as the percentages in the previous version. I got rid of the percentage signs because people kept getting the wrong idea.

OK, here is the formula:
Spoiler
Show
factor^2 / (factor^2 + bravado)
The same formula is used for both probability of bailing and the hull damage at which the pilot bails at. The only difference is the factor that is used is different (i.e. bail rate factor and bail hull factor in the menu). Theoretically the bravado could be anywhere between 0 to 300, but in practice it is more like 20 to 90.
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.
dougeye
Posts: 2409
Joined: Sat, 7. Mar 09, 18:29
x3tc

Post by dougeye »

hmmm im experiencing significantly reduced bailing, take small ships for example at 80% (i no use 8 ) i would get a few n's and m's and l's in a defend sector mission bailing but now i only see mabye 1 in 50 bail and some even bail with hull of around 80% and the ship seems to auto explode.

the previous version i ran the mod with this setup...

equip damage - extra
non standard bailing - on
small ships 80%
big ships 50%
huge ships 20%

i found this too be very balanced imo. huge ships are not realy realistic considering the boarding mechanic but as boarding is so frustrating your mod alot of the time is more viable.
dougeye
Posts: 2409
Joined: Sat, 7. Mar 09, 18:29
x3tc

Post by dougeye »

p.s do you still have a link to the last version?
ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh »

EDIT: noticed in your post you already have non-standard ship bailing on. I'll try and investigate further. EDIT2: done a bit of testing spawning ships and they appear to bail normally. I'll have to play for a while and see if I notice anything.

As for exploding, I'll check that out, I think I may have seen that happen myself, but thought it was unrelated. EDIT2: OK, looks like the explosions I saw were indeed unrelated to this plugin. Not sure on this one, then.

The previous version can be found here, though it's a pretty bad sign if people start reverting to the older version!
There are 10 types of people in the S&M forums - those who understand binary, and those who don't.

Black holes are where God divided by zero.

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