Hi,
Wasn't sure whether to put this here or in the OrbiterSDK sub forum.
I've been updating the dll of a ship I made with Ummu capabilities, so far I've managed to disable control of the ship's attitude and main engine when it's empty like this:
When I reenter the ship with an ummu I regain control of the attitude control but with the main thruster group being deleted I obviously can't control the main engines.
I've tried to reinstate main control the following two ways:
1)
2)
The first approach compiles but with no effect on the main thrusters and the second attempt won't even compile.
Should I been disabling the main engines in the fashion I have or am I just missing something in the reenabling?
I don't know if it's relevant but the above code is inserted into the UmmuSample.cpp that come with the UmmuSDK rather than my ship.cpp
Wasn't sure whether to put this here or in the OrbiterSDK sub forum.
I've been updating the dll of a ship I made with Ummu capabilities, so far I've managed to disable control of the ship's attitude and main engine when it's empty like this:
Code:
if(Crew.GetCrewTotalNumber()==0)
{
sprintf(SendFocusScreenMessage(),"No Pilot Present. Control Impossible.");
oapiSetAttitudeMode(GetHandle(),0);
THGROUP_HANDLE hdl = NULL;
hdl=GetThrusterGroupHandle(THGROUP_MAIN);
DelThrusterGroup(hdl,THGROUP_MAIN,false);
}
I've tried to reinstate main control the following two ways:
1)
Code:
if(Crew.GetCrewTotalNumber()>0)
{
PROPELLANT_HANDLE tank;
tank = CreatePropellantResource (FUELMASS);
THRUSTER_HANDLE th_main;
th_main = CreateThruster (_V(0,0,-13.5), _V(0,0,1), MAXMAINTH, tank,ISP);
CreateThrusterGroup (&th_main, 1, THGROUP_MAIN);
}
Code:
if(Crew.GetCrewTotalNumber()>0)
{
THRUSTER_HANDLE hdltwo = NULL;
hdltwo=GetThrusterHandleByIndex(3);
CreateThrusterGroup (hdltwo, 1, THGROUP_MAIN);
}
Should I been disabling the main engines in the fashion I have or am I just missing something in the reenabling?
I don't know if it's relevant but the above code is inserted into the UmmuSample.cpp that come with the UmmuSDK rather than my ship.cpp