Jump to content

Recommended Posts

Posted

Hi Lua scripting Gurrus,

 

 

Let's imagine that I have a mission starting at HH:MM:SS/DD

 

 

Is is possible with a Lua function to change (via Lua script) the starting mission time (to whatever) when the mission loads ?

 

 

 

Thanks

Posted

There is no setter for mission time as far as I'm aware. It is stored inside the .miz file, and read upon mission load. You would need to manually edit the mission file each time before you started it up.

Posted

You can do that by a very-very-very ugly solution.

You need a code to be placed as an "hooks" file that:

1) as soon as the mission is loaded, unzip the .miz file you loaded, read the "mission" file and load it as a table

2) create the new day, month, year and start time value from os time, and replace the values into the loaded mission table

3) save the mission table as a file overwriting the previous one

4) repack everything into a .miz file that has a different name than the one you opened.

5) load this file.

 

I temporarly did that to update current weather but then I left those solution cause it was really extremely ugly and only static weather could be updated from a real single location and then applied to the entire map (ugly itself): DCS do not have a callbacks that allow you to do this thing BEFORE loading the file, so you will see a loaded mission and like instantly after the loading it will load again the new file (if everythings works correctly).

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

  • Recently Browsing   0 members

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