Jump to content

Archived

This topic is now archived and is closed to further replies.

tmc74

XML Code for timer function needed

Recommended Posts

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

Share this post


Link to post
Share on other sites

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


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


Roman_Full_combo_AVSIM_2.png?dl=1  FS RTWR   SHRS F-111   JoinFS Host/Client 

 

Yamaha CR 1000/JBL 2500, AMD 965 BE OC'd @ 3.88, RipJaw 2x4GB 1600 CL7, Gigabyte GTX-1070 OC 8GB, Asus M4A87TD EVO (AMD 870), Samsung 850 EVO 256GB & 1TB SSDs, WD 1T & 500G Black, 19" & 32" LCD, Win7 Pro 64bit, TMaster T-Flight HOTAS, FSX/FS9, FSUIPC / LUA, FSRealWX Pro, PlanG, JoinFS, LittleNavMap
Copilot - Samantha the "Hound"  RIP 😞        
       samantha.jpg?dl=1

 

Share this post


Link to post
Share on other sites

  • 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.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    34%
    $8,560.00 of $25,000.00 Donate Now
×
×
  • Create New...