0 Members and 1 Guest are viewing this topic.
MBA3:MOONBASEALPHA STATUS Orbiting Earth RPOS 6988759.71 0.00 520439.77 RVEL -560.064 -0.000 7520.861 AROT 0.00 0.00 0.00 NAVFREQ 0 0 XPDR 0 DT1 0 0.0000 DT2 0 0.0000 DT3 0 0.0000 DT4 0 0.0000 DT5 0 0.0000 DT1D 0 0.0000 DT2D 0 0.0000 DT3D 0 0.0000 DT4D 0 0.0000 DT5D 0 0.0000 LP1 0 0.0000 LP2 0 0.0000 LP3 0 0.0000 LP4 0 0.0000 LP5 0 0.0000 UMMUCREW ¦›Ä_°²"@“:M„z}@I.ÿ!ýze@¦›Ä_°²"@“:M„z}@-Â&SNyÀ¦›Ä_°²"@§èH.ÿp@Â&SNyÀ¦›Ä_°²"@§èH.ÿp@I.ÿ!ýze@¦›Ä_°²"@“:M„z}@I.ÿ!ýze@¦›Ä_°²"@“:M„z}@-776530087-1081083135-171 UMMUCREW Eng-“:M„z}@I.ÿ!ýze@¦›Ä_°²"@“:M„z}@-27-67-55 UMMUCREW Doc-George_HealGood-15-70-45 UMMUCREW -Albert_Jr_Falcon-15-70-45END
//-------------------------------------------------------------- // AddCrewMember // We'll add four default members for when the ship is spawned by Orbiter's scenario editor. // parameters are name, age, cardiac pulse,weight (in kilogramm) and Function (Misc ID) // max four characters wich define the spacesuit used. (see UmmuMiscID in UMuSDK.h header) // Return 1 on success -1 on error (probably vessel full, name>25 char // age, pulse or weight out of realistic range or MiscID>4 char) Crew.AddCrewMember("Peter Falcon",41,65,74,"Capt"); //(for name and id a-z A-Z 0-9 characters only) Crew.AddCrewMember("Fanny Gorgeous",27,67,55,"Eng"); //(for name and id a-z A-Z 0-9 characters only) Crew.AddCrewMember("George HealGood",15,70,45,"Doc"); //(for name and id a-z A-Z 0-9 characters only) Crew.AddCrewMember("Albert Jr Falcon",15,70,45); //(for name and id a-z A-Z 0-9 characters only) SelectedUmmuMember =0; // our current selected member
void MOONBASEALPHA::clbkSaveState(FILEHANDLE scn){char cbuf[256]; // ORBITER, default vessel parameters SaveDefaultState (scn); // UMmu, this will save all our members of crew in scenario // as airlock state depend of your ship (you may have a real animated airlock) // it's your responsabilites to save and reload UMmu's airlock state.// Crew.SaveAllMembersInOrbiterScenarios(scn);sprintf (cbuf, "%d %0.4f", DT1_status, DT1_proc); oapiWriteScenario_string (scn, "DT1", cbuf); sprintf (cbuf, "%d %0.4f", DT2_status, DT2_proc); oapiWriteScenario_string (scn, "DT2", cbuf); sprintf (cbuf, "%d %0.4f", DT3_status, DT3_proc); oapiWriteScenario_string (scn, "DT3", cbuf); sprintf (cbuf, "%d %0.4f", DT4_status, DT4_proc); oapiWriteScenario_string (scn, "DT4", cbuf); sprintf (cbuf, "%d %0.4f", DT5_status, DT5_proc); oapiWriteScenario_string (scn, "DT5", cbuf); sprintf (cbuf, "%d %0.4f", DT1D_status, DT1D_proc); oapiWriteScenario_string (scn, "DT1D", cbuf); sprintf (cbuf, "%d %0.4f", DT2D_status, DT2D_proc); oapiWriteScenario_string (scn, "DT2D", cbuf); sprintf (cbuf, "%d %0.4f", DT3D_status, DT3D_proc); oapiWriteScenario_string (scn, "DT3D", cbuf); sprintf (cbuf, "%d %0.4f", DT4D_status, DT4D_proc); oapiWriteScenario_string (scn, "DT4D", cbuf); sprintf (cbuf, "%d %0.4f", DT5D_status, DT5D_proc); oapiWriteScenario_string (scn, "DT5D", cbuf); sprintf (cbuf, "%d %0.4f", LP1_status, LP1_proc); oapiWriteScenario_string (scn, "LP1", cbuf); sprintf (cbuf, "%d %0.4f", LP2_status, LP2_proc); oapiWriteScenario_string (scn, "LP2", cbuf); sprintf (cbuf, "%d %0.4f", LP3_status, LP3_proc); oapiWriteScenario_string (scn, "LP3", cbuf); sprintf (cbuf, "%d %0.4f", LP4_status, LP4_proc); oapiWriteScenario_string (scn, "LP4", cbuf); sprintf (cbuf, "%d %0.4f", LP5_status, LP5_proc); oapiWriteScenario_string (scn, "LP5", cbuf); Crew.SaveAllMembersInOrbiterScenarios(scn);}///////////////////////////////////////////////////////////////////////////////////////////// clbkLoadStateEx function of Orbiter - Load Orbiter scenario !REQUIRED!// ---------------// Here we'll reload all crew member of our ship.// notice the function will ERASE all defaults member set in clbkSetClassCaps.// If you really want to add default crew add them also in this fonction after loading// (when a ship is spawned by editor anyway this fonction below is never called)///////////////////////////////////////////////////////////////////////////////////////////void MOONBASEALPHA::clbkLoadStateEx (FILEHANDLE scn, void *status){ char *line; while (oapiReadScenario_nextline (scn, line)) { // UMMU, Load all saved member from scenario. // Return TRUE when a "UMMUCREW" line is encountered // FALSE when it must pass this line to you or default parser if(Crew.LoadAllMembersFromOrbiterScenario(line)==TRUE) continue; if (!_strnicmp (line, "DT1", 3)) { sscanf (line+3, "%d%lf", &DT1_status, &DT1_proc); } if (!_strnicmp (line, "DT2", 3)) { sscanf (line+3, "%d%lf", &DT2_status, &DT2_proc); } if (!_strnicmp (line, "DT3", 3)) { sscanf (line+3, "%d%lf", &DT3_status, &DT3_proc); } if (!_strnicmp (line, "DT4", 3)) { sscanf (line+3, "%d%lf", &DT4_status, &DT4_proc); } if (!_strnicmp (line, "DT5", 3)) { sscanf (line+3, "%d%lf", &DT5_status, &DT5_proc); } if (!_strnicmp (line, "DT1D", 4)) { sscanf (line+4, "%d%lf", &DT1D_status, &DT1D_proc); } if (!_strnicmp (line, "DT2D", 4)) { sscanf (line+4, "%d%lf", &DT2D_status, &DT2D_proc); } if (!_strnicmp (line, "DT3D", 4)) { sscanf (line+4, "%d%lf", &DT3D_status, &DT3D_proc); } if (!_strnicmp (line, "DT4D", 3)) { sscanf (line+4, "%d%lf", &DT4D_status, &DT4D_proc); } if (!_strnicmp (line, "DT5", 3)) { sscanf (line+4, "%d%lf", &DT5D_status, &DT5D_proc); } if (!_strnicmp (line, "LP1", 3)) { sscanf (line+3, "%d%lf", &LP1_status, &LP1_proc); } if (!_strnicmp (line, "LP2", 3)) { sscanf (line+3, "%d%lf", &LP2_status, &LP2_proc); } if (!_strnicmp (line, "LP3", 3)) { sscanf (line+3, "%d%lf", &LP3_status, &LP3_proc); } if (!_strnicmp (line, "LP4", 3)) { sscanf (line+3, "%d%lf", &LP4_status, &LP4_proc); } if (!_strnicmp (line, "LP5", 3)) { sscanf (line+3, "%d%lf", &LP5_status, &LP5_proc); } // ORBITER, unrecognised option - pass to Orbiter's generic parser ParseScenarioLineEx (line, status); }SetAnimation (anim_LP1, LP1_proc);SetAnimation (anim_LP2, LP2_proc);SetAnimation (anim_LP3, LP3_proc);SetAnimation (anim_LP4, LP4_proc);SetAnimation (anim_LP5, LP5_proc);SetAnimation (anim_DT1, DT1_proc);SetAnimation (anim_DT2, DT2_proc);SetAnimation (anim_DT3, DT3_proc);SetAnimation (anim_DT4, DT4_proc);SetAnimation (anim_DT5, DT5_proc);SetAnimation (anim_DT1DOOR1A, DT1D_proc);SetAnimation (anim_DT1DOOR2A, DT1D_proc);SetAnimation (anim_DT2DOOR1A, DT2D_proc);SetAnimation (anim_DT2DOOR2A, DT2D_proc);SetAnimation (anim_DT3DOOR1A, DT3D_proc);SetAnimation (anim_DT3DOOR2A, DT3D_proc);SetAnimation (anim_DT4DOOR1A, DT4D_proc);SetAnimation (anim_DT4DOOR2A, DT4D_proc);SetAnimation (anim_DT5DOOR1A, DT5D_proc);SetAnimation (anim_DT5DOOR2A, DT5D_proc); // as airlock state depend of your ship (you may have a real animated airlock) // it's your responsabilites to save and reload UMmu airlock state and set it accordingly // to your airlock. IE: call here "SetAirlockDoorState" TRUE of FALSE depend // of your animated airlock}