Jump to content
Sign in to follow this  
spokes2112

Trigger and event in XML

Recommended Posts

Guest

I can trigger and even whis this sintax1 (>K:event_id)but this only work with event_set type, how can I trigger and event_toggle out side a clik element?Y try with: 1 (>K:event_id_toggle)but don't work.Thanks

Share this post


Link to post
Share on other sites

First off, you cannot change the K:variables by just adding _toggle to them. They must be used exactly as provided. So if a K:Var is not provided in a _toggle format it can be usually found in a K:Var_ON and K:Var_OFF format or K:VarSET. Now all that is needed is a reference to the variable's state. I.E. Is it on? Is it off?For example the panel lights variable has these 2 formats. (EventsID.doc -Panel SDK)K:PANEL_LIGHTS_ON K:PANEL_LIGHTS_OFFK:PANEL_LIGHTS_TOGGLESo as a reference:(K:PANEL_LIGHTS_TOGGLE) is the same as: ( Notice a reference to an A:Var to see what state it is currently in. Parameters.doc -panel sdk)(A:Light panel, bool) 1 == if{ (K:PANEL_LIGHTS_OFF) } els{ (K:PANEL_LIGHTS_ON) }That is a very crude code example, for clarity, but it does work and that is what counts.Now to put this example into a line of code without a click, lets say ( has no purpose) if airspeed is greater than 250 it will toggle the panel lights ( Assume K:PANEL_LIGHTS_TOGGLE is NOT available )(A:Airspeed indicated, knots) 250 > if{ (A:Light panel, bool) 1 == if{ (K:PANEL_LIGHTS_OFF) } els{ (K:PANEL_LIGHTS_ON) } } Hope this helps. Roman(KGRB)


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
Guest

>First off, you cannot change the K:variables by just adding >_toggle to them. They must be used exactly as provided. So >if a K:Var is not provided in a _toggle format it can be >usually found in a K:Var_ON and K:Var_OFF format or >K:VarSET. Now all that is needed is a reference to the >variable's state. I.E. Is it on? Is it off? Usually but not all (for example TOGGLE_ENGINE1_FAILURE)>(K:PANEL_LIGHTS_TOGGLE) is the same as: ( >Notice a reference to an A:Var to see what state it is >currently in. Parameters.doc -panel sdk) My problem is that this sintax don't work yo must usefor it work the other sintax only work with _SET type events, for example:0 (>K:FUEL_SELECTOR_SET)This work ok, but the event that not need parameters (like TOGGLE ones) need click event format.

Share this post


Link to post
Share on other sites
Guest bartels

That's new to me. You can use<Click> 0 (>K:TOGGLE_ENGINE1_FAILURE) </Click>to toggle the engine failure as far as I know. There are however some K:events that are toggling in a <Click Event... and setting in a <Click> 0 (>K:...</Click> line.Arne Bartels

Share this post


Link to post
Share on other sites
Guest

>That's new to me. You can use > 0 (>K:TOGGLE_ENGINE1_FAILURE) > >to toggle the engine failure as far as I know. There are >however some K:events that are toggling in a Event... and setting in a 0 >(>K:... line. Thanks, this work ok, I tried 1 (>K:...but seems to nedd 0 for activation

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...