Weird doubling bonus
Moderators: winston, another_commander, Getafix
-
- ---- E L I T E ----
- Posts: 1248
- Joined: Sat Sep 12, 2009 11:58 pm
- Location: Essex (mainly industrial and occasionally anarchic)
Weird doubling bonus
Dear all
I've got oolite-trunk-1.75.4.4607-dev.win32 and armoury.oxp 1.08. And I can report than when I launch a combat drone, I get two! And when I launch thargon fighters, I get ten!
I've got oolite-trunk-1.75.4.4607-dev.win32 and armoury.oxp 1.08. And I can report than when I launch a combat drone, I get two! And when I launch thargon fighters, I get ten!
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Weird doubling bonus
Does the same happen with v1.75.3?
Re: Weird doubling bonus
Confirmed the combat drone - in 1.75.4.4607 you get two per launch.
On 1.75.3 you get only one.
On 1.75.3 you get only one.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: Weird doubling bonus
OK, it seems that the this.shipDied handler in drones_Launcher.js is firing twice. I guess we can go through the changelogs since 1.75.3 (should not be that many) and try to pinpoint the exact revision where this started happening.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Weird doubling bonus
It is not a bug in Ooltite but an oxp that tries to fix a bug himself. It is the drone launcher AI
When the mine now explodes itself it sends a "shipDied". But on top of that, the AI also sends a script message for "shipDied".
Missiles not receiving a
Code: Select all
UPDATE = (becomeExplosion, "sendScriptMessage: shipDied");
Missiles not receiving a
shipDied
event was fixed after 1.75.3UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Weird doubling bonus
OK - I'll make a second version of the OXP available later fixing it for use with trunk (there may be other AIs that have that in them too, for the same reason).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Weird doubling bonus
I must say that some of my missiles also did send a
shipDied
by scriptMessage to compensate for the bug, but I always made sure the handler deleted itself on use, to avoid double triggering in case it would start working as it should.UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Weird doubling bonus
Hmm, indeed a more elegant solution. I'll update later to implement that into the OXP (and any others that have that bugfix built-in).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
-
- ---- E L I T E ----
- Posts: 1248
- Joined: Sat Sep 12, 2009 11:58 pm
- Location: Essex (mainly industrial and occasionally anarchic)
Re: Weird doubling bonus
Dear all
Hey, you are (as they say) all over this one! Thanks. But I am confused by the technicalities, which may matter because I wonder whether I should adjust my own missile OXP ('nexus' oxp, which involves submunitions). Do I need to add some 'shipdied' code (or something), please?
Thanks.
Hey, you are (as they say) all over this one! Thanks. But I am confused by the technicalities, which may matter because I wonder whether I should adjust my own missile OXP ('nexus' oxp, which involves submunitions). Do I need to add some 'shipdied' code (or something), please?
Thanks.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Weird doubling bonus
When you want to fix it yourself you must find the shipscript and look for the partUK_Eliter wrote:Do I need to add some 'shipdied' code (or something), please?
Code: Select all
this.shipDied = function ()
{
.....
code
....
}
Code: Select all
this.shipDied = function ()
{
.....
code
....
delete this.shipDied;
}
However, when your missile script has no shipDied() event in the first place you don't need to worry at all. Problem was that missiles used the death_actions until 1.71. After that this was broken since 1.72 and apparently nobody cared to repair it in oolite (#). Or it was forgotten because there was no official bug report about it on Berlios. In trunk it now works again, but oxps that bypassed this bug might suffer problems now, that are easy to fix in a way that makes them compatible with all oolite versions.
#) That includes me as I thought it is easy to deal with by script. Only after there was a new report about this bug I did fix it to make it consistent with normal ships.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
-
- ---- E L I T E ----
- Posts: 1248
- Joined: Sat Sep 12, 2009 11:58 pm
- Location: Essex (mainly industrial and occasionally anarchic)
Re: Weird doubling bonus
Eric: marvellous explanation. Thanks. As they say in Germany: all ist klar.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Weird doubling bonus
Thanks. I just remembered that shipDied() could trigger before the bugfix when the missile was destroyed by collision, was shot down by laser or was shot down by a second missile. That did happen sometime, so a script already had to be prepared for a shipDied() event that could sometimes trigger.UK_Eliter wrote:Eric: marvellous explanation. Thanks.
I am just amazed how many german speaking members we have. My sister and her boyfriend moved this spring from Ireland to the south of Germany. He did not speak german and was surprised how few of the locals could understand english. In Holland almost everybody understands english enough to speak with.UK_Eliter wrote:As they say in Germany: all ist klar.
But this board gives a wrong impression of the real live situation, as every german member here speaks english.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Weird doubling bonus
OK, version 1.09 of Armoury uploaded with the scripting fixed in 3 places (probe missile also suffers from the same issue in 1.76).
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link