July 25, 201015 yr CLARIFICATION I'm using 2 sections of code to initialise and animate the BRS Chute collapsing on the ground, The first <part> is to check various params for correct display and timing, the second <part> is simple animation code based on an L:Var, along with its correct GUID Entry in to modeldef.xml---------------------------------------------------------The first section should check the neccassary params and "IF" All positive results, become Visible "AND" set the L:Var to 1 The Visibility is working just fine (on its own) and the parts do indeed become visible at the correct time, However... the Moment the L:Var initialisation is added, the VISIBILITY Fails and of course any resulting animation cannot be seen ( if it is indeed initialising! ) Intended actions of the 2 code sectionsPART 1 BRS_COLLAPSE_ACTIVATIONa- SPOILERS DEPLOYED = YESb- AIRSPEED <= 50 MPHc- SIM ON GROUND = YesIF yes to all, Then initialise Both VISIBILITY AND L:VAR (Collapse, bool) <PartInfo> <Name>BRS_Collapse_Activation</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 60 > (A:AIRSPEED INDICATED, mph) 50 < and (A:SIM ON GROUND, Bool) 1 == and if{ 1 (>L:Collapse, bool) } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> Part 2 BRS_COLLAPSEModelled Part becomes VISIBLE as its attached to Activation node (Visibility code above)And Animates in accordance to L:Collapse Var <PartInfo> <Name>BRS_Collapse</Name> <AnimLength>100</AnimLength> <Animation> <Parameter> <Code> (L:Collapse, bool) 100 *</Code> <Lag>500</Lag> </Parameter> </Animation> </PartInfo> In conlusion, it sounds simple but appears not to want to work regarding initialising the L:Var The visibility section works FINE If I limit it simply to if{ 1 } els{ 0 } but fails when the added L:Var initialisation is added (as below) if{ 1 (>L:Collapse, bool) } els{ 0 }
July 29, 201015 yr OK .. A little "Wierdness" But finally completed the task .. MANY Thanks all round, Avsim forumizers are a valuable asset with this kinda stuff !! Anyway, completed code folows .. Functionality = Switch off fuel when spoiler (BRS) DeployedDiplay BRS chute Deployment (4 stages) Determine HI SPEED Version (Part closed) of BRSSwitch to Collapsing chute when Aircraft touhes downThe deploying/deployed parts are attached to sub node tagged with BRS_DEPLOYED, not displayed until BRS releaseThe Collapsing animation is attatched to sub node BRS_Collapse_Visibility, as above <PartInfo> <Name>BRS_ENGINE_KILLER</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION,percent) 1 > if{ (>K:FUEL_SELECTOR_OFF) } els{ (>L:Collapse, bool) } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployed020</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION,percent) 1 > (A:SPOILERS LEFT POSITION,percent) 20 < and (A:SIM ON GROUND, bool) 1 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployed2040</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION,percent) 20 > (A:SPOILERS LEFT POSITION,percent) 40 < and (A:SIM ON GROUND, Bool) 0 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployed4060</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION,percent) 40 > (A:SPOILERS LEFT POSITION,percent) 60 < and (A:SIM ON GROUND, Bool) 0 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployedspeedy</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 60 > (A:AIRSPEED INDICATED, mph) 50 > and (A:SIM ON GROUND, Bool) 0 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployed60100</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 60 > (A:AIRSPEED INDICATED, mph) 50 < and (A:SIM ON GROUND, Bool) 0 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_Collapse_Visibility</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 60 > (A:AIRSPEED INDICATED, mph) 50 < and (A:SIM ON GROUND, Bool) 1 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_Collapse_Activation</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 60 > (A:AIRSPEED INDICATED, mph) 50 < and (A:SIM ON GROUND, Bool) 1 == and if{ 1 (>L:Collapse, bool) } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_deployed</Name> <Visibility> <Parameter> <Code> (A:SPOILERS LEFT POSITION, percent) 1 > (A:SIM ON GROUND, bool) 0 == and if{ 1 } els{ 0 } </Code> </Parameter> </Visibility> </PartInfo> <PartInfo> <Name>BRS_Collapse</Name> <AnimLength>100</AnimLength> <Animation> <Parameter> <Code> (L:Collapse, Bool) 100 * </Code> <Lag>10</Lag> </Parameter> </Animation> </PartInfo> I would appreciate any comments regading the code, any ways to simplify or condense it would be gratefully recieved. And I hope of course.. its Understandible in my reverse novice notation :)
Create an account or sign in to comment