Jump to content

Message to All - Repeat frequency or reset the 'Once' Trigger


Toni Carrera

Recommended Posts

Hi All, I would like to answer a question if I may?

I want to notify a player when he is above 100' AGL, so I put in a trigger for the right value and tried both one and repeat. Once obviously on shows the message once, and never more after that, and repeat just goes over and over while the user is above the 100'

Ideally I would like to just get it to repeat say every 10 seconds while the user is above, and obviously stop when below, and then start again if goes above

Anybody?

Toni

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Link to comment
Share on other sites

I would use 2 flags and 2 triggers

Trigger 1 activates when player is above 100 agl AND flag 1 is true. It shows a message, sets flag 1 to false and flag 2 to true.

 

Trigger 2 activates when player is below 100 agl AND flag 2 is true. It shows a message, sets flag 2 to false and flag 1 to true.

 

Set both as repetitive actions, it should show messages only once every altitude "switch"

- "It's better to reign in hell than to serve in Heaven"

 

Modules: A-4E-C Skyhawk, A-10C II Tank Killer, AJS37 Viggen, AV-8B Harrier, F-14B Tomcat, F-15C Eagle, F-16C Viper, F/A-18C Hornet, MIG-21 Fishbed, MIG-29, SU-27, SU-33

Maps: Caucasus, Nevada, Persian Gulf, Syria, Supercarrier

Rig: i7 4790 / Nvidia GTX 1070 Strix / 16GB RAM DDR3 1600 MHz / 256 GB SSD / Windows 10

Setup: ThrustMaster TWCS Throttle, Titanwolf "Vulture" Stick, DelanClip PRO, Home-made universal Cockpit panel

Link to comment
Share on other sites

Hi Pantera93,

Thank you, I will go and try that right now

Appreciate the quick and detailed response

Toni

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Link to comment
Share on other sites

@Pantera93

Is Flag Off (xx) the same as Flag is False (xx)

I can see 'Flag is True' and 'Flag is False' under conditions, but not under Actions. I have attached image which I think is what you meant in terms of the first part of the trigger

Please would you be good enough to just clarify the above for me

Thanks

Toni 

image.png

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Link to comment
Share on other sites

Hi @Toni Carrera

Yes, flag off should set a flag to false, flag on to true. Is it working? I could share a sample mission to you tomorrow, with the added "10 second" interval.

Also, note that altitude value is read as meters, you should do the conversion by yourself should you need feets.

- "It's better to reign in hell than to serve in Heaven"

 

Modules: A-4E-C Skyhawk, A-10C II Tank Killer, AJS37 Viggen, AV-8B Harrier, F-14B Tomcat, F-15C Eagle, F-16C Viper, F/A-18C Hornet, MIG-21 Fishbed, MIG-29, SU-27, SU-33

Maps: Caucasus, Nevada, Persian Gulf, Syria, Supercarrier

Rig: i7 4790 / Nvidia GTX 1070 Strix / 16GB RAM DDR3 1600 MHz / 256 GB SSD / Windows 10

Setup: ThrustMaster TWCS Throttle, Titanwolf "Vulture" Stick, DelanClip PRO, Home-made universal Cockpit panel

Link to comment
Share on other sites

36 minutes ago, Toni Carrera said:

I can see 'Flag is True' and 'Flag is False' under conditions, but not under Actions.

That is primarily because 'Flag is True' and 'Flag is False' are conditions (like questions) that can be answered only with yes or no. 

Actions actually change things, and you only get there if the answer to the question on the left is YES.

So: the Action 'Flag OFF (60)' sets the value of flag number 60 to 'FALSE' or zero. The Condition "FLAG IS FALSE (60)" looks at flag number 60, and answers with YES if the value of that flag is zero (false), and NO in all other cases. 

It is a bit unfortunate that DCS's documentation muddles it's way through flags, as they are one of the most important tools we have, yet they are sorely under-documented (to which change does 'time since change' relate? Is a flag that is set to the value 55 true or false? Will setting a flag to true also set it to 1? What value has a flag that I increment when it's false? If a flag that is true also 1 or can a flag have a value of true and 0? Is anyone reading this? Can flags have negative values? why can't we have negative-numbered or alphanumerical flags?). You need to find these answers for yourself, and you usually only find the answers to the more arcane ones the hard way.   


Edited by cfrag
Link to comment
Share on other sites

@Pantera93,


This is the mission I am working on. I am enhancing a mission for the UH-60L which was released by someone called ElementLT (I have told them that I am doing this) and will provide updated version to them before I release. So I am not intentionally stealing a mission, nor would I ever

The first 10 Green and Pink are just debugging, so you can ignore them, it is the last Green and Pink are the ones I am working on for this Height Warning thing

Just sent so you can see what I am working with, on

Thanks

UH-60L-Mission-06-Syria-v02.miz

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Link to comment
Share on other sites

Hi @Toni Carrera

Sorry if it took me so long, but here is a simple version of a mission with a 6000 feet altitude control with message loops every 10 seconds for both lower and higher conditions. Trick here was to use 6 repetitive triggers and 6 flags.

