1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Landing Light

Discussion in 'Graphics' started by Multipilot, 13/4/12.

  1. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Hello,

    Anyone have a tutorial on how to create the landing/taxi light ground splash and how to turn it off and on using FSD?

    I have tried to create a landing light ground splash in FSD and I made a semi-transparent polygon to act as light....and animated the polygon/light so that it moves down/into the ground and out of the visual field of the pilot in the VC when the light is turned off and the opposite when the light is turned on.

    This does not give me the desired effect that I want because I want the light to turn off immidiately because the landing light bulbs dont move so the light emitted from the landing lights should not move either; just turn on and off.

    I am using FSX.

    Any hints or comments are appreciated :)

    Regards,
    John Stewart

    ps. sending some photos of my project :D

    Attached Files:

    Last edited: 13/4/12
  2. tgibson

    tgibson

    Joined:
    22/9/06
    Messages:
    4,710
    Country:
    us-california
    Include a <Visibility> line in your XML code that tests for the landing light variable?
  3. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Pesky landing light....

    Can anyone give me the XML code for a landing light....so that I can see the programming structure? :confused:
  4. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,507
    Country:
    unitedstates
    Code:
      <PartInfo>
        <Name>light_landing_on</Name>
        <Visibility>
          <Parameter>
            <Code>
              (A:LIGHT LANDING,bool)
              (A:ELECTRICAL MASTER BATTERY,bool)
              and
            </Code>
          </Parameter>
        </Visibility>
      </PartInfo>
    
      <PartInfo>
        <Name>light_landing_off</Name>
        <Visibility>
          <Parameter>
            <Code>
              (A:LIGHT LANDING,bool) !
              (A:ELECTRICAL MASTER BATTERY,bool) !
              or
            </Code>
          </Parameter>
        </Visibility>
      </PartInfo>
    
  5. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Thanks Bill.....should I insert a image parameter in the code some where as well?

    How do I, "connect" the code to the landing light switch in the virtual cockpit? Do I have to insert X, Y, Z coordinates in the xml code to place it in the correct place over the switch in the virtual cockpit or how does that work?
    Last edited: 21/4/12
  6. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,507
    Country:
    unitedstates
    That script I posted is for the attachpoint for the fx_landing.fx effect file (lightsplash).

    The switch is another script entirely, the script for which is already in the modeldef.xml file by default:

    Code:
        <PartInfo>
            <Name>switch_landing_light</Name>
            <AnimLength>50</AnimLength>
            <Animation>
                <Parameter>
                    <Sim>
                        <Variable>LIGHT LANDING</Variable>
                        <Units>bool</Units>
                        <Scale>50</Scale>
                    </Sim>
                    <Lag>400</Lag>
                </Parameter>
            </Animation>
            <MouseRect>
                <Cursor>Hand</Cursor>
                <HelpID>HELPID_GAUGE_LIGHT_SWITCH_LANDING</HelpID>
                <TooltipID>TOOLTIPTEXT_LIGHT_SWITCH_LANDING</TooltipID>
                <EventID>LANDING_LIGHTS_TOGGLE</EventID>
            </MouseRect>
        </PartInfo>
    
    To use this, you would simply animate your 3d switch in the VC using 50 keyframes, then use the Animation Manager and Attachpoint Tool to assign "switch_landing_light" to the 3d switch object.
  7. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Alright......that make things a little bit clearer but I am using FS Design Studio and there is a animation funktion and I have animated the landing light switch but I can not find the attach point function as you described it :( Is this function only available in GMAX or do I have to write the code by hand?
  8. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,507
    Country:
    unitedstates
    I have absolutely no idea how Louis integrated Attachpoints in FSDS...
  9. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20/2/11
    Messages:
    868
    Country:
    us-virginia
    In the FSDS main folder there is a file called PartDataDefs.txt.
    It should include this line of code:
    Code:
    attachpt_landing_1 	<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_landing_1"> <AttachedObject> <Effect effectName="fx_landing" effectParams=""/> </AttachedObject> </Attachpoint> <Visibility name="general_light"> </Visibility> </FSMakeMdlData>
    You call the part attachpt_landing_1.

    I'm not sure if it is necessary, but I add that name to the [FSX Aircraft visibility] section of another file called PartNames.txt.

    Then in the Part Properties dialog, Browse, Category, FSX Aircraft Visibility dropdown, click onattachpt_landing_1.

    That is how to do it in FSDS

    Roy
  10. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,507
    Country:
    unitedstates
    In that case then, you might wish to use this that will take advantage of the custom <Visibility> script I suggested in my first post.

    The "default" uses "general light" which isn't really very specific at all. The following will use "light_landing_on" which is keyed to both the battery switch and the landing light switch.

    Lights should not be on if the master battery switch is OFF... ;)

    Code:
    attachpt_landing_1 	<?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_landing_1"> <AttachedObject> <Effect effectName="fx_landing" effectParams=""/> </AttachedObject> </Attachpoint> <Visibility name="light_landing_on"> </Visibility> </FSMakeMdlData>
  11. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20/2/11
    Messages:
    868
    Country:
    us-virginia
    Bill
    Thanks.
    The FSDS PartDataDefs file is IMHO a bit of a mess.
    It is also UberCritical about the number of spaces folowing the part name.
    Another reason for my blankaphobia
    Will modify accordingly. (the file that is, nothing I can do about the phobia)

    Roy
  12. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Still having problems getting the landing light to work.

    Hello again....

    I am still not able to get the landing light to work. I have added the code that you two have mentioned above to the files mentioned.

    The result is that I can see the light splash on the ground now but the animation of the landing light switch is, "stuck" I can't click the landing light switch anymore so that the switch move when I click it.

    I have tried pressing Ctrl-L to turn on and off the landing light but the landing light splash remains lit and the switch moves using key commands but not when I click on it using the mouse?!?!

    If I understand you two correctly I need the following to make this work:
    (1) Make a landing light splash form using a polygon infront of the airplane; adding Alpha texturing and L texture on top of the polygon?
    (2) Add the code to the .txt files mentioned by you two above?
    (3) Make the light attach to the ground splash/polygon texture using FSDS light attach?
    (4) Assign FSDS, "part name", "landing light" to the landing light switch?

    anything else?

    I should mention that this airplane is made for FSX and the landing lights can be seen on the exterior model and they turn on and off nicely on the exterior model but the problem is to see the landing light splash on the ground from the VC and to make the landing light switch turn on and off the light.

    Regards,
    John Stewart
  13. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20/2/11
    Messages:
    868
    Country:
    us-virginia
    There is your problem. If you used the stock "switch_landing_light" animation in the modeldef file, you have to name the switch the same in FSDS. Easiest way is to look for that name in the FSDS FSX Animation drop down and select it.

    Roy
  14. Multipilot

    Multipilot

    Joined:
    29/1/12
    Messages:
    97
    Country:
    sweden
    Thanks Roy for the suggestion. I have tested changing the name of the landing light switch but it didn't work. I suspect I am doing something wrong with the texturing on the exterior polygon.

    I have not created a .Xml or .fx file for the light because I don't see why I should make one when I am using the VC? FSDS add the correct information into the .model file and find the standard fsx landing lights after I have animated the landing light switch and added a correctly textured polygon when I compile the aircraft in FSDS; or no? :eek:

    I don't know if I need to create a .Xml file and a .fx file? I have covered the polygon with a .tga texture having alpha activated on it. I have animated the switch....and I have attached the landing light but nothing happens when I switch the landing light switch. :confused:

    John
  15. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20/2/11
    Messages:
    868
    Country:
    us-virginia
    When I create a landing light with FSDS this is all I do.
    1. Place a small polygon in front of the shape for the light. The Y axis of the polygon should be pointing backwards, opposite to the direction of the light beam. Call this polygon attachpt_landing_1. This means that the visual effect of a landing light "fx_landing.fx" will start from that attachment point. It will be visible in all views.
    2.Name the switch by picking it from the FSX animated parts drop-down. You want switch_landing_light. Then animate it.

    Since the stock switch_landing_light entry in modeldef.xml has a mouse rectangle, when compiled you should get a "Hand" cursor and a tooltip. They must be there for you to control the switch in the VC.

    No textures involved.

    Roy

Share This Page