Shield Cycler NEXT 1.12.2

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Shield Cycler 0.20 [BETA]

Post by Commander McLane »

Another thing: I just bought a basic configurator for my advanced cycler. Is that meant to be possible?
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.20 [BETA]

Post by Lone_Wolf »

Commander McLane wrote:
Another thing: I just bought a basic configurator for my advanced cycler. Is that meant to be possible?
Yes, the upgrade paths are now different then in earlier versions because of the split between automatic and manual devices.

these are the requirements for the manual configurators :

basic in-flight configurator works with all Shield Cyclers
standard in-flight configurator works with Standard & Advanced Shield Cycler
advanced in-flight configurator works only with Advanced Shield Cycler

Basically there are 2 high-end configurations possible :
Advanced Shield Cycler, without manual cycling
Advanced Shield Cycler + Advanced in-flight configurator
(expensive, but more efficient then just having the advanced shield cycler).
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.20 [BETA]

Post by Lone_Wolf »

Commander McLane wrote:
Lone_Wolf wrote:
NOTE : energy for cycling is only subtracted when energy has been transferred.

ex : If you cycle to forward with a full forward shield, nothing is subtracted.

ex : If you cycle to aft , and aft shield is already full nothing is subtracted.
That's not how it works for me. I buy the shield cycler and the configurator. I launch, both shields are full. I select the configurator and start hitting 'N' again and again. Whenever it cycles through 'forward' I am losing about 1/5 of an energy bank. For the other states nothing happens. If I press fast enough, the energy goes all the way down.

I guess that when coming from the 'equal' state a variable is set differently than when coming from the other states.
The code for the forward setting tested for <= instead of < , this meant that there was always energy subtracted, even when no change was needed.

I uploaded version 0.20.1 with that fixed.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Lone_Wolf »

New version with several configurable options, see first post for details.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Capt. Murphy »

Hi Lone_Wolf,

I've installed current release for testing/compatibility purposes with something I'm making (Standards Shields Generators which can be damaged in combat) and have come across some problems.

1) I've got the full Advanced Cycler and Configurator installed, OXPconfig and Cabal Common Library all at the correct versions. If I change the available settings in OXPconfig and then use "Back to OXP selection" it drops back to the standard GUI rather than staying within OXPconfig. However if I go back into OXPconfig the change appears to have 'stuck'.

2) With the all available settings set to true in OXPconfig in flight I'm stuck on "Cycler Configuration : Equal".

3) My OXP sets your this.deactivated object as true when my OXP equipment is damaged (which results in either no forward or no aft shield at all (or sometimes both) until repaired). However it still lets me access the Configurator (all be it stuck on equal) and pressing N or being hit results in loss of the working shield and energy loss. However OXPconfig recognises Shield Cycler as deactivated if I dock with my OXP equipment damaged.

I've tried it with just the basic of each installed - same problems. I've tried it without my OXP in add-ons at all. Same problems.

I've tried it without OXPconfig installed - still stuck on "Cycler Configuration: Equal".
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Lone_Wolf »

Capt. Murphy wrote:
Hi Lone_Wolf,

I've installed current release for testing/compatibility purposes with something I'm making (Standards Shields Generators which can be damaged in combat) and have come across some problems.

1) I've got the full Advanced Cycler and Configurator installed, OXPconfig and Cabal Common Library all at the correct versions. If I change the available settings in OXPconfig and then use "Back to OXP selection" it drops back to the standard GUI rather than staying within OXPconfig. However if I go back into OXPconfig the change appears to have 'stuck'.

2) With the all available settings set to true in OXPconfig in flight I'm stuck on "Cycler Configuration : Equal".

3) My OXP sets your this.deactivated object as true when my OXP equipment is damaged (which results in either no forward or no aft shield at all (or sometimes both) until repaired). However it still lets me access the Configurator (all be it stuck on equal) and pressing N or being hit results in loss of the working shield and energy loss. However OXPconfig recognises Shield Cycler as deactivated if I dock with my OXP equipment damaged.

I've tried it with just the basic of each installed - same problems. I've tried it without my OXP in add-ons at all. Same problems.

I've tried it without OXPconfig installed - still stuck on "Cycler Configuration: Equal".
Thanks for reporting those bugs, Capt. Murphy .

when testing 1) i found this in the log :

Code: Select all

18:06:17.157 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (OXPConfig 2.0.3): TypeError: this.sc_manual_cycler is undefined
18:06:17.157 [script.javaScript.exception.unexpectedType]:       /home/panoramix/.Oolite/AddOns/ShieldCycler 0.21.2.oxp/Scripts/ShieldCycler.js, line 154.
This points to an error of mine in the code.
2) is very likely the result of that error.
Correcting this should be easy, i'll look into it.

about 3) :

this.deactivated is there so you can disable all cycler functionality until the game is restarted or a savegame is loaded.
I did test with setting it to disabled while docked, but not in-flight.

The description of your oxp suggest that you want a method to suspend the cycler functionality during flight ?
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Capt. Murphy »

Yep, need to be able to disable (and reenable it) in flight and when docked.

I think I could do it by accessing your variable to set Shield Cycler to disabled from my script rather than deactivating the whole OXP, but not sure if that would work if the user has disabled the disabled setting via OXPconfig??
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Lone_Wolf »

Capt. Murphy wrote:
Yep, need to be able to disable (and reenable it) in flight and when docked.

