Jump to content

Edit a miz file automatically before server start - hooks


chromium

Recommended Posts

Hello,

 

I need to edit weather table in a mission using DCS API script before server start. But I noticed that the earlier callback is onMissionLoadBegin... which is anyway too late, cause when I try to write down the mission it stop (I can't overwrite a file in use... makes sense).

 

Also I would like to do not change the name of the loaded mission, or this might broke something else in DAWS autorestart function.

 

I'm thinking about a call that every time I launch a mission it stops itself (DCS.stopMission()), so that I can edit, and then restart the mission again (net.load_mission). But then... the callback of onMissionLoadBegin should be "called" again and repeat the action in an infinite loop.

 

Suggestion? is there an API callback that can be used before the mission file is loaded (given that I still need miz file path9?

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.

Link to comment
Share on other sites

Well, not exactly solved but... I managed to save the mission with a different name and then load it with a scheduled ontriggermessage event.

I don't like this solution but I can't see any other thing that could act before mission loading.

 

The ideal thing would be an API callback that act after the "launch" button (when the mission path is known) but before accessing the file so that it won't be write-protected.

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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