Page 1 of 2

[Updated Release] Turret Toggler 1.1

Posted: Sun Dec 02, 2012 1:21 am
by Solonar
Since the introduction of the semi AI plasma turret technology, the mounting of such plasma turrets has become increasingly popular. No longer are they exclusive domain of carriers, frigates and similar large craft. The technology has been miniaturized in so much that even fighter class craft have been fitted with these plasma turrets. But something seemed missing, something so simple that it was surprising it was overlooked. It was the uncontrollable and unsafe nature of the these plasma turrets being always on all the time. This has lead to numerous friendly fire incidents resulting in destruction of property, loss of life and otherwise innocent commanders being tagged fugitives because of a design flaw in the implementation of this plasma turret technology.

But no more!

Solonar of Esceso, having spotted this seeming oversight early on, devoted his time and resources from his personal assets to develop a technology to improve the safety and controlability of the semi AI plasma turret technology. The first prototype of this device was installed and tested on a modified Fer de Lance 3G+, the Wayward, and seeing the possibilities of the application of so simple an innovation, he improved on the device until it was ready for final release. Thus was the founding of what has come to be known as SolarTech Industries. SolarTech, operating out of a refitted dodec station in Esceso space, now holds the GalCop patent for the Plasma Turret Regulator Device Apparatus, otherwise known as the Turret Toggler, is the sole producer of the Turret Toggler and at the time of this printing is dedicated only to producing the Turret Toggler.

I acknowledge Thargoid as this script is a modified version of his Vortex turret toggle script.


Turret Toggler 1.1

Re: [Test Release] Universal Turret Switcher

Posted: Sun Dec 02, 2012 4:39 am
by Solonar
Updated to version 0.02. Added docking event handler scripts to correct maintenance offers for missing sub-entities.


Universal Turret Switcher 0.02

Re: [Test Release] Universal Turret Switcher

Posted: Sun Dec 02, 2012 5:02 am
by Rese249er
A note to be made: using this switcher also resets the turret's rate of fire and (I'm guessing) firepower to some default value.

Re: [Release] Universal Turret Switcher 1.0

Posted: Wed Dec 05, 2012 1:51 am
by Solonar
Updated to 1.0 - Final release, corrected some typos, works as advertised.


The switcher works as advertised and should be practically usable on most ships using turrets. I do not know how to view changes to turret strength of fire or rate of fire and so I cannot verify if the switcher alters these settings. It seems to be ok with the ships I tested: Fer-de-Lance 3G+(t), Dark Rainbow and Takina CX1. These tests were done using 1.76.1 alpha release.

Universal Turret Switcher 1.0

Re: [Release] Universal Turret Switcher 1.0

Posted: Wed Dec 12, 2012 4:07 am
by UK_Eliter
This is a good idea! Downloading!

EDIT: might I suggest 'turret toggler' for the OXP's name? That name has these advantages: (1) alliteration; (2) it carries slightly less than does 'turret switcher' the false connotation that one can use the OXP to switch between turrets. (You yourself have the following text, already, in the ReadMe: 'Once installed this becomes a primable piece of equipment that toggles on and off the ship's turrets. )

Re: [Release] Turret Toggler 1.0

Posted: Wed Dec 12, 2012 5:57 am
by Solonar
My thanks for the compliment and also for the name suggestion. I rather like the sound of that.

Turret Toggler 1.0 - Cosmetic name change only. All other functioning remains unchanged. Link to the renamed Turret Toggler found in the original post.

Re: [Release] Turret Toggler 1.0

Posted: Thu Jan 31, 2013 11:41 pm
by Solonar
Updated to version 1.1: Made the equipment removable through the ship outfitter. Raised tech level and price to fit into the grand scheme of the Ooniverse.

Link found in the original post.

Re: [Updated Release] Turret Toggler 1.1

Posted: Thu Jan 31, 2013 11:48 pm
by GGShinobi
Hey, this is cool! 8) But why is this not on the [wiki]OXP List[/wiki] :-(
Mind if I add it?

EDIT:
I just tested it and had a look at your source code, and I've got a few suggestions ( :!: ):
:!: In order to prevent that all subentities get automagically repaired when toggling the guns on/off, you could check if a subentity is a turret or not and only activate / deactivate the subentity if that is the case. This could be done for example by checking if it's string-representation contains the string "turret", and perhaps there is even a better way that I don't know of. I made a quick check by adding the following line to your this.turretToggle = function():

Code: Select all

    for(subCounter = player.ship.subEntities.length - 1;subCounter>=0;subCounter--)
      { log("Turret Toggler", "found subentity: " + player.ship.subEntities[subCounter]);
        player.ship.subEntities[subCounter].remove(); }
    }
which lead to the following output in my logfile (my test-ship is a Falcon-S)

Code: Select all

01:13:13.851 [Turret Toggler]: found subentity: [Ship "bweed-falcon-gun" position: (0, 0, 0) (subentity)]
01:13:29.537 [Turret Toggler]: found subentity: [Ship "bweed-falcon-turret" position: (0, -6, -9.5) (turret)]
01:13:29.537 [Turret Toggler]: found subentity: [Ship "bweed-falcon-turret" position: (0, 6.5, -9.5) (turret)]
01:13:29.537 [Turret Toggler]: found subentity: [Ship "bweed-falcon-scoop" position: (0, 0, 0) (subentity)]
01:13:29.538 [Turret Toggler]: found subentity: [Ship "bweed-falcon-vents" position: (0, 0, 0) (subentity)]
01:13:29.538 [Turret Toggler]: found subentity: [Ship "bweed-falcon-dish" position: (0, 0, 0) (subentity)]
01:13:29.538 [Turret Toggler]: found subentity: [Ship "bweed-falcon-gun" position: (0, 0, 0) (subentity)]
01:13:29.538 [Turret Toggler]: found subentity: [Ship "bweed-falcon-airlock-r" position: (0, 0, 0) (subentity)]
01:13:29.539 [Turret Toggler]: found subentity: [Ship "bweed-falcon-airlock-l" position: (0, 0, 0) (subentity)]
:!: You could even check if the turret is already destroyed and skip it if so. I really like the possibility to toggle the turrets on/off, but in my opinion it would be cooler without these side effects :)

