Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML Code for timer function needed

Featured Replies

Hello,

 

I´m lookin for a simply XML Code wich activate the Function TOGGLE_BEACON_LIGHTS for exactly 2 or 3 seconds, everytime when i press a Key or Button(just short press and release). Key/Button is programmed with FSUIPC.

 

regards,

Thomas

Thomas,

 

This "should" work, as there is alot more involved.

 

1. Any time the trapping would work is when at least 1 of the gauges is visible = does not work in spot/tower view

2. FS9 or FSX , both?

3. Is this for a gun/ weapon? What? The way I have it coded now is that it is not repeatable, meaning you cannot restart the timer until the last triggered timer = 0 (This could be changed, notes in code)

4. 2 versions, a "Master" must be used in the VC if the aircraft has one, otherwise in the main panel window. A "Slave", can be used in any other 2d window when the other 2d window is open but the VC (or main) is not visible.

5. This gauge needs a small bitmap, 10 x 10 with a color of 0,0,0 would do it. named Blank.bmp

6. In FSUIPC use TOGGLE BEACON LIGHTS for your key/button programming.

 

The master gauge..

 

<Gauge Name="BEACON_TIMER_MASTER" Version="1.0">
<Image Name="Blank.bmp"/>
<Update Frequency="18">
(L:Beacon_Timer, number) 0 != if{ (L:Beacon_Timer, number) -- (>L:Beacon_Timer, number) }
(L:Beacon_Timer, number) 1 > (A:LIGHT BEACON, bool) ! and if{ (>K:TOGGLE_BEACON_LIGHTS) }
<!-- The beacon turns off when the timer = 1, this is done so a repeatable trigger could be used -->
(L:Beacon_Timer, number) 1 == (A:LIGHT BEACON, bool) and if{ (>K:TOGGLE_BEACON_LIGHTS) }
</Update>

<!-- Note the timer is base 18,,, 18=1 sec, 36=2 sec 54=3 sec etc.. -->

<Keys>
<!-- The repeatable code
<On Event="TOGGLE_BEACON_LIGHTS">(L:Beacon_Timer, number) 1 != if{ 45 (>L:Beacon_Timer, number) }</On> -->
<!-- The non repeatable code -->
<On Event="TOGGLE_BEACON_LIGHTS">(L:Beacon_Timer, number) 0 == if{ 45 (>L:Beacon_Timer, number) }</On>
</Keys>

</Gauge>

 

 

The slave gauge..

 

<Gauge Name="BEACON_TIMER_SLAVE" Version="1.0">
<Image Name="Blank.bmp"/>

<!-- Note the timer is base 18,,, 18=1 sec, 36=2 sec 54=3 sec etc.. -->
<Keys>
<!-- The repeatable code
<On Event="TOGGLE_BEACON_LIGHTS">(L:Beacon_Timer, number) 1 != if{ 45 (>L:Beacon_Timer, number) }</On> -->
<!-- The non repeatable code -->
<On Event="TOGGLE_BEACON_LIGHTS">(L:Beacon_Timer, number) 0 == if{ 45 (>L:Beacon_Timer, number) }</On>
</Keys>

</Gauge>

 

This is not tested, but based highly (95%) on known working code that I have.

 

Roman

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

 

  • Author

Hi Roman,

 

Thank you so much !

That works fine !

I´d never could do this alone, more code lines that i thought.

 

Sorry, forgot to mention, its for fs9

Yes for Weapon Effect, rocket smoke tail simulation

Yes must be repeatable.

 

I found out, to adjust the Time i must change the Entry in the "On Event" Section of the Master, default of yours ist 45.

 

best regards,

Thomas

Thomas,

 

Glad it worked for your application.. Yes the number ( 45 in the example = 2.5 seconds ) should be changed to your liking. The number needed in code = seconds needed * 18 rounded to nearest whole number. Be sure to change the slave number too, if used.

 

Roman

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

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.