Native FSX Mitsubishi F-2A and F-2B test release - Page 3
Page 3 of 3 FirstFirst 123
Results 51 to 60 of 60

Thread: Native FSX Mitsubishi F-2A and F-2B test release

  1. #51
    Quote Originally Posted by kbt View Post
    Thank you for writing very helpful XML. However, I do not have the skill to correct this notation to the perfect Reverse Polish Notation.
    The result at FS, the light did not turn on, the switch was only up and down movement.
    Check that there is electrical power for the aircraft. Battery or engine+generator.

    I have also corrected a bug in the script. See my last post above.

  2. #52
    Quote Originally Posted by Bjoern View Post
    Check that there is electrical power for the aircraft. Battery or engine+generator.

    I have also corrected a bug in the script. See my last post above.
    https://youtu.be/iq01LD6UAzw

    Thank you very much for your help.
    Only taxi lights will be on. The switch remained in motion only up and down.
    Last edited by kbt; January 16th, 2018 at 02:04.

  3. #53

  4. #54
    Quote Originally Posted by Bjoern View Post
    You can left or right click the switch.

    Left click to move up (middle, off), right click to move down (taxi light on). However, it does not move to the landing light (top).

  5. #55
    Ah, I see where things might go wrong now.


    Code:
    <Animation name="F-2_TaxiLdg_Light_Switch" guid="0aef10f5-4c5d-47c3-8e2e-5ae63e0474d9" length="50" type="Sim" typeParam2="F-2_TaxiLdg_Light_Switch" typeParam="AutoPlay" />
    
    <PartInfo>
    <Name>F-2_TaxiLdg_Light_Switch</Name>
    <AnimLength>50</AnimLength>
    <Animation>
    <Parameter>
    <Code>(L:F-2 Taxi Landing Light Switch, number) 25 * 25 +</Code>
    <Lag>100</Lag>
    </Parameter>
    </Animation>
    <MouseRect>
    <Cursor>Hand</Cursor>
    <TooltipText>Landing/Taxi Light Switch (%((L:F-2 Taxi Landing Light Switch, number))%{case}%{:-1}Taxi Light On - LMB/RMB: Switch Off%{:0}Off - LMB: Landing Light, RMB: Taxi Light%{:1}Landing Light On - LMB/RMB: Switch Off%{end})</TooltipText>
    <MouseFlags>LeftSingle+RightSingle</MouseFlags>
    <CallbackCode>
    (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'RightSingle' scmp 0 == or  (L:F-2 Taxi Landing Light Switch,  number) 0 != and if{ 0 (>L:F-2  Taxi Landing Light Switch, number) }
    
    (M:Event) 'LeftSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch, number) 0 == and if{ 1 (>L:F-2 Taxi Landing Light Switch, number) }
    
    (M:Event) 'RightSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch,  number) 0 == and if{ -1 (>L:F-2 Taxi Landing Light Switch, number) }
    
    (L:F-2 Taxi Landing Light Switch, number) 1 == (A:LIGHT LANDING, bool) ! and if{ (>K:LANDING_LIGHTS_TOGGLE) }
    (L:F-2 Taxi Landing Light Switch, number) -1 == (A:LIGHT TAXI, bool) ! and if{ (>K:TOGGLE_TAXI_LIGHTS) }
    
    (L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT LANDING, bool) and if{ (>K:LANDING_LIGHTS_TOGGLE) }
    (L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT TAXI, bool) and if{ (>K:TOGGLE_TAXI_LIGHTS) }
    </CallbackCode>
    </MouseRect>
    </PartInfo>
    In the old switch code, the code line for resetting the switch to the middle position when the left or right mouse button was pressed and the switch was NOT in the middle was executed after the code line for the landing lights. This immediately reset the switch to the middle position when clicking it for landing lights because the left mouse button was pressed and the switch variable was first zero and then one, which activated the condition to reset the switch.
    The taxi light switch worked because the code line was executed after the line for resetting the switch.
    Switching the line positions is an easy solution, because the code is always read from top to bottom, so if the switch is in the middle, the first condition to reset the switch will not activate.

    Also note the improvement to the tooltip, which will now indicate which mouse button must be pressed to change the switch position.

    Hope this is understandable.

  6. #56
    Quote Originally Posted by Bjoern View Post
    Ah, I see where things might go wrong now.


    Code:
    <Animation name="F-2_TaxiLdg_Light_Switch" guid="0aef10f5-4c5d-47c3-8e2e-5ae63e0474d9" length="50" type="Sim" typeParam2="F-2_TaxiLdg_Light_Switch" typeParam="AutoPlay" />
    
    <PartInfo>
    <Name>F-2_TaxiLdg_Light_Switch</Name>
    <AnimLength>50</AnimLength>
    <Animation>
    <Parameter>
    <Code>(L:F-2 Taxi Landing Light Switch, number) 25 * 25 +</Code>
    <Lag>100</Lag>
    </Parameter>
    </Animation>
    <MouseRect>
    <Cursor>Hand</Cursor>
    <TooltipText>Landing/Taxi Light Switch (%((L:F-2 Taxi Landing Light Switch, number))%{case}%{:-1}Taxi Light On - LMB/RMB: Switch Off%{:0}Off - LMB: Landing Light, RMB: Taxi Light%{:1}Landing Light On - LMB/RMB: Switch Off%{end})</TooltipText>
    <MouseFlags>LeftSingle+RightSingle</MouseFlags>
    <CallbackCode>
    (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'RightSingle' scmp 0 == or  (L:F-2 Taxi Landing Light Switch,  number) 0 != and if{ 0 (>L:F-2  Taxi Landing Light Switch, number) }
    
    (M:Event) 'LeftSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch, number) 0 == and if{ 1 (>L:F-2 Taxi Landing Light Switch, number) }
    
    (M:Event) 'RightSingle' scmp 0 == (L:F-2 Taxi Landing Light Switch,  number) 0 == and if{ -1 (>L:F-2 Taxi Landing Light Switch, number) }
    
    (L:F-2 Taxi Landing Light Switch, number) 1 == (A:LIGHT LANDING, bool) ! and if{ (>K:LANDING_LIGHTS_TOGGLE) }
    (L:F-2 Taxi Landing Light Switch, number) -1 == (A:LIGHT TAXI, bool) ! and if{ (>K:TOGGLE_TAXI_LIGHTS) }
    
    (L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT LANDING, bool) and if{ (>K:LANDING_LIGHTS_TOGGLE) }
    (L:F-2 Taxi Landing Light Switch, number) 0 == (A:LIGHT TAXI, bool) and if{ (>K:TOGGLE_TAXI_LIGHTS) }
    </CallbackCode>
    </MouseRect>
    </PartInfo>
    In the old switch code, the code line for resetting the switch to the middle position when the left or right mouse button was pressed and the switch was NOT in the middle was executed after the code line for the landing lights. This immediately reset the switch to the middle position when clicking it for landing lights because the left mouse button was pressed and the switch variable was first zero and then one, which activated the condition to reset the switch.
    The taxi light switch worked because the code line was executed after the line for resetting the switch.
    Switching the line positions is an easy solution, because the code is always read from top to bottom, so if the switch is in the middle, the first condition to reset the switch will not activate.

    Also note the improvement to the tooltip, which will now indicate which mouse button must be pressed to change the switch position.

    Hope this is understandable.


    In the script of this time the lighting switch moved from the OFF position to the taxi light and the landing light. However, except for the first click, it will be invalid and the switch will not work. When reselecting an aircraft or loading from a saved flight, it is reset and clicking becomes possible again, and only the first click, the switch shows a reaction and moves.

  7. #57
    This is my last attempt. If does not work, you will have to ask somebody else or try to fix the code yourself.

    Code:
    <Animation name="F-2_TaxiLdg_Light_Switch" guid="0aef10f5-4c5d-47c3-8e2e-5ae63e0474d9" length="50" type="Sim" typeParam2="F-2_TaxiLdg_Light_Switch" typeParam="AutoPlay" />
    
    <PartInfo>
    <Name>F-2_TaxiLdg_Light_Switch</Name>
    <AnimLength>50</AnimLength>
    <Animation>
    <Parameter>
    <Code>(L:F-2 Taxi Landing Light Switch, number) 25 * 25 +</Code>
    <Lag>100</Lag>
    </Parameter>
    </Animation>
    <MouseRect>
    <Cursor>Hand</Cursor>
    <TooltipText>Landing/Taxi Light Switch (%((L:F-2 Taxi Landing Light Switch, number))%{case}%{:-1}Taxi Light On - LMB/RMB: Switch Off%{:0}Off - LMB: Landing Light, RMB: Taxi Light%{:1}Landing Light On - LMB/RMB: Switch Off%{end})</TooltipText>
    <MouseFlags>LeftSingle+RightSingle</MouseFlags>
    <CallbackCode>
    (M:Event) 'LeftSingle' scmp 0 == 
    if{ (L:F-2 Taxi Landing Light Switch, number) 0 == if{ 1 (>L:F-2 Taxi Landing Light Switch, number) } els{ 0 (>L:F-2 Taxi Landing Light Switch, number) } }
    
    (M:Event) 'RightSingle' scmp 0 ==
     if{ (L:F-2 Taxi Landing Light Switch,  number) 0 == if{  -1 (>L:F-2 Taxi Landing Light Switch, number) } els{ 0 (>L:F-2  Taxi Landing Light Switch, number) } }
    
    (L:F-2 Taxi Landing Light Switch, number) 1 == (A:LIGHT LANDING, bool) ! and if{ (>K:LANDING_LIGHTS_TOGGLE) }
    (L:F-2 Taxi Landing Light Switch, number) -1 == (A:LIGHT TAXI, bool) ! and if{ (>K:TOGGLE_TAXI_LIGHTS) }
    (L:F-2 Taxi Landing Light Switch, number) 0 == if{ (A:LIGHT LANDING, bool) if{ (>K:LANDING_LIGHTS_TOGGLE) } (A:LIGHT TAXI, bool) if{ (>K:TOGGLE_TAXI_LIGHTS) } }
    </CallbackCode>
    </MouseRect>
    </PartInfo>

  8. #58
    I appreciate that you cooperated with your precious time.
    Arigato gozaimasu!


    This script is perfect. Thank you again.
    Last edited by kbt; January 18th, 2018 at 05:05.

  9. #59

  10. #60
    Any way to get the HUD to show up in P3DV4? Or is there a switch I am missing?

Members who have read this thread: 1

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •