Tell her to kill Bill!
:lol: Ironically, those movies are on TNT tonight.
Tell her to kill Bill!
static UINT groups[2] = {34, 35};
static MGROUP_ROTATE gravwheel (0,groups, 2,_V(0,-20,0),_V(0,0,1),(float)(360*RAD));
anim_grav = CreateAnimation(0.0);
AddAnimationComponent (anim_grav, 0, 1, &gravwheel);
//constructor
Explorer::Explorer(OBJHANDLE hVessel, int flightmodel)
:VESSEL3(hVessel, flightmodel)
{
gravwheel_status = WHEEL_STOPPED;
gravwheel_proc = 0.0;
DefineAnimations();
}
enum gravwheel_status {WHEEL_STOPPED, WHEEL_STARTED};
double gravwheel_proc;
UINT anim_grav;
I just need a good example of the animation code needed in order to get this down (not wanting it all written for me, just something clear to go by) .
Oh I say, that worked splendidly! Thanks ol' chap! :tiphat:Make sure you have spacecraft3 installed along with the 2006P1 patch. Then just change the ship definition in the scenario from agamemnon:Spacecraft\Spacecraft to agamemnon:Spacecraft\Spacecraft3 and Bob's your uncle.
**Update** Back from my business travel. Between getting caught up from work, and things going on at home, hope to have some time soon to get back at this, but it may be a while. If anyone is interested in helping, I can pass you the C++ code if you want to have a look.
What about uploading it on lets say, github and turn it into a Babylon 5 add-on project?
https://github.com/
http://git-scm.com/
gravwheel_status = WHEEL_STOPPED;
enum gravwheel_status {WHEEL_STOPPED, WHEEL_SPINNING} ;
Finally taking another crack at the grav wheel animation code on this boat. I'm still lost. Trying to set the following:
in the constructor. IntelliSense is crying that it expected an identifier.Code:gravwheel_status = WHEEL_STOPPED;
I have the following declared earlier:
Any ideas what I'm missing?Code:enum gravwheel_status {WHEEL_STOPPED, WHEEL_SPINNING} ;
Thanks,
n122vu
enum Wheel_Status {WHEEL_STOPPED, WHEEL_SPINNING} gravwheel_status;
...
gravwheel_status = WHEEL_STOPPED;
1 IntelliSense: argument of type "char *" is incompatible with parameter of type "LPCWSTR"
void Explorer::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC)
{
// draw the default HUD
VESSEL2::clbkDrawHUD (mode, hps, hDC);
// UMmu display messages
if(dHudMessageDelay>0)
{
TextOut (hDC,5,hps->H/60*15,cUmmuHudDisplay,strlen(cUmmuHudDisplay));
dHudMessageDelay-=oapiGetSimStep();
if(dHudMessageDelay<0)
dHudMessageDelay=0;
}
}
Your project has Unicode selected as default, you should use Multibyte. That is why it expects all system calls to be based on wchar_t instead of char.
Yes. Here's the code for the callback:Do you call the default handler for the HUD painting in your DrawHUD function?
void Explorer::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC)
{
// draw the default HUD
VESSEL2::clbkDrawHUD (mode, hps, hDC);
// UMmu display messages
if(dHudMessageDelay>0)
{
TextOut (hDC,5,hps->H/60*15,cUmmuHudDisplay,strlen(cUmmuHudDisplay));
dHudMessageDelay-=oapiGetSimStep();
if(dHudMessageDelay<0)
dHudMessageDelay=0;
}
}
int Explorer::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
if (!down) return 0; // only process keydown events
if(key==OAPI_KEY_M&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
{
AddUMmuToVessel(TRUE);
}
// Ummu Key "E" perform the EVA of the selected member
//
if(key==OAPI_KEY_E&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
{
// PERFORM THE EVA
int Returned=Crew.EvaCrewMember(Crew.GetCrewNameBySlotNumber(iSelectedUmmuMember));
// we provide feedback to user (You can display a message on panel or wathewer)
// here below all the return code possible:
switch(Returned)
{
case TRANSFER_TO_DOCKED_SHIP_OK:
sprintf(SendHudMessage(),"Transfer to docked ship Ok - %s transfered",
Crew.GetLastEvaedCrewName());iSelectedUmmuMember=0;
break;
case EVA_OK:
sprintf(SendHudMessage(),"EVA OK - %s left the ship",
Crew.GetLastEvaedCrewName());iSelectedUmmuMember=0;
break;
case ERROR_NO_ONE_ON_BOARD:
strcpy(SendHudMessage(),"Error, no one on board, unable to EVA");
break;
case ERROR_AIRLOCK_CLOSED:
strcpy(SendHudMessage(),"Error, airlock is closed, unable to EVA");
break;
case ERROR_DOCKED_SHIP_HAVE_AIRLOCK_CLOSED:
strcpy(SendHudMessage(),"Error, docked ship's airlock is closed, unable to transfer");
break;
case ERROR_DOCKED_SHIP_IS_FULL:
strcpy(SendHudMessage(),"Error, docked ship is already full transfer failed");
break;
case ERROR_CREW_MEMBER_NOT_FOUND:
strcpy(SendHudMessage(),"Error, no crew by this name in ship");
break;
case ERROR_DOCKEDSHIP_DONOT_USE_UMMU:
strcpy(SendHudMessage(),"Error, docked ship do not use UMmu 2.0, ask author to add it");
break;
case ERROR_MISC_ERROR_EVAFAILED:
strcpy(SendHudMessage(),"Misc error with UMMU install it again");
break;
}
return TRUE;
}
//---------------------------------------------------------------------------
// Ummu Key "1" Select next member This is just internal to the demo
// you may do your own selection system by panel button, name etc etc
if(key==OAPI_KEY_1&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
{
// we test there is someone aboard
if(Crew.GetCrewTotalNumber()==0)
{
strcpy(SendHudMessage(),"Sorry no one aboard unable to select");
return 1;
}
// we test that we select existing member
if(iSelectedUmmuMember<Crew.GetCrewTotalNumber()-1)
iSelectedUmmuMember++;
char * Name=Crew.GetCrewNameBySlotNumber(iSelectedUmmuMember);
sprintf(SendHudMessage(),"Slot %i %s \"%s\" aged %i Selected for EVA or Transfer, please press \"E\" to EVA",
iSelectedUmmuMember,Crew.GetCrewMiscIdBySlotNumber(iSelectedUmmuMember),
Name,Crew.GetCrewAgeBySlotNumber(iSelectedUmmuMember));
return 1;
}
//---------------------------------------------------------------------------
// Ummu Key "2" Select previous member This is just internal to the demo
// you may do your own selection system by panel button
if(key==OAPI_KEY_2&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
{
// we test there is someone aboard
if(Crew.GetCrewTotalNumber()==0)
{
strcpy(SendHudMessage(),"Sorry no one aboard unable to select");
return 1;
}
if(iSelectedUmmuMember>0)
iSelectedUmmuMember--;
char * Name=Crew.GetCrewNameBySlotNumber(iSelectedUmmuMember);
sprintf(SendHudMessage(),"Slot %i %s \"%s\" aged %i Selected for EVA or Transfer"
", please press \"E\" to EVA",iSelectedUmmuMember,
Crew.GetCrewMiscIdBySlotNumber(iSelectedUmmuMember),Name,
Crew.GetCrewAgeBySlotNumber(iSelectedUmmuMember));
return 1;
}
//---------------------------------------------------------------------------
// Ummu Key "A" Switch the virtual UMMU airlock door on/off
if(key==OAPI_KEY_A&&!KEYMOD_SHIFT(kstate)&&!KEYMOD_CONTROL (kstate))
{
// switch state
Crew.SetAirlockDoorState(!Crew.GetAirlockDoorState());
// display state
if(Crew.GetAirlockDoorState()==TRUE)
strcpy(SendHudMessage(),"Airlock is now open");
else
strcpy(SendHudMessage(),"Airlock is now closed");
return 1;
}
//---------------------------------------------------------------------------
// Get some infos Name of ship and total soul aboard
if(key==OAPI_KEY_S)
{
sprintf(SendHudMessage(),"%i souls aboard ship %s",
Crew.GetCrewTotalNumber(),GetName());
return 1;
}
switch (key) {
case OAPI_KEY_K: //Wheel
if (gravwheel_run == 0) // check to see if wheel is stopped
{
gravwheel_run = 1; //set run variable to 1 if wheel is stopped
return 1;
}
if (gravwheel_run == 1) // check to see if wheel is running
{
gravwheel_run = 0;
return 1;
}
return 0;
}
}