See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Adding Ummu to a vessel  (Read 2779 times)

0 Members and 1 Guest are viewing this topic.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
27 April 2008, 12:55:45
I decided this was more  what the issue was rather than the sdk example not compiling.

I am trying to add Ummu to my Vessel ML.

I have tried 2 ways one to transfer the UMMU example info into my ML.cpp code and make changes like ShuttlePB to ML.
Comiled but I got a message that stated that I needed to reinstall UMMU.

The other way was to link the Ummu example changing ShurttlePB to ML. but then I get these:
I know it is because my vessel using these functions also.
UMmuExample.obj : error LNK2005: "public: virtual void __thiscall ML::clbkPostStep(double,double,double)"
(?clbkPostStep@ML@@UAEXNNN@Z) already defined in ML.obj
UMmuExample.obj : error LNK2005: "public: virtual int __thiscall ML::clbkConsumeBufferedKey(unsigned long,bool,char *)"
(?clbkConsumeBufferedKey@ML@@UAEHK_NPAD@Z) already defined in ML.obj
UMmuExample.obj : error LNK2005: "public: virtual void __thiscall ML::clbkVisualCreated(void *,int)"
(?clbkVisualCreated@ML@@UAEXPAXH@Z) already defined in ML.obj
   Creating library .\..\..\..\Modules/ShuttlePB.lib and object .\..\..\..\Modules/ShuttlePB.exp


Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #1 - 27 April 2008, 16:18:10
Huh? It seems like you have defined things twice. Please post your cpp.


------------

no matter.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #2 - 27 April 2008, 19:50:44
Ok I'm not sure.  What I did was to link the UmmU example cpp and change the vessel from Shuttlepb to ML.  My vessel.
so you get this:  I had to change the ShuttlePB to ML because  that ShuttlePb is not a class.
If I copy pieces from this example and add it into my vessel cpp the Ummu doesn't work as I get that error to reinstall.

So I'm not sure how to add this to my vessel




this is just the first part:
#include "ML.h"
///////////////////////////////////////////////////////////////////////////////////////////
//
// WELCOME IN Universal MMU SDK 1.5 EXAMPLE (©Daniel Polli aka Dansteph - Orbiter part ©Martin Schweiger)
// ****************************************
//
// Coding and Using UMmu in your addon is pretty simple, just follow careffuly what is done below
// and do the same in your project, code is fully commented. For more details about each function
// and to find more usefull functions not listed here see "UMMuSDK.h" header.
//
// HOW TO USE THIS EXAMPLE ?
// *************************
// Copy the whole folder "UMmu_ShutllePB_Example" into "sample" directory of Orbiter SDK
// load project in VC++.
// At compilation it will create a "UMmuML.dll" in release or debug format that
// you must copy to "modules" directory of Orbiter. Use the scenario "_UMmu_SDK_Demo"
// to see your change.
//
// HOW TO USE UMMU SDK IN YOUR PROJECT ?
// *************************************
// include "UMmuSDK.lib" and "UMmuSDK.h" in your project declare header with "#include UMmuSDK.h" call initialisation
// functions, add members to your crew, use Information function to let the user select wich member
// he select and eva on panel or by key and you're set. See "UMmu_ML_Example" example distributed with
// this SDK, it have a lot of complete comment.
//
// Have fun,
//
// DanSteph March 2007
// http://orbiter.dansteph.com
//
///////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////////
// clbkSetClassCaps function of Orbiter !REQUIRED!
// ----------------
// This code below SHOULD be put in "clbkSetClassCaps" Orbiter's function of your vessel
// I made here a separate function called by "clbkSetClassCaps" for more readability.
//
// initialisation of Ummu goes here
// the Ummu class variable "Crew" must be declared in your vessel's class body.
// (see ML.h "UMMUCREWMANAGMENT Crew;")
///////////////////////////////////////////////////////////////////////////////////////////
void ML::clbkSetClassCaps_UMMu(void)
{
   //--------------------------------------------------------------
   // InitUmmu
   // initialisation of Ummu must be done first ! return of 1 mean OK
   // return of -999 mean Ummu addon is not installed in user's Orbiter, return of -1
   // mean misc error. If error simply all function will fail silently
   // and there will be no MMu. It's a good idea to warn the user. (see bottom of listing "clbkVisualCreated")
   UmmuSdKInitReturnCode=Crew.InitUmmu(GetHandle());   
   //--------------------------------------------------------------

   //--------------------------------------------------------------
   // GetUserUMmuVersion
   // this check wich version of UMmu addon the user have in his orbiter directory.
   // this may be usefull for future version with more function so you can check
   // if user installation support the new functions. Return -1 on error (not installed, version cannot be read)
   // or version number in float value (ie: 1.5="1.5" version etc etc)
   float UMmuVersion=Crew.GetUserUMmuVersion();

   //--------------------------------------------------------------
   // DefineAirLockShape
   // We set the airlock shape and state, this virtual box will be the one
   // into were a Ummu asking to reenter will be taken in account
   // first parameter is airlock door state (OPEN=TRUE) and other are X,X1,Y,Y1 and Z,Z1
   // min and max coordinate for this virtual box (vessel local coordinate)
   // Pay attention to reenter when landed (if suitable) and make the box large enough so
   // it's not a pain for the user to find airlock's entry.
   Crew.DefineAirLockShape(TRUE,-1,1,-1,3,-2,4);         // Airlock open, 2 meter large 4 meter high 6 meter long (vessel local
coordinate)

   //--------------------------------------------------------------
   // SetMembersPositionOrientationOnEVA
   // We define here were the Ummu will appear when they make an EVA
   // first parameter is position second is orientation, take care not to make
   // them appear to high on ground (will fall and die) or to low (Orbiter "light speed" bug)
   Crew.SetMembersPosRotOnEVA(_V(0,0,3),_V(0,0,0));   // 3 meters in front of ship (z) facing direction of ship (vessel local
coordinate)

   //---------------------------------------------------------------
   // finally set the maximum seat available in this ship, default is
   // 8 but it can go from 1 to 100
   // BAD IDEA: using this to "close" your ship, use "SetAirlockDoorState" instead.
   Crew.SetMaxSeatAvailableInShip(4);

   //------------------------------------------------------------------
   // IMPORTANT
   // at this point Ummu is ready to be used (appart save/load see below "clbkSaveState" "clbkLoadStateEx")
   // we'll add below some >default< crew member for when the ship is spawned by Orbiter's
   // scenerio editor. (As there is no "scn" scenario loading in this case, your ship would have no crew)
   // pay attention that if a scenario is loaded the members added here will be deleted first.
   // You can also add new members at any time during runtime.
   // IDEA: Make here a selection of random name, crew, number age, etc etc. Up to you,
   // each scenario created dynamically would have then a different crew.
   //------------------------------------------------------------------

   //--------------------------------------------------------------
   // AddCrewMember
   // We'll add four members, parameters are name, age, cardiac pulse,weight (in kilogramm)
   // notice a fourth optional parameter exist wich allow you to set misc data of
   // max four characters, usefull if you want to distinguish your members for any purpose
   // (eg: "Capt"=captain "Eng" =engineer "UK" nationality etc etc)
   // You can add up to 100 crew members in your ship, take care your Vessel's empty mass will be updated
   // automatically with crew's weight (you can disable this feature see 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)
   // IDEA: Use the MiscID parameter to EVA with different spacesuit (captain,girl,english people etc etc)
   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)

   // this variables below are used by the simple user text interface used in this demo
   // see function "SendFocusScreenMessage" below for explaination.
   strcpy(cOurMessage,"");
}

« Last Edit: 27 April 2008, 20:26:56 by gattico »

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #3 - 27 April 2008, 20:26:56
I presume your ML.cpp has already a clbkPostStep, a clbkConsumeBufferedKey and a clbkVisualCreated so if you add directly UMMU_example.cpp to your solution, these clbk are defined twice that's why the compiler gives you LNK2005 errors.



Message modifié ( 27-04-2008 20:28 )

« Last Edit: 27 April 2008, 20:26:56 by no matter »
------------

no matter.