I think I could do it by accessing your variable to set Shield Cycler to disabled from my script rather than deactivating the whole OXP, but not sure if that would work if the user has disabled the disabled setting via OXPconfig??
You could force it to the disabled setting, but if the user has any manual shield cycler you would also need to set the 4 options so disabled is the only 1 available.
This would interfere with whatever setup the user has choosen and is messy.

Actually the deactivated property does not really deactivate the whole oxp and i think it could do what you want .

Sofar i had not documented the deactivated property , this is what it does :

deactivated = true :

OxpConfig will not allow configuration changes

Affected handlers :

this.shipLaunchedFromStation :
Upon launch the start configuration is NOT set, sc_current_configuration will stay the same it was ( 0 at start).

this.shipTakingDamage
does nothing, returns immediately

this.activated
does nothing, returns immediately
--------------------------------------

There are things to take care of for in-flight switching, so i think i'll create a function that can be called from other scripts.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Lone_Wolf »

Capt. Murphy : check your private messages

I am working on a new version that will fix the bug found by Capt. Murphy, but until that version is released here's a workaround :

Open shieldcycler.js , go to line 154 :

Code: Select all

        this.sc_manual_cycler[sc_configuration_both] = this.sc_both_enabled;
        this.sc_manual_cycler[sc_configuration_forward] = this.sc_forward_enabled;
        this.sc_manual_cycler[sc_configuration_aft] = this.sc_aft_enabled;
        this.sc_manual_cycler[sc_configuration_disabled] = this.sc_disabled_enabled;
edit the 4 lines shown above so they look like this :

Code: Select all

        sc_manual_cycler[sc_configuration_both] = this.sc_both_enabled;
        sc_manual_cycler[sc_configuration_forward] = this.sc_forward_enabled;
        sc_manual_cycler[sc_configuration_aft] = this.sc_aft_enabled;
        sc_manual_cycler[sc_configuration_disabled] = this.sc_disabled_enabled;
save shieldcycler.js and start Oolite while holding SHIFT until you see the spinning cobra.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Shield Cycler 0.21.2 - Now fully configurable

Post by Svengali »

Lone_Wolf wrote:
Sofar i had not documented the deactivated property , this is what it does :

deactivated = true :

OxpConfig will not allow configuration changes
He, seems I should document it as well .-)
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.30.1 - getting close to V1.0

Post by Lone_Wolf »

Version 0.30.1 released, and the concept and implementation is starting to mature.
I am hopeful that Shield Cycler will reach v 1.0 before Finis is published by Drew.

added the folllowing notes to the readme file :

Notes for users :

- since all Shield Cycler & Manual Configurator devices are actually many small devices spread out through the ship, it doesn't make sense for them to get damaged or destroyed.

- None of the shield cyclers / manual configurator devices are visible in the F5 equipment screen.

Notes for OXP writers

- If you have equipment items that are not compatible with mine :
The presence of any shield cycler device can be checked by testing for "EQ_SC_SHIELD_CYCLER_INTERNAL" .
to test for Manual Configurator devices only, use "EQ_SC_MANUAL_CONFIGURATOR_INTERNAL"

- suspend / disable shield cycler functions

ShieldCycler uses the property this.deactivated with the following behaviour :
deactivated = false : default behaviour

behavioural changes when deactivated = true :

OxpConfig will not allow configuration changes

Affected handlers :
this.sc_shipLaunchedFromStation :
Upon launch the start configuration is NOT set, sc_current_configuration will stay the same it was ( equal at start).

this.sc_shipTakingDamage - does nothing, returns immediately

this.sc_activated - does nothing, returns immediately

If you wish to change worldScripts["Shield Cycler"].deactivated from your script, make sure you only do this while DOCKED.
For those who want to stop and start shield cycler functionality at any time, including during battle :

worldScripts["Shield Cycler"].sc_stop();
worldScripts["Shield Cycler"].sc_start();

Check ShieldCyler.js for more info.

Changelog :
0.30.1
- bugfixes
- encountered problems related to different JS execution contexts for equipment event handlers, shipscript event handlers and worldscript event handlers
- rewrite has as side-benefit that the code no longer uses global vars ( except missionvars) .
- added sc_stop & sc-start functions so other oxps can stop/start cycler functionality
- more in-script documentation
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.30.1 - getting close to V1.0

Post by Lone_Wolf »

I found some small bugs, and a bigger one :

Purchase another ship without selling the shield cycler stuff first :
the shield cycler values will still be in the savefile, but not the devices.
this effectively blocks sell/purchase/use of the shield cycler for the new ship.
Not sure yet how to solve this, but looking into it.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Shield Cycler 0.30.1 - getting close to V1.0

Post by cim »

Lone_Wolf wrote:
Purchase another ship without selling the shield cycler stuff first :
the shield cycler values will still be in the savefile, but not the devices.
this effectively blocks sell/purchase/use of the shield cycler for the new ship.
Not sure yet how to solve this, but looking into it.
You should be able to un-set the relevant mission variables in playerBoughtNewShip
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Shield Cycler 0.30.2 - last before V1.0 ?

Post by Lone_Wolf »

Thanks for the tip, cim.

new version uploaded, see first post.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Re: Shield Cycler 0.30.2 - last before V1.0 ?

Post by Lestradae »

Hey,

Got a problem with Shield CyclerV 0.30.2!

I obviously had an 0.20.X version before and now Oolite tells me to sell the old version with an older oxp before I can buy the new version - yet I can't seem to find the old version as I deleted that when installing the new one :(

How do I get rid of my old shield cycler now?
Post Reply