Let me know if it is what you were looking for (you can change the tomcat with whatever plane you like)

Fly safe!

TEST_ALTITUDE.miz

- "It's better to reign in hell than to serve in Heaven"

 

Modules: A-4E-C Skyhawk, A-10C II Tank Killer, AJS37 Viggen, AV-8B Harrier, F-14B Tomcat, F-15C Eagle, F-16C Viper, F/A-18C Hornet, MIG-21 Fishbed, MIG-29, SU-27, SU-33

Maps: Caucasus, Nevada, Persian Gulf, Syria, Supercarrier

Rig: i7 4790 / Nvidia GTX 1070 Strix / 16GB RAM DDR3 1600 MHz / 256 GB SSD / Windows 10

Setup: ThrustMaster TWCS Throttle, Titanwolf "Vulture" Stick, DelanClip PRO, Home-made universal Cockpit panel

Link to comment
Share on other sites

On 2/20/2022 at 11:01 AM, Toni Carrera said:

Hi All, I would like to answer a question if I may?

I want to notify a player when he is above 100' AGL, so I put in a trigger for the right value and tried both one and repeat. Once obviously on shows the message once, and never more after that, and repeat just goes over and over while the user is above the 100'

Ideally I would like to just get it to repeat say every 10 seconds while the user is above, and obviously stop when below, and then start again if goes above

Anybody?

Toni

Once triggers indeed work only once ever. Repetitive Action checks and responds once every second (unless modified by an action like eject, shot, etc).

When you want controlled repetition, you usually want Switched Condition triggers and Time since Flag conditions. Switched Condition is like Repetitive except it only triggers when its conditions switch from false to true.

 

Try something like:

Switched Condition > Plane above 100' OR Time since Flag 1 is 10 seconds > Message "You are too high" AND Flag 1 On

On 2/20/2022 at 3:15 PM, cfrag said:

That is primarily because 'Flag is True' and 'Flag is False' are conditions (like questions) that can be answered only with yes or no. 

Actions actually change things, and you only get there if the answer to the question on the left is YES.

So: the Action 'Flag OFF (60)' sets the value of flag number 60 to 'FALSE' or zero. The Condition "FLAG IS FALSE (60)" looks at flag number 60, and answers with YES if the value of that flag is zero (false), and NO in all other cases. 

It is a bit unfortunate that DCS's documentation muddles it's way through flags, as they are one of the most important tools we have, yet they are sorely under-documented (to which change does 'time since change' relate? Is a flag that is set to the value 55 true or false? Will setting a flag to true also set it to 1? What value has a flag that I increment when it's false? If a flag that is true also 1 or can a flag have a value of true and 0? Is anyone reading this? Can flags have negative values? why can't we have negative-numbered or alphanumerical flags?). You need to find these answers for yourself, and you usually only find the answers to the more arcane ones the hard way.   

 

From what I remember:

Time since Flag (time since change was a typo?) is since the Flag is set true.

A flag is true if it has a value other than 0

I have never checked the value of a flag set to true, but I'd assume it's 1

Increment a false flag to get a flag = 1

A flag with value 0 is off

I don't believe flags can be negative but I have not tried

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Link to comment
Share on other sites

2 hours ago, Exorcet said:

Time since Flag (time since change was a typo?) is since the Flag is set true.

A flag is true if it has a value other than 0

I have never checked the value of a flag set to true, but I'd assume it's 1

Increment a false flag to get a flag = 1

A flag with value 0 is off

I don't believe flags can be negative but I have not tried

Indeed. Take a flag, set it to false/off, decrement it, then increment it. Take a moment to set your expectation: what would you expect? Is the flag now true or false?  [Relevant if your mission depends on the assumption that incrementing a flag always makes it true or that decrementing always stops at false, etc.] What would time since flag return? Wouldn’t it be better if all this was documented? And other things: if you change a flag from False to true in second 5 and 2 seconds later to false. What will time since flag return now? It’s not that I don’t know the answers to these questions - it took me some time to try and test them. It’s that I wish there was better documentation that answered these questions authoritatively, so we don’t have to guess or invest time into find out for ourselves.

I recently discovered that setting a flag to a string value with trigger.misc.setUserFlag() can crash DCS hard back to Windows. Probably not intended; definitely not documented. I love DCS - I want to make it accessible to more people, that’s why I wish there was better docs. 


Edited by cfrag
Link to comment
Share on other sites

13 hours ago, cfrag said:

It’s not that I don’t know the answers to these questions - it took me some time to try and test them. It’s that I wish there was better documentation that answered these questions authoritatively, so we don’t have to guess or invest time into find out for ourselves.

 

No worries, I don't disagree. I wasn't sure if you were asking or being hypothetical, so I answered the questions just in case. Better documentation would be more than welcome

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Link to comment
Share on other sites

Sorry, been away for a few days, so did not get to reply on this

Thank you for all your suggestions. I am wondering if the Switched Condition is the option I should use

Again, my thanks

Toni

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...