Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSIActionGroupSwitch plugin action / forcedShutdown interaction #392

Closed
MOARdV opened this issue Sep 30, 2015 · 12 comments
Closed

JSIActionGroupSwitch plugin action / forcedShutdown interaction #392

MOARdV opened this issue Sep 30, 2015 · 12 comments
Assignees
Labels
Milestone

Comments

@MOARdV
Copy link
Collaborator

MOARdV commented Sep 30, 2015

Spawned from #385 - if we try to force a plugin action off, it ends up ignoring the "force it off" statement, instead using the current state of the plugin.

@MOARdV MOARdV added the bug label Sep 30, 2015
@MOARdV MOARdV self-assigned this Sep 30, 2015
@MOARdV MOARdV added this to the v0.23.1 milestone Sep 30, 2015
@MOARdV
Copy link
Collaborator Author

MOARdV commented Sep 30, 2015

@DeputyLOL
Copy link
Contributor

ill test it now

@DeputyLOL
Copy link
Contributor

doesn't work

@MOARdV
Copy link
Collaborator Author

MOARdV commented Sep 30, 2015

Okay. Looks like the easy answer wasn't the right one. I'll have to put some more time on it.

@DeputyLOL
Copy link
Contributor

I suspect it has something to do with the mastervariable as I think it worked before I added that

@DeputyLOL
Copy link
Contributor

but it didn't deliver the needed results
as the button persistent would reverse.

@MOARdV
Copy link
Collaborator Author

MOARdV commented Sep 30, 2015

Okay. My new working theory is that it's an interaction between the trigger event and the action group switch. I will have to instrument that code better so I can really see what it thinks it is doing.

@DeputyLOL
Copy link
Contributor

Do you think it would be possible to be able to transfer a persistent variable to a different persistent variable?

I ask this because I have an icon on my altimeter bar that displays the selected altitude. It moves up and down as I increase and decrease the target altitude. I want it to stay where it is until I update it with a new altitude.

@MOARdV
Copy link
Collaborator Author

MOARdV commented Oct 1, 2015

It is possible. Not yet, but maybe soon.

@MOARdV
Copy link
Collaborator Author

MOARdV commented Oct 1, 2015

Another maybe-fix: https://www.dropbox.com/s/apttlrrfarqktvo/RasterPropMonitor-dev.0.23.1.zip?dl=0

However, I think what you're trying to do does not require the trigger event. What you need to do is use the masterVariableName / masterVariableRange to indicate when the switch should be enabled. For example:

MODULE
{
    name = JSIActionGroupSwitch
    animationName = SwitchTumbleAnim
    switchTransform = SwitchColider
    actionName = plugin
    switchSound = ASET/ASET_Props/Sounds/tumbleClick01
    masterVariableName = CUSTOM_MOARdV_ScanEnable
    masterVariableRange = 0.1,1.1
    PLUGINACTION
    {
        name = JSIInternalRPMButtons
        actionMethod = RadarEnable
        stateMethod = RadarEnableState
    }
}

This is my switch for enabling the Gemini docking radar in my FASA Gemini pod. The switch will not work as long as the custom variable is false (=0). When the custom variable is true (=1), the switch functions normally. If the switch is on and the custom variable becomes false, the switch turns itself off again, and it stays off.

@DeputyLOL
Copy link
Contributor

Not sure about that. I already thought of that before.
I disabled my trigger and used a mastervariable. It disabled the switch when it was supposed to, but still didn't turn off the autoland. Leading to my plane crashing because I couldn't navigate the mechjeb menus fast enough.
I then tried again with the trigger enabled. Same result. Except I had the mechjeb window open so I landed safely.

I'll try it again with the new build.

@DeputyLOL
Copy link
Contributor

Fixed! Thank you!

MOARdV added a commit to MOARdV/RasterPropMonitor that referenced this issue Oct 1, 2015
When the plugin normally queries state from its state variable, we need
to override that behavior for forceShutdown.  Fixes issue Mihara#392.
@MOARdV MOARdV closed this as completed Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants