Jump to content

measure time between events


whitehot

Recommended Posts

sorry if it's been asked before, but could not find it on the forum.

 

I'm making a simple mission for the hip (for the huey too, later) to improve the times I spend taking off, transit and land to deploy troops.

The idea is very simple, I turn on a flag as soon as I take off, then turn it off on landing in a certain zone.

On landing, a message displays the elapsed time.

 

My intention was to measure the time between flag 1 =on and flag 1=off, possibly up to tens of seconds.

 

Basically a stopwatch using the internal clock.

If it possible, I'd like to do this without scripting.

 

Also, if there is an even simpler way to accomplish this without using flags, I would prefer it.

 

I'm pretty sure that there must be a simple way, but can't find it in the mission editor.

 

Another thing that is not very clear to me is how to display the content of a "variable" (in this case, the elapsed time), in a "message to all" text.

 

Thanks in advance


Edited by whitehot

[sIGPIC][/sIGPIC]

 

Intel i7 6700K @ 4.2, MSI M5 Z170A Gaming, NZXT X61 Kraken liquid cooler, PNY Nvidia GTX 1080 Founders Edition, 16GB Corsair Vengeance 3000 Mhz C15, samsung 840 evo SSD, CoolerMaster 1000W Gold rated PSU, NZXT Noctis 450 cabinet, Samsung S240SW 24' 1920x1200 LED panel, X-52 Pro Flight stick. W10 Pro x64 1809, NO antivirus EVER

Link to comment
Share on other sites

Hi whitehot,

If you go to my WC Projects site and to the Mission Resources page, look at the file called WC's Flags.. At the bottom is a method to display flag values in text.

 

Another doc there is WC's mist examples. That has a lot of sample scripts that might help you get started. Also check out the Mist guide pdf.

 

WC

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.

Link to comment
Share on other sites

You could turn on Flag 1 and have another event (Continuous?) that increments this Flag 1 -- that will run every second and should provide an elapsed time indication.

 

About a quarter way down in the WC's mist examples doc there is this that uses a timer --

--- old way
local units = mist.makeUnitTable({'RDR AGrp01-1'})
local flag = 10117
local zones = {'Gudauta Zone'}
local zone_type = 'cylinder'

local function unitsInZonesOnOff(result)
   local ret = mist.getUnitsInZones(units, zones, zone_type)
   if #ret == 0 and result == true then
       trigger.action.setUserFlag(flag, 0)
       result = false
   elseif #ret > 0 and result == false then
       trigger.action.setUserFlag(flag, 1)
       result = true
   end
   mist.scheduleFunction (unitsInZonesOnOff, {result}, timer.getTime() + 1)
end

unitsInZonesOnOff(false)

--- ^^^ old way

 

 

I'm not an expert on this stuff... but I hope this helps.

 

WC

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.

Link to comment
Share on other sites

hey, nice site. I downloaded both the flags file and the mist examples. I believe I can make something out of this data, although I'm pretty basic when it comes to the mission editor - in fact I was thinking there was a way to read and display the content of flags.

 

As time is basically a "global variable" (as an example, in the scoring window you have very precise time stamps for every event) I'd think there's a way for the mission designer to access it directly.

 

thanx, best rgrds

[sIGPIC][/sIGPIC]

 

Intel i7 6700K @ 4.2, MSI M5 Z170A Gaming, NZXT X61 Kraken liquid cooler, PNY Nvidia GTX 1080 Founders Edition, 16GB Corsair Vengeance 3000 Mhz C15, samsung 840 evo SSD, CoolerMaster 1000W Gold rated PSU, NZXT Noctis 450 cabinet, Samsung S240SW 24' 1920x1200 LED panel, X-52 Pro Flight stick. W10 Pro x64 1809, NO antivirus EVER

Link to comment
Share on other sites

  • Recently Browsing   0 members

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