This is my first MFD also. Thought I would start a new thread for it. It is a MFD to allow a vessel to travel from one location to another location at a high rate of time/speed. Of course it is Science fiction. But it is based off ideas from several TV shows.
I supposed the idea is to use worm holes. There are a couple of MFD's addon's that do Warp or Jump drive. BUT for traveling from one location to another on the same planet. They don't work. I understand why. The curve of the planet gets in the way.
Thanks to Face and meson800 I was able to make a SIMPLE babystep version.
Basically you enters a target vessel and it places your ship at the selected target location.
What I want and I am asking help is to be able to do the same but be able to choose a base rather than a vessel
2 be able to calculate the distance between the selected base and your vessel.
---------- Post added 07-19-14 at 08:44 AM ---------- Previous post was 07-18-14 at 07:54 PM ----------
I have access to RWarp code which allows one to select the base.
So here you open and input box and enter the planet and then base. I understand that. But it is the instance[gmfdFocus], don't get.
I supposed the idea is to use worm holes. There are a couple of MFD's addon's that do Warp or Jump drive. BUT for traveling from one location to another on the same planet. They don't work. I understand why. The curve of the planet gets in the way.
Thanks to Face and meson800 I was able to make a SIMPLE babystep version.
Basically you enters a target vessel and it places your ship at the selected target location.
What I want and I am asking help is to be able to do the same but be able to choose a base rather than a vessel
2 be able to calculate the distance between the selected base and your vessel.
Code:
void IDDRIVE::MOVEVESSEL(void)
{
OBJHANDLE targetHandle = oapiGetObjectByName(targetName); // gets the handle of target
if (targetHandle != NULL) //checks to make sure we have a valid vessel
{
VESSEL *v = oapiGetVesselInterface(targetHandle); //gets interface of target
VESSELSTATUS2 status;
status.flag = 0;
status.version = 2;
v->GetStatusEx(&status);
VESSEL *v2 = oapiGetFocusInterface();
v2->DefSetStateEx(&status);
}
}
---------- Post added 07-19-14 at 08:44 AM ---------- Previous post was 07-18-14 at 07:54 PM ----------
I have access to RWarp code which allows one to select the base.
Code:
bool cbSelectPlanet(void *id, char *str, void *usrdata)
{
instance[gmfdFocus].PlanetRef=oapiGetGbodyByName(str);
if(instance[gmfdFocus].PlanetRef!=0)
{
oapiOpenInputBox("Select Base", cbSelectBase, 0, 20, 0);
}
return true;
}
bool cbSelectBase(void *id, char *str, void *usrdata)
{
instance[gmfdFocus].BaseRef=oapiGetBaseByName(instance[gmfdFocus].PlanetRef, str);
return true;
}
So here you open and input box and enter the planet and then base. I understand that. But it is the instance[gmfdFocus], don't get.