Jump to content

Recommended Posts

Posted

Hey guys,

 

I've made a simple obstacle course mission to help our squadrons pilots familiarize themselves with the Shark again after having been in the Hog pilot for quite a while now, and I'm looking to see if anybody knows a simple way to display the "time since flag" value in a message in game to tell the pilots how long it took them to fly the course.

 

IF anyone has seen this on the forums, can they please send me the link as the search hasn't turned up too much thus far.

 

Thanks:)

Intel i9-9900KF @5.2GHz

MSI Z390 Gaming Pro Carbon

32GB G.Skill Trident Z DDR3200 RAM

MSI RTX 2080 Ti Gaming X Trio

40" Panasonic TH-40DX600U @ 4K

Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive

Gametrix JetSeat with SimShaker

Windows 10 64 Bit Home Edition

 

[sIGPIC][/sIGPIC]

Posted (edited)

If you're not opposed to extracting the mission, inserting Lua at the proper place, then re-zipping the mission back to a .miz, you could probably do this now. However, every time you saved the mission again in the mission editor, you would have to re-insert the script.

 

Anyway, in one trigger action that was triggered continously starting at the start of the course, you'd have to add a global variable that initialized itself to zero if not defined, then if defined, added did var = var + 1 every time the trigger is run:

 

if course_time == nil then

course_time = 0

else

course_time = course_time + 1

end

 

Thus "course_time" equals the number of seconds since the course was started, since a continuous trigger is evaluated once every second.

 

Now in another trigger action, the one you want to display the course_time in, then you'd want this code (if I remember the a_out_text_delay function correctly):

 

a_out_text_delay('Your course time was ' .. tostring(course_time) .. ' seconds.', 30)

 

And your course time should display for 30 seconds.

 

Otherwise, if you wait till the Black Shark/A-10C, it could be a lot easier then, especially with a ./Scripts/net/server.lua mod I am currently working on for A-10C. Especially if I add a "timer display" function.

 

I tell you what, attach the mission, tell me which triggers you want to start the course timing in (needs to be a "Continuous") and which triggers you want to display your course time in (needs to be a "Once"), and I'll try inserting it myself. But if it doesn't work, I can't be held accountable :P I also don't really have the time to piddle around with it that much... got too much other stuff to do. I could give it a go or two though. Make sure your continuous trigger, after it starts going off, keeps going off forever... so you probably need a third trigger, a "Once" type, to make a flag set to true once someone enters the beginning of the course, and run the continuous trigger with that flag being true as the only condition.

Edited by Speed
  • Like 1

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted (edited)

Ok, here is the mission modified so that it displays the amount of time it took you to complete the course. Wow that's hard. Took me 210 seconds first try.

Keep in mind:

THIS MISSION CAN MOST LIKELY NO LONGER BE EDITED IN THE MISSION EDITOR NOW. For sure, if you try to save over it, it will almost certainly destroy the scripts I inserted into it. Quite possibly, it will cause the ME to CTD on trying to open the mission.

 

Haven't tested it to ensure that it works on the next course run too, but it should.

training_day_modified.miz

Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Posted

Thanks so much for the help Speed, after running through the mission file, it's actually really simple as you first mentioned so I'll be sure to use this again.

 

Thanks again, really appreciated.

Intel i9-9900KF @5.2GHz

MSI Z390 Gaming Pro Carbon

32GB G.Skill Trident Z DDR3200 RAM

MSI RTX 2080 Ti Gaming X Trio

40" Panasonic TH-40DX600U @ 4K

Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive

Gametrix JetSeat with SimShaker

Windows 10 64 Bit Home Edition

 

[sIGPIC][/sIGPIC]

Posted

Wow, that's actually a great mission! I just tried the version posted by Speed and it's really cool. Once you've completed it (if it isn't complete already), you should post it in the Missions and Campaigns subforum. This is exactly the kind of challenge I like.

 

BTW, I've flown it a few times (yes... crashed twice into some of the towers...), my record so far is 118 seconds - should be easy enough to beat. :-)

  • Recently Browsing   0 members

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