Apart from that, very nice work, and excellent idea! 8)

Re: [Updated Release] Turret Toggler 1.1

Posted: Fri Feb 01, 2013 2:03 am
by Solonar
Thank you! And thank you for your suggestions. I will try them out later when I have some more time to spare. I also thank you for your offer to add this to the OXP list, but I have already done that earlier today.

Re: [Updated Release] Turret Toggler 1.1

Posted: Fri Feb 01, 2013 3:14 am
by GGShinobi
Solonar wrote:
I also thank you for your offer to add this to the OXP list, but I have already done that earlier today.
Whoops :oops: I should really get into the habit to refresh a page when I think that something is missing....
I even (at least once) made an edit to an older version because I did not refresh it first. :x *bashes his head*
Sorry!! And thanks again for that oxp! :P

Re: [Test Release] Universal Turret Switcher

Posted: Sat Feb 02, 2013 1:25 am
by UK_Eliter
Dear Solonar
Solonar wrote:
Updated to version 0.02. Added docking event handler scripts to correct maintenance offers for missing sub-entities.
I am curious about the following. Does the necessity for that addition owe to the bug - seemingly still present in 1.77 - that allows what are supposed to be non-frangible entities to get shot off, i.e. the problem that has meant that my Fer-de-Lance 3Gs have to have a script that repeatedly restores their turrets (when they have them)?

Re: [Test Release] Universal Turret Switcher

Posted: Sat Feb 02, 2013 1:44 am
by Solonar
UK_Eliter wrote:
Dear Solonar
Solonar wrote:
Updated to version 0.02. Added docking event handler scripts to correct maintenance offers for missing sub-entities.
I am curious about the following. Does the necessity for that addition owe to the bug - seemingly still present in 1.77 - that allows what are supposed to be non-frangible entities to get shot off, i.e. the problem that has meant that my Fer-de-Lance 3Gs have to have a script that repeatedly restores their turrets (when they have them)?

It is my understanding that any ships making use of frangible entities, including the plasma turrets, are frangible true by default. When using your Fer de Lance 3G+(t) for my prototype, and then later with a Dark Rainbow and a Takinia CX-1, I had to insert a frangible false line into their ship data plist. When I was using the Fer de Lance 3G+(t), I made it frangible false and removed your turret hack script entirely with no problems and the script no longer served a purpose.

The dock handler event was added later because when docking during a state of the Turret Toggler being off, i.e. the turret sub-entities being removed, I was prompted for the Maintenance Overhaul with the ship outfitter. It skewed if the ship was in genuine need of maintenance. If one docks with the turrets off, removed, the script restores them while docked to prevent the Maintenance Overhaul offer for missing sub-entities, and then removes them again on station depature as part of the script.

Re: [Test Release] Universal Turret Switcher

Posted: Sat Feb 02, 2013 3:28 am
by UK_Eliter
Solonar wrote:
When using your Fer de Lance 3G+(t) for my prototype, and then later with a Dark Rainbow and a Takinia CX-1, I had to insert a frangible false line into their ship data plist. When I was using the Fer de Lance 3G+(t), I made it frangible false and removed your turret hack script entirely with no problems and the script no longer served a purpose.
Thanks for the reply. But I think I have

Code: Select all

frangible = no;
in the relevant parts of my shipdata already; and yet, even in Oolite 1.77, the turrets can get shot off - as was/is, I recall, a documented bug.

PS: Takinia? I haven't heard of that - and searches don't seem to reveal it.

Re: [Updated Release] Turret Toggler 1.1

Posted: Sat Feb 02, 2013 3:36 am
by Solonar
Sorry, that was a typo. Takinia should read Takina and comes from the Koneko Industries v2 Beta 1 OXP.

I don't know anything about documented frangible bugs. The Fer de Lance 3G has the frangible no in it and the turrets never broke on me. I even removed your turret hack script because it was unnecessary. I did have to make the Takina frangible false though as it did not exist in the shipdata plist as distributed.

Re: [Test Release] Universal Turret Switcher

Posted: Sat Feb 02, 2013 3:14 pm
by Diziet Sma
UK_Eliter wrote:
Solonar wrote:
When using your Fer de Lance 3G+(t) for my prototype, and then later with a Dark Rainbow and a Takinia CX-1, I had to insert a frangible false line into their ship data plist. When I was using the Fer de Lance 3G+(t), I made it frangible false and removed your turret hack script entirely with no problems and the script no longer served a purpose.
Thanks for the reply. But I think I have

Code: Select all

frangible = no;
in the relevant parts of my shipdata already; and yet, even in Oolite 1.77, the turrets can get shot off - as was/is, I recall, a documented bug.
For my Falcon-S, I set:

Code: Select all

<key>frangible</key>
<false/>
And have had no problems in 1.76 or 1.77.