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 messages in ummu2.0  (Read 3878 times)

0 Members and 1 Guest are viewing this topic.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
22 September 2010, 15:21:40
I have a sequence of doors that I need top open/close.
Code: [Select]
if(ActionAreaReturnCode==0)
{
if (DOOR2_proc==0){
//OUTERAIRLOCK
RevertOUTERAIRLOCK();}
if (DOOR2_proc>0)
strcpy(SendHudMessage(),"Inner Airlock Open");

}

So if door2 is closed Door2_proc==0 then open the door.  but if the door is open (DOOR2_proc>0) then don't open the door but display the message "Inner Airlock Open"


The sequence works I just need the message to display .  I get this message
Crew.DeclareActionArea(0,_V(  66.2794,0,-11.61512),3,TRUE,"action_door.wav","Outer Airlock Active");  but the animation does not work which is good.


Offline Bibi Uncle

  • Legend
  • ******
  • Posts: 2264
  • Country: Canada ca
  • Karma: 17
Reply #1 - 22 September 2010, 23:23:45
I'm not quite sure to understand your program when you do this :

Code: [Select]
strcpy(SendHudMessage(),"Inner Airlock Open");
strcpy copy "Inner Airlock Open" in SendHudMessage(). But SendHudMessage is a function, not a character table (I don't how you say this in English. I talk about something like "char cText[256]".

Why don't you simply write SendHudMessage("Inner Airlock Open"); ?


Émile

Pluton, Saturne et Jupiter
Entendez-vous monter vers vous le chant de la Terre?

- Luc Plamondon

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #2 - 23 September 2010, 04:54:35




Thanks I did this:

Code: [Select]
if((ActionAreaReturnCode==0)&&(DD1_proc>0))
{

SendHudMessage("Inner Airlock Open");
}


but get this error
.\TPAD.CPP(352) : error C2660: 'TPAD::SendHudMessage' : function does not take 1 arguments


Quote
Bibi Uncle wrote:
I'm not quite sure to understand your program when you do this :

Code: [Select]
strcpy(SendHudMessage(),"Inner Airlock Open");
strcpy copy "Inner Airlock Open" in SendHudMessage(). But SendHudMessage is a function, not a character table (I don't how you say this in English. I talk about something like "char cText[256]".

Why don't you simply write SendHudMessage("Inner Airlock Open"); ?



Offline Bibi Uncle

  • Legend
  • ******
  • Posts: 2264
  • Country: Canada ca
  • Karma: 17
Reply #3 - 23 September 2010, 23:11:52
Sorry, I completely miss myself with the Orbiter API. This is a UMMu function.

I look a bit on the web (because I don't have any UMMu add-on for now and my HD is full) and I found out that what you did is good. http://orbiter-forum.com/showthread.php?p=206004

The function is a bit weird, but it works like that.

Where do you have this message : Crew.DeclareActionArea(0,_V( 66.2794,0, 11.61512),3,TRUE,"action_door.wav","Outer Airlock Active"); ?

In the HUD, a DebugString (little white rectangle at the bottom of the screen) or something else ?


Émile

Pluton, Saturne et Jupiter
Entendez-vous monter vers vous le chant de la Terre?

- Luc Plamondon

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #4 - 24 September 2010, 03:30:38
Quote
Bibi Uncle wrote:
Sorry, I completely miss myself with the Orbiter API. This is a UMMu function.

I look a bit on the web (because I don't have any UMMu add-on for now and my HD is full) and I found out that what you did is good. http://orbiter-forum.com/showthread.php?p=206004

The function is a bit weird, but it works like that.

Where do you have this message : Crew.DeclareActionArea(0,_V( 66.2794,0, 11.61512),3,TRUE,"action_door.wav","Outer Airlock Active"); ?

In the HUD, a DebugString (little white rectangle at the bottom of the screen) or something else ?


Here you go
Code: [Select]
void TPAD::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 function "WarnUserUMMUNotInstalled" below)
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: 2.0="2.0" 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. (See PDF doc)
Crew.DefineAirLockShape(FALSE,20,40,-1,3,-3,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(22.5,.76,1.1),_V(0,-1.5,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(25);

//----------------------------------------------------------------
// OPTIONAL OPTIONAL OPTIONAL OPTIONAL OPTIONAL OPTIONAL OPTIONAL
// DeclareActionArea
// Ever wanted to be able to open a door, repair a system or trigger something in your vessel from an UMMU ?
// Here come a new feature of UMMU 2.0: Action area. See UMmuSDK.h and PDF doc for complete explanation and see
// "DetectActionAreaActivated" below.
Crew.DeclareActionArea(0,_V( 25.837,0,-.344),3,TRUE,"action_door.wav","Outer Airlock Active");
Crew.DeclareActionArea(1,_V(   19.079 ,0, -.344),2,TRUE,"action_door.wav","Inner Airlock Active");
Crew.DeclareActionArea(2,_V(   9.93,0,0),6,TRUE,"action_door.wav","Travel Tube Doors Active");

//Crew.DeclareActionArea(3,_V(0,0,-5),2.5,TRUE,"action_activated.wav","You are behind the ship");
//iActionAreaDemoStep=0; // this is just to show a feature of action area, see below "DetectActionAreaActivated"

//--------------------------------------------------------------
// 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


// The HUD display method variables, see PDF doc
cUmmuHudDisplay[0] =0; // Initialisation of UMmu hud char variable
dHudMessageDelay =0; // Initialisation of UMmu delay variable
strcpy(SendHudMessage(),"Welcome aboard ! E=EVA 1,2=select UMmu D=Open/Close airlock S=info M=add crew");

// The Add mmu without scenery editor variable see PDF doc
cAddUMmuToVessel[0]=0;
}


Offline Bibi Uncle

  • Legend
  • ******
  • Posts: 2264
  • Country: Canada ca
  • Karma: 17
Reply #5 - 26 September 2010, 15:19:35
Well, it's not your message that create the bug because Dan use the same technic. It's sopmewhere else in your code.

What represents your variable DOOR2_proc ?


Émile

Pluton, Saturne et Jupiter
Entendez-vous monter vers vous le chant de la Terre?

- Luc Plamondon

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #6 - 30 September 2010, 04:28:46
DOOR2_proc is the animation state of the inner door.  So if the door is closed the DOOR2_proc is 0.