Author Topic: Variables not working correctly?  (Read 3655 times)

Agathia

  • Guest
Variables not working correctly?
« on: April 22, 2017, 06:35:02 PM »
I really don't understand what I am doing wrong here. I tried to refactor some voice pack for Elite so it is easier to modify and also correct some errors they left because I had troubles with my panels, and I simply CAN'T make this code work.

http://imgur.com/a/hrw2B

The first image is my action that will be called by others to open my comm panels. Not that my boolean check treats not set and false as the same value. If it is false, I will set it to true and reset the other panel status (they would become boolean as well if I can get this to work). If it is true, it simply set it to false.

The second image is the action that calls the first one THEN check the variable to say the correct line. So my keyboard shortcut is always typed, but the voice always say the same status instead of saying open/close/open/close, it never changes when it should. Am I an idiot? What am I doing wrong? I lost way too much time on this, I don't get what's not working :(

I also have a third action that should reset the view (close all panels) and calls the first method, but it doesn't even call it, because I guess the app can't see the real value of the boolean...

EDIT : I just saw I inverted my checks in the second image, true should say opened and false should say closed, but it doesn't change the fact that it always says the exact same line all the time.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: Variables not working correctly?
« Reply #1 on: April 22, 2017, 07:03:45 PM »
Have you tried sticking
Code: [Select]
Write '[Blue] {BOOL:comms}' to log
after the "Execute command" command action in the second command, to check whether the variable is changing?

Which shortcut are you seeing pressed? Is there any chance "edFocusCommsPanel" is set and not letting the second branch execute?


As a side note, you have a redundant "Exit when condition met" for the second command. That "End Condition" is the final action in the command, so it'll exit anyway.

Agathia

  • Guest
Re: Variables not working correctly?
« Reply #2 on: April 22, 2017, 10:19:01 PM »
Oh nice I didn't now how to debug the value, I'll try this! The panel does open and close on demand, it's just the voice that is not correct! I'll look into it aas soon as I have some time!

EDIT : I was indeed an idiot. I imagined it was okay but I never actually went into this code ever  :-[
Though I have no idea how this thing works, looks like it something linked to the plugin bindED, I'll look into it as I had quuite a lot of problems with my keybinds, Elite Dangerous is using the default culture of my windows when it should not, and it's breaking a lot of things.
« Last Edit: April 23, 2017, 04:34:38 AM by Agathia »