Jump to content

Edit a miz file automatically before server start - hooks


Recommended Posts

Posted

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?

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

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

Github for latest version: https://github.com/Chromium18/DSMC

Posted

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.

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

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

Github for latest version: https://github.com/Chromium18/DSMC

  • Recently Browsing   0 members

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