Jump to content

Time Since Flag ?


Go to solution Solved by Grimes,

Recommended Posts

Posted

Is Time Since Flag an immediate thing, as in, is it 'equals to' the time setting, or is it 'more than or equal to'?

 

 

In other words, would this Condition ever be True?:

 

Condition:

Time Since Flag (1, 10 seconds)

Time Since Flag (2, 20 seconds)

 

WC

 

my head is in another place

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Posted

If Flag 2 fires 10 seconds before Flag 1? I always understood the condition to be "equals to," but now I'm a little curious myself.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Posted

It is the total elapsed time since the flag was last set to anything but false or 0.

 

I often use this to loop triggers at a specific rate. Notably it will run the 2nd trigger every 20 seconds.

 

Once>Time more 10> Flag 1 increase 1

Switched Condition> Time Since Flag 1 is 20 seconds> Flag 1 Increase and Do Script

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted (edited)

Interesting info, the "anything other than false or 0". I find the fact that flags can take either boolean or numerical values confusing, as in " is 0 == false? is 1 == true? is 2 == true ? is a boolean value ever equivalent to a numerical one? etc...". I Wonder if it wouldn't be better to only allow numerical values.

 

I think the original question stands, though. Would "Time Since Flag 1 is 20 seconds" be true 30 seconds after Flag 1 has been set?

 

Personnally, I tend to imagine it would, since otherwise it would require the condition to be tested at the precise moment, and the frame-to-time conversion would maybe not readily allow that*

 

I suppose it wouldn't be hard to verify, anyway. Something along the line of:

Mission Start => None => Set Flag 1 to 1, Set Flag 2 to 1

Once => Time Since Flag 1 is 5 AND Time Since Flag 2 is 10 => Message

Or with the radio menu

 

*: Yeah, I wrote an export script with a kind of "if (Time == Time1 + 5)" and of course it wouldn't work

 

EDIT: A quick test seemed to confirm that the condition Time Since Flag stays true after the exact time is passed

Edited by Robin_Hood
  • Solution
Posted

Sorry I didn't really answer with full information before... I had just finished a rather intense ARMA mp mission :)

 

Interesting info, the "anything other than false or 0". I find the fact that flags can take either boolean or numerical values confusing, as in " is 0 == false? is 1 == true? is 2 == true ? is a boolean value ever equivalent to a numerical one? etc...". I Wonder if it wouldn't be better to only allow numerical values.

 

In the inner workings of the sim all flags have a number value. The mission editor simply translates it to an easier to understand formatting while still being confusing to those who think about it. :) I used to think of flags having 2 value types, boolean and numerical, but its best to just think of it as numbers with 0 == false and 1 to infinity == true.

 

 

I think the original question stands, though. Would "Time Since Flag 1 is 20 seconds" be true 30 seconds after Flag 1 has been set?

 

 

Yes.

 

Its a minimum elapsed time, but it depends on the conditions present. With only a "time since flag" condition it will always be evaluated right at 20 or 21 seconds. Additional conditions or having the trigger occur only on certain events would effectively delay the trigger from executing until the conditions are met.

 

A trigger with two "time since flag" conditions both with different time delays and both are set at the same time, would be evaluated true based on whichever condition has the longest time.

 

Continuous>time since flag 1 is 10>Whatever will keep executing the action once a second until flag 1 is set to false.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted (edited)

Eh, thanks guys, and as typical, interesting discussion followed.

 

My head was stuck in complex mission development when I raised this question. Good to know that it will work, ie: once the Time Since Flag goes True it stays True.

 

 

Robin_Hood -- I've played with the Decrease Flag Action and that will drive a flag to a negative value -- but if that is False I do not know. My OP in this thread link has a script to display flag values -

http://forums.eagle.ru/showthread.php?t=114492

 

---

 

Some time ago I wanted an event to happen at a particular time and only at that time, so I had Conditions like:

Time More 59

Time Less Than 61

:-) There was prolly another condition, had to be...

 

WC

Edited by Wrecking Crew

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Posted (edited)
Once>Time more 10> Flag 1 increase 1

Switched Condition> Time Since Flag 1 is 20 seconds> Flag 1 Increase and Do Script

 

Grimes,

I use this scheme in every mission, with a repeating message. Only instead of Flag 1 Increase I use Flag 1 On.

 

To initialize the flag I also use Mission Start --> Action: Flag 1 On.

 

 

Eno, the new Herky Jerk mission has three 'repeating messages'. Each of these three events has an additional Condition Flag that determines which one of the three events repeat. So there is a Phase 1 repeating message, a Phase 2 repeating message and a final Phase 3 repeating message. This way I can provide repeating info about where the Clients are in their mission progress. The icing on this cake is that each phase can repeat its message at different intervals: Phase 1 is every 23 minutes, Phase 2 is every 4 minutes (the critical part of the mission), and Phase 3 repeats at about every 9 minutes (the wrap up phase).

 

WC

Edited by Wrecking Crew
Not 13, 23!

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Posted
In the inner workings of the sim all flags have a number value. The mission editor simply translates it to an easier to understand formatting while still being confusing to those who think about it. :) I used to think of flags having 2 value types, boolean and numerical, but its best to just think of it as numbers with 0 == false and 1 to infinity == true.

 

Thanks, good to know. Although Wrecking Crew has a valid question about negative numbers :P

I think personnaly I'll just stick with numerical values, since they do the job. By the way, the Mission Editor is even more confusing (inconsistent) in that for Conditions, it has "Flag is True" and Flag is False", but for Actions, it has "Flag On" and "Flag Off".

Posted

Yeah for a while it was simply "set Flag True" and "Set Flag False", I don't know why they decided to change it.

 

To answer the negative number question, yes flags can have negative numbers. It appears that a value of 0 is the only number value that is equivalent to "false". Every other value is true.

 

Obviously if you have a loop on a "time since flag" condition and decrease the flag value then the loop will eventually stop once it reaches 0.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 10 years later...
Posted

Daring to pick this up again...

how will the reaction be if you have an event that sets Flag 1 to 1 from 0 at event time

Then after 5 seconds Flag 1 is set to 0 by another event

And the condition is:

Time since Flag (1, 10 sec)

 

Is there a way to measure if a flag is TRUE in more then 5 seconds fx.??

Posted

The condition wouldn't become true because the flag is back to 0 and therefor "off."

I guess the question is if you want to know a flag has been true. If so then you could set an additional flag, or increase its value by 1, each time that the flag you care about was set. 

 

set flag 1 true and flag increase "flag1WasSet" by 1. 

 

Alternatively you can use scripting to exploit it further...

 

do script: flagWasSet = timer.getTime()

Would give the precise time the flag was set, you can then use that value for whatever purposes you want. 

  • Thanks 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted
4 minutes ago, Grimes said:

do script: flagWasSet = timer.getTime()

Would give the precise time the flag was set, you can then use that value for whatever purposes you want. 

Thanks for that one.  That might allow for all kinds of interesting interactions.

Posted (edited)

Yea i guess to clarify, that what i want is to be able to measure if a flag has been continuously true (or false) for X amount of time

 

aka - Flag 1 is set to true and then remains true for 10 seconds. If it turns false after 5 seconds and then turns true again after 1 second and remains true for another 5 seconds i do not want the "Time since flag (1, 10) to be true, which i suppose it does?

 

So scripting might be the way. Thanks for the suggestion Grimes!

Edited by Mav87th
Posted (edited)

Wow, blast from the past!

@Mav87th  I use a "Latch" flag approach --

--- System Flags ---
--- Latches: do not turn off once set
--- Timers: Use for control

Example --

Flag 50 goes true and is the Latch flag that will never go false again

Flag 506 is the associated Timer flag and can be turned On or Off as needed.

 

Another tip -- for every mission I have a .lua file with all of the notes, scripts, flag assignments, and events.  See the attached.

edit 20240228 -- updated miz file

Confounded 02.lua

Confounded Bridge 29C1f.miz

Edited by Wrecking Crew

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

  • Recently Browsing   0 members

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