Hi there :hello:
Currently I am trying to implement Fred18's MS2015 "hack" to force a vessel to be in "idle" state, to avoid endless slipping over the surface.
I just want this workaround available for all vessels.
I need to underline, that I have very low knownledge in C++.
And I know, starting writing an Orbiter-MFD to learn C++ is not the best idea.
However...no risk..no fun.
Because I need just one button (BRAKE), I thought LUA might be a better option...but I was wrong.
Quering EQU-POS crashed Orbiter, while using i.e. "Heading" was no problem.
Also there seem to be no way to set a vessel to IDLE state in LUA.
All in all LUA seems to be a bit unstable (i.e. the EQU-POS-query was no problem when using the LUA-console, but within SCRIPT-MFD, I just got a CTD...same for GLOBAL-POS....+no feedback from the LUAinterpreter to trouble-shoot this....so...I am finished with LUA.....:compbash2:
Ok...fftopic:...back to my problem.
I got to the point, where I can write the POS,HEADING and VESSEL-STATE into a temp. SCN-file...just to re-read it in again(to force a vessel to IDLE-sate).
But when it comes to re-read the SCN, I am stuck with the syntax.
According to the API, there is only an example where the SCN-file will be read-out from an own VESSEL-(class).
But what syntax to use, when I just want to use the current-focused-vessel within a MFD ?
Something like this, seems to be complete wrong:
:OMG:
So this:
..cannot be used...the IDE complains about not defined (I guess caused by the previous wrong syntax).
All I need is "just" the MFD'ish version of what can be found within the API-Reference on page 630.
This like seems to be my main-problem (+the lack of C++ knownledge):
"void MyVessel::clbkLoadStateEx (FILEHANDLE scn, void * status)"
How to write this in a MFD-instance for the current active-vessel?
I guess I need to access the vessel-class via a "handler(?)" or "interface(?)" (again...C++....I am more on C-- level...).
Maybe somebody could give me a hint ?
:thankyou:
Currently I am trying to implement Fred18's MS2015 "hack" to force a vessel to be in "idle" state, to avoid endless slipping over the surface.
I just want this workaround available for all vessels.
I need to underline, that I have very low knownledge in C++.
And I know, starting writing an Orbiter-MFD to learn C++ is not the best idea.
However...no risk..no fun.
Because I need just one button (BRAKE), I thought LUA might be a better option...but I was wrong.
Quering EQU-POS crashed Orbiter, while using i.e. "Heading" was no problem.
Also there seem to be no way to set a vessel to IDLE state in LUA.
All in all LUA seems to be a bit unstable (i.e. the EQU-POS-query was no problem when using the LUA-console, but within SCRIPT-MFD, I just got a CTD...same for GLOBAL-POS....+no feedback from the LUAinterpreter to trouble-shoot this....so...I am finished with LUA.....:compbash2:
Ok...fftopic:...back to my problem.
I got to the point, where I can write the POS,HEADING and VESSEL-STATE into a temp. SCN-file...just to re-read it in again(to force a vessel to IDLE-sate).
But when it comes to re-read the SCN, I am stuck with the syntax.
According to the API, there is only an example where the SCN-file will be read-out from an own VESSEL-(class).
But what syntax to use, when I just want to use the current-focused-vessel within a MFD ?
Something like this, seems to be complete wrong:
Code:
void apiGetFocusInterface()::clbkLoadStateEx(FILEHANDLE scn,void *vs2)
:OMG:
So this:
Code:
clbkLoadStateEx(fh,&vs2)
..cannot be used...the IDE complains about not defined (I guess caused by the previous wrong syntax).
All I need is "just" the MFD'ish version of what can be found within the API-Reference on page 630.
Code:
class MyVessel: public VESSEL2 {
public:
...
clbkLoadStateEx (FILEHANDLE scn, void * status);
...
};
void MyVessel::clbkLoadStateEx (FILEHANDLE scn, void * status)
{
char * line;
int my_value;
while (oapiReadScenario_nextline (scn, line)) {
if (!strnicmp (line, "my_option", 9)) { // custom item
sscanf (line+9, "%d", &my_value);
} else if (...) { // more items
...
} else { // anything not recognised is passed on to Orbiter
ParseScenarioLineEx (line, vs);
}
}
}
This like seems to be my main-problem (+the lack of C++ knownledge):
"void MyVessel::clbkLoadStateEx (FILEHANDLE scn, void * status)"
How to write this in a MFD-instance for the current active-vessel?
I guess I need to access the vessel-class via a "handler(?)" or "interface(?)" (again...C++....I am more on C-- level...).
Maybe somebody could give me a hint ?
:thankyou: