- Joined
- Aug 6, 2011
- Messages
- 405
- Reaction score
- 2
- Points
- 18
For an Orbiter module I am working on, I need my module to be able to read certain values into a scenario file before SimulationStart(or right after it), and write those values at SimulationEnd (or right after it).
For a MFD, the functions ReadStatus and WriteStatus are called.
For a VESSEL2, the functions clbkSaveState and clbkLoadStateEx are called.
Both of the above return a FILEHANDLE to the scenario; however, I did not find anything comparable to this in the Module class.
At first, I thought that if I could get the filename of the scenario loaded, I could just directly read/write to the scenario file, but there appears to be no API function to get the filename of a loaded scenario.
In this case, saving is not a real issue; I could always just save into (Current State).scn (although this would not save the status values into quicksaves). Without an API function, I would have to ask the user to input the filename of the scenario they just loaded. Although this is possible, it seems...inelegant.
Is there a better solution?
Thanks! :tiphat:
For a MFD, the functions ReadStatus and WriteStatus are called.
For a VESSEL2, the functions clbkSaveState and clbkLoadStateEx are called.
Both of the above return a FILEHANDLE to the scenario; however, I did not find anything comparable to this in the Module class.
At first, I thought that if I could get the filename of the scenario loaded, I could just directly read/write to the scenario file, but there appears to be no API function to get the filename of a loaded scenario.
In this case, saving is not a real issue; I could always just save into (Current State).scn (although this would not save the status values into quicksaves). Without an API function, I would have to ask the user to input the filename of the scenario they just loaded. Although this is possible, it seems...inelegant.
Is there a better solution?
Thanks! :tiphat: