C++ Question Orbiter Custom Sound error 4.0 Help?

tauruslittrow84

New member
Joined
Nov 12, 2011
Messages
58
Reaction score
0
Points
0
Ok, I'm trying to have two custom sounds to play, one when pressing the "1" key while the solar panels are opening, another with the "2" key as my radarflag is spinning. I am running OrbiterSound 4.0 the 2 waves are mono , 22500Mhz and pay no attention to the "are you crazy" >than 8MB wav or hover wav. They both play fine and are not above 8MB anyway...don't know what that's about: says "mypanelopening.wav" and "radflagstart.wav" are missing....and it looks like directory structure...but I DONT THINK SO...my directories simply go orbiter//Sound//_CustomVesselsSounds//Chippersat//mypanelopening.wav etc. of course I don't include "orbiter" at the beginning....These wav's aren't missing....HELP?

.h file
Code:
#ifndef __chippersat_H
#define __chippersat_H

 
#include "orbitersdk.h"
#include "payloadmanager.h"
#include "resource.h"

int CHIPSATID;
#define CHIPSATPanels 56
#define CHIPSATRadflag 57
// ==============================================================
// Some parameters and capabilities
// ==============================================================

 
const double SOLARPANEL_OPERATING_SPEED = 0.025;
const double RADARFLAG_OPERATING_SPEED = 1.500;
 

// ==============================================================
// chippersat class interface
// ==============================================================

class chippersat: public VesselWithPM<chippersat> {
public:
	enum DoorStatus { DOOR_CLOSED, DOOR_OPEN, DOOR_CLOSING, DOOR_OPENING } pan_status, radarflag_status;
	chippersat (OBJHANDLE hObj, int fmodel);
	void DefineAnimations (void);
	void ActivateSolarPanels (DoorStatus action);
	void RevertSolarPanels (void);
	void ActivateRadarflag (DoorStatus action);
	void RevertRadarflag (void);
	 

	// Overloaded callback functions
	void clbkSetClassCaps (FILEHANDLE cfg);
	void clbkLoadStateEx (FILEHANDLE scn, void *vs);
	void clbkSaveState (FILEHANDLE scn); 
	void clbkPostStep (double simt, double simdt, double mjd); 
	int  clbkConsumeBufferedKey (DWORD key, bool down, char *kstate);
	int  clbkGeneric (int msgid, int prm, void *context); 
	void PM_clbkPayloadJettisoned (int slot_idx, OBJHANDLE jettisoned_ship);
	void PM_clbkVehicleCapsChanged();


bool shouldAnimateTheThing;
private:
    void DefineThrusters();
	void Test();
	UINT anim_pan, anim_radarflag;
    char j_name[32];
	double j_timer;
	double pan_proc, radarflag_proc;

 

	// script interface-related methods, implemented in HST_Lua.cpp
	int Lua_InitInterpreter (void *context);
	int Lua_InitInstance (void *context);
};

#endif // !__chippersat_H
.cpp file
Code:
#define ORBITER_MODULE
#include "chippersat.h" 
#include "Orbitersdk.h" 
#include "payloadmanager.h"
#include "ScnEditorAPI.h"
#include "DlgCtrl.h"
#include "resource.h"
#include <math.h>
#include <stdio.h>
#include "OrbiterSoundSDK40.h"

// ==============================================================
// chippersat class implementation
// ==============================================================

// --------------------------------------------------------------
// Constructor
// --------------------------------------------------------------
chippersat::chippersat (OBJHANDLE hObj, int fmodel)
: VesselWithPM (hObj, fmodel)
{
	shouldAnimateTheThing = false;
	pan_proc = 0.0;
	pan_status = DOOR_CLOSED;
	radarflag_proc = 0.0; 	 
	DefineAnimations (); 
	j_name[0]	= '\0';
	j_timer		= 0;
}

 

void chippersat::PM_clbkPayloadJettisoned(int slot_idx, OBJHANDLE jettisoned_ship)
{
 

	oapiGetObjectName(jettisoned_ship, j_name, 32);
	j_timer = -5;
}

void chippersat::PM_clbkVehicleCapsChanged()
{
	//Here you can make some action on vehicle's capabilities change
}
 

//

// --------------------------------------------------------------
// Define animation sequences for moving parts
// --------------------------------------------------------------
void chippersat::DefineAnimations (void)
{
	// 1. SolarPanels
	 ANIMATIONCOMPONENT_HANDLE parent1,parent2; 
 
    static UINT  mgroup_pan1arm[1] = {2};  //PANEL with arm
	static MGROUP_ROTATE pan1arm (0, mgroup_pan1arm, 1,
        _V( 1.963894, -.1012674, 0.32498 ), _V(0, 0, -1), (float)(PI*.49));
    static UINT mgroup_pan2arm[1] = {4};  //PANEL with arm
    static MGROUP_ROTATE pan2arm (0, mgroup_pan2arm, 1,
        _V(-2.443835, -.294106, 5.080731), _V(0, 0, -1), (float)(PI*.46));
    static UINT mgroup_pan3top[1] = {3}; //PANEL 
    static MGROUP_ROTATE pan3top (0, mgroup_pan3top, 1,
        _V(2.054067,1.680602,1.937359), _V(0, 1, 0), (float)(-165*RAD));  
    static UINT mgroup_pan4top[1] = {5}; //PANEL 
    static MGROUP_ROTATE pan4top (0, mgroup_pan4top, 1,
        _V(-2.030726,-1.435512,1.972371 ), _V(0, 1, 0), (float)(165*RAD));    
    anim_pan = CreateAnimation (0.0);
       parent1 = AddAnimationComponent (anim_pan, 0, .4, &pan1arm);
       parent2 = AddAnimationComponent (anim_pan, 0, .4, &pan2arm);     
                 AddAnimationComponent (anim_pan, .2, 1, &pan3top, parent1);
                 AddAnimationComponent (anim_pan, .2, 1, &pan4top, parent2);
     
	// 2. Radar Flag
	static UINT meshgroup_radarflag[1] = {0};
	static MGROUP_ROTATE radarflag (0, meshgroup_radarflag, 1, _V(.1335556,-.1759202,3.127322), _V(0,0,1), (float)(360*RAD));
	anim_radarflag = CreateAnimation (0);
	AddAnimationComponent (anim_radarflag, 0, 1, &radarflag);

	
}

void chippersat::ActivateSolarPanels (DoorStatus action)
{
	pan_status = action;
}

void chippersat::RevertSolarPanels (void)
{
	ActivateSolarPanels ((pan_status == DOOR_CLOSED || pan_status == DOOR_CLOSING) ?
		DOOR_OPENING : DOOR_CLOSING);
}

void chippersat::ActivateRadarflag (DoorStatus action)
{
	radarflag_status = action;
}
 

 

// ==============================================================
// Overloaded callback functions
// ==============================================================

// --------------------------------------------------------------
// Set vessel class parameters
// --------------------------------------------------------------
 

// --------------------------------------------------------------
// Read status from scenario file
// --------------------------------------------------------------
void chippersat::clbkLoadStateEx (FILEHANDLE scn, void *vs)
{
	char *line;

	while (oapiReadScenario_nextline (scn, line)) {
		if (!_strnicmp (line, "PAN", 3)) {
			sscanf (line+3, "%d%lf", &pan_status, &pan_proc);
		}  
else if (!_strnicmp (line, "ANIMATED_THING", 14)) {
			int intToBoolTemp; // MSVC's sscanf doesn't have a format modifier to read a 8-bit int value (other than literally the character itself)
			sscanf (line + 14, "%i %1f", &intToBoolTemp, &radarflag_proc);
			shouldAnimateTheThing = intToBoolTemp != 0;


		}  else {
            PM_LoadState(line);
			ParseScenarioLineEx (line, vs);
		}
	}

	SetAnimation (anim_pan, pan_proc);
	SetAnimation (anim_radarflag, radarflag_proc);
	 
}

// --------------------------------------------------------------
// Save status to scenario file
// --------------------------------------------------------------
void chippersat::clbkSaveState (FILEHANDLE scn)
{
	char cbuf[256];
	SaveDefaultState (scn);
	sprintf (cbuf, "%d %0.4f", pan_status, pan_proc);
	oapiWriteScenario_string (scn, "PAN", cbuf);
	char buf [256];
	sprintf (buf, "%i %1f", (int)shouldAnimateTheThing, radarflag_proc);
	oapiWriteScenario_string (scn, "ANIMATED_THING", buf);
    baseClass::clbkSaveState(scn);

}

// --------------------------------------------------------------
// Frame update
// --------------------------------------------------------------
 void chippersat::clbkPostStep (double simt, double simdt, double mjd)
{
	// Animate Solar Panels
	if (pan_status >= DOOR_CLOSING) {
		double da = simdt * SOLARPANEL_OPERATING_SPEED;
		if (pan_status == DOOR_CLOSING) {
			if (pan_proc > 0.0) pan_proc = max (0.0, pan_proc-da);
			else                pan_status = DOOR_CLOSED;
		} else {
			if (pan_proc < 1.0) pan_proc = min (1.0, pan_proc+da);
			else                pan_status = DOOR_OPEN;
		}
		SetAnimation (anim_pan, pan_proc);
	}

	// Animate Radar Flag
	 if (shouldAnimateTheThing) {
double da = simdt * RADARFLAG_OPERATING_SPEED;
radarflag_proc = fmod (radarflag_proc + da, 1.0); 
		SetAnimation (anim_radarflag, radarflag_proc);
	}
{
// Translating clbkPostStep to PayloadManager
	baseClass::clbkPostStep(simt, simdt, mjd);

/* Here you can place your poststep procedures
	........
*/

	if(j_timer < 0)
		j_timer += simdt;
}
{
	CHIPSATID=ConnectToOrbiterSoundDLL(GetHandle());
    SetMyDefaultWaveDirectory("Sound\\_CustomVesselsSounds\\Chippersat\\");
	RequestLoadVesselWave(CHIPSATID,CHIPSATPanels,"Sound\\_CustomVesselsSounds\\Chippersat\\mypanelopening.wav",BOTHVIEW_FADED_MEDIUM);
	RequestLoadVesselWave(CHIPSATID,CHIPSATRadflag,"Sound\\_CustomVesselsSounds\\Chippersat\\radflagstart.wav",BOTHVIEW_FADED_MEDIUM);
 
	 
}
 }
  


	 
 


// --------------------------------------------------------------
// Keyboard interface handler (buffered key events)
// --------------------------------------------------------------
int chippersat::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
	if (!down) return 0; // only process keydown events

	if (KEYMOD_CONTROL (kstate)) {

		switch (key) {
        case OAPI_KEY_DIVIDE:  // enable/disable RCS
			if (SetAttitudeMode (GetAttitudeMode() >= 1 ? 0 : 1));
			 
			return 1;
			case OAPI_KEY_1:
			PM_DetachPayloadByIndex(0);
			return 1;
		case OAPI_KEY_2:
			PM_DetachPayloadByIndex(1);
			return 1;
		case OAPI_KEY_3:
			PM_DetachPayloadByIndex(2);
			return 1;
		case OAPI_KEY_4:
			PM_DetachPayloadByIndex(3);
			return 1;
		case OAPI_KEY_5:
			PM_DetachPayloadByIndex(4);
			return 1;
		case OAPI_KEY_6:
			PM_DetachPayloadByIndex(5);
			return 1;
		case OAPI_KEY_7:
			PM_DetachPayloadByIndex(6);
			return 1;
		case OAPI_KEY_8:
			PM_DetachPayloadByIndex(7);
			return 1;
		case OAPI_KEY_9:
			PM_DetachPayloadByIndex(8);
			return 1;
		case OAPI_KEY_0:
			PM_DetachPayloadByIndex(9);
			return 1;
		}
	}else{
	switch (key) {
		case OAPI_KEY_1: // deploy/retract solar panels
			PlayVesselWave(CHIPSATID,CHIPSATPanels,NOLOOP,255);
			RevertSolarPanels();
			return 1;
		case OAPI_KEY_2: // start/stop radarflag
			PlayVesselWave(CHIPSATID,CHIPSATRadflag,LOOP,255);
			shouldAnimateTheThing = !shouldAnimateTheThing; 
			return 1;
		case OAPI_KEY_J:
			// Pressing J-key will starting payloads jettisoning sequence
			PM_BeginDetachPayloads();
			return 1;
	}
	 
	}
	return 0;
}



// ==============================================================
// Some vessel parameters
// ==============================================================
 
const double MASS = 1815.0;
const double FUELMASS = 10000;
const double ISP = 3e4;
const double MAXMAINTH = 500000;
const double MAXHOVERTH = 35000;
const double MAXRCSTH = 8000;


// ==============================================================
// Overloaded callback functions
// ==============================================================
// --------------------------------------------------------------
// Set the capabilities of the vessel class
// --------------------------------------------------------------
 
 void chippersat::clbkSetClassCaps (FILEHANDLE cfg)

 {
 	
	SetEmptyMass (1815.0);	 
	SetSize (5);
	SetCW (0.3, 0.4, 0.6, 0.6);
	SetCrossSections (_V(41.58, 36.06, 34.60)); 
	SetRotDrag (_V(0.6,0.6,0.2));	 
	SetPMI (_V(6.57,6.66,3.70));

	// propellant resource
	PROPELLANT_HANDLE hpr = CreatePropellantResource (FUELMASS);
	
	// ***************** thruster definitions *******************
THRUSTER_HANDLE th_main, th_hover;
	THRUSTER_HANDLE th_rcs[36], th_group[4];
 


	PARTICLESTREAMSPEC contrail_main = {
		0, 5.0, 16, 200, 0.15, 1.0, 5, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	};
	PARTICLESTREAMSPEC contrail_hover = {
		0, 5.0, 8, 200, 0.15, 1.0, 5, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	};
	PARTICLESTREAMSPEC exhaust_main = {
		0, 2.0, 20, 200, 0.05, 0.1, 8, 1.0, PARTICLESTREAMSPEC::EMISSIVE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
	};
	PARTICLESTREAMSPEC exhaust_hover = {
		0, 2.0, 10, 200, 0.05, 0.05, 8, 1.0, PARTICLESTREAMSPEC::EMISSIVE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
	};
	th_main = CreateThruster (_V(0,0,-4.35), _V(0,0,1), MAXMAINTH, hpr, ISP);
	CreateThrusterGroup (&th_main, 1, THGROUP_MAIN);
	AddExhaust (th_main, 8, 1, _V(0,0,-4.35), _V(0,0,-1));

	th_hover = CreateThruster (_V(0,0,-4.35), _V(0,0,1), MAXHOVERTH, hpr, ISP);
	CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
	AddExhaust (th_hover, 8, 1, _V(0,0,-4.35), _V(0,0,-1));
	 

	AddExhaustStream (th_hover, _V(0,0,-10), &contrail_hover); 
	AddExhaustStream (th_main, _V(0,0,-10), &contrail_main);
	AddExhaustStream (th_hover, _V(0,0,-5), &exhaust_hover);	 
	AddExhaustStream (th_main, _V(0,0,-5), &exhaust_main);

	th_rcs[ 0] = CreateThruster (_V( 1,0, 3), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 1] = CreateThruster (_V( 1,0, 3), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 2] = CreateThruster (_V(-1,0, 3), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 3] = CreateThruster (_V(-1,0, 3), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 4] = CreateThruster (_V( 1,0,-3), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 5] = CreateThruster (_V( 1,0,-3), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 6] = CreateThruster (_V(-1,0,-3), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 7] = CreateThruster (_V(-1,0,-3), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 8] = CreateThruster (_V( 1,0, 3), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[ 9] = CreateThruster (_V(-1,0, 3), _V( 1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[10] = CreateThruster (_V( 1,0,-3), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[11] = CreateThruster (_V(-1,0,-3), _V( 1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[12] = CreateThruster (_V( 2,0,-3), _V(0,0,1), MAXRCSTH, hpr, ISP);
	th_rcs[13] = CreateThruster (_V( -2,0,-3), _V(0,0,1), MAXRCSTH, hpr, ISP);
	th_rcs[14] = CreateThruster (_V( 1,0, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[15] = CreateThruster (_V( 1,0, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[16] = CreateThruster (_V(-1,0, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[17] = CreateThruster (_V(-1,0, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[18] = CreateThruster (_V(0, 3, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[19] = CreateThruster (_V(0, 3, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[20] = CreateThruster (_V(0, 3, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[21] = CreateThruster (_V(0, 3, 0), _V(0,-1,0), MAXRCSTH, hpr, ISP);
	th_rcs[22] = CreateThruster (_V(0,-3, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[23] = CreateThruster (_V(0,-3, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[24] = CreateThruster (_V(0,-3, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[25] = CreateThruster (_V(0,-3, 0), _V(0, 1,0), MAXRCSTH, hpr, ISP);
	th_rcs[26] = CreateThruster (_V(3, 0, 0), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[27] = CreateThruster (_V(3, 0, 0), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[28] = CreateThruster (_V(3, 0, 0), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[29] = CreateThruster (_V(3, 0, 0), _V(-1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[30] = CreateThruster (_V(-3,0, 0), _V( 1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[31] = CreateThruster (_V(-3,0, 0), _V( 1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[32] = CreateThruster (_V(-3,0, 0), _V( 1,0,0), MAXRCSTH, hpr, ISP);
	th_rcs[33] = CreateThruster (_V(-3,0, 0), _V( 1,0,0), MAXRCSTH, hpr, ISP);	 
    th_rcs[34] = CreateThruster (_V(0,2,3), _V( 0,0,-1), MAXRCSTH, hpr, ISP);
	th_rcs[35] = CreateThruster (_V(0,-2,3), _V( 0,0,-1), MAXRCSTH, hpr, ISP);
	
	th_group[0] = th_rcs[0];
	th_group[1] = th_rcs[2];
	th_group[2] = th_rcs[5];
	th_group[3] = th_rcs[7];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_PITCHUP);

	th_group[0] = th_rcs[1];
	th_group[1] = th_rcs[3];
	th_group[2] = th_rcs[4];
	th_group[3] = th_rcs[6];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_PITCHDOWN);

	th_group[0] = th_rcs[14];
	th_group[1] = th_rcs[17];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_BANKLEFT);

	th_group[0] = th_rcs[15];
	th_group[1] = th_rcs[16];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_BANKRIGHT);

	th_group[0] = th_rcs[26];
	th_group[1] = th_rcs[27];
	th_group[2] = th_rcs[28];
	th_group[3] = th_rcs[29];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_LEFT);

	th_group[0] = th_rcs[30];
	th_group[1] = th_rcs[31];
	th_group[2] = th_rcs[32];
	th_group[3] = th_rcs[33];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_RIGHT);

	th_group[0] = th_rcs[8];
	th_group[1] = th_rcs[11];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_YAWLEFT);

	th_group[0] = th_rcs[9];
	th_group[1] = th_rcs[10];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_YAWRIGHT);

	th_group[0] = th_rcs[18];
	th_group[1] = th_rcs[19];
	th_group[2] = th_rcs[20];
	th_group[3] = th_rcs[21];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_DOWN);

	th_group[0] = th_rcs[22];
	th_group[1] = th_rcs[23];
	th_group[2] = th_rcs[24];
	th_group[3] = th_rcs[25];
	CreateThrusterGroup (th_group, 4, THGROUP_ATT_UP);

    th_group[0] = th_rcs[34];
	th_group[1] = th_rcs[35];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_FORWARD);

	th_group[0] = th_rcs[12];
	th_group[1] = th_rcs[13];
	CreateThrusterGroup (th_group, 2, THGROUP_ATT_BACK); //Really ATT__FORW, cause 9 is ahead of 6 on number pad

	AddExhaust (th_rcs [2], 0.7, 0.08, _V( 0,-2,1.3), _V(0,1,0)); 
    AddExhaust (th_rcs [23], 0.7, 0.08, _V( 0,-2,1.3), _V(0,1,0)); 
    AddExhaust (th_rcs [23], 0.7, 0.08, _V( 0,-2,-1.0), _V(0,1,0)); 
    AddExhaust (th_rcs [6], 0.7, 0.08, _V( 0,-2,-1.0), _V(0,1,0));
	AddExhaust (th_rcs [5], 0.7, 0.08, _V( 0,2,-1.0), _V(0,-1,0)); 
	AddExhaust (th_rcs [18], 0.7, 0.08, _V( 0,2,-1.0), _V(0,-1,0)); 
	AddExhaust (th_rcs [1], 0.7, 0.08, _V( 0,2,1.3), _V(0,-1,0)); 
	AddExhaust (th_rcs [18], 0.7, 0.08, _V( 0,2,1.3), _V(0,-1,0)); 
	AddExhaust (th_rcs [30], 0.7, 0.08, _V(-2,0,1.3), _V(1,0,0)); 
	AddExhaust (th_rcs [9], 0.7, 0.08, _V(-2,0,1.3), _V(1,0,0)); 
	AddExhaust (th_rcs [11], 0.7, 0.08, _V(-2,0,-1.0), _V(1,0,0));
	AddExhaust (th_rcs [30], 0.7, 0.08, _V(-2,0,-1.0), _V(1,0,0));
	AddExhaust (th_rcs [8], 0.7, 0.08, _V(2,0,1.3), _V(-1,0,0));
	AddExhaust (th_rcs [26], 0.7, 0.08, _V(2,0,1.3), _V(-1,0,0));
	AddExhaust (th_rcs [10], 0.7, 0.08, _V(2,0,-1.0), _V(-1,0,0)); 
	AddExhaust (th_rcs [26], 0.7, 0.08, _V(2,0,-1.0), _V(-1,0,0));
	AddExhaust (th_rcs [17], 0.7, 0.08, _V(-2.5,2.3,-1.3), _V(0,-1,0));
	AddExhaust (th_rcs [15], 0.7, 0.08, _V(-2.5,2.3,-1.3), _V(1,0,0)); 
	AddExhaust (th_rcs [14], 0.7, 0.08, _V(2.6,-2.3,-1.3), _V(0,1,0)); 
	AddExhaust (th_rcs [16], 0.7, 0.08, _V(2.6,-2.3,-1.3), _V(-1,0,0)); 
    AddExhaust (th_rcs [12], 0.7, 0.08, _V(-1.8,-1.7,-3), _V(0,0,1)); 
	AddExhaust (th_rcs [13], 0.7, 0.08, _V(1.8,1.7,-3), _V(0,0,1));
	AddExhaust (th_rcs [34], 0.7, 0.08, _V(-1.8,1.7,-1.3), _V(0,0,-1)); 
	AddExhaust (th_rcs [35], 0.7, 0.08, _V(1.8,-1.7,-1.3), _V(0,0,-1));







	SetCameraOffset (_V(0,0.8,0));
	SetDockParams (_V(0,1.3,-1), _V(0,1,0), _V(0,0,-1));
	SetTouchdownPoints (_V(4,4,-6),_V(-4,5.5,-6),_V(5,8,-6));

static BEACONLIGHTSPEC beacon1;
    static VECTOR3 beacon1pos = {1.5,-1.75,.37};
    static VECTOR3 beacon1col = {.1, .2, .992};
    
        beacon1.shape = (BEACONSHAPE_STAR);
        beacon1.pos = &beacon1pos;
        beacon1.col = &beacon1col;
        beacon1.size = (.7);
        beacon1.falloff = (0.6);
        beacon1.period = (13);
        beacon1.duration = (7);
        beacon1.tofs = (2);
        beacon1.active = true;
        
        AddBeacon (&beacon1);


static BEACONLIGHTSPEC beacon2;
    static VECTOR3 beacon2pos = {-1.35,1.49,1.23};
    static VECTOR3 beacon2col = {1,0,0};
    
        beacon2.shape = (BEACONSHAPE_STAR);
        beacon2.pos = &beacon2pos;
        beacon2.col = &beacon2col;
        beacon2.size = (.7);
        beacon2.falloff = (0.6);
        beacon2.period = (9);
        beacon2.duration = (5);
        beacon2.tofs = (3);
        beacon2.active = true;
        
        AddBeacon (&beacon2);

static BEACONLIGHTSPEC beacon3;
    static VECTOR3 beacon3pos = {-1.35,1.49,-.85};
    static VECTOR3 beacon3col = {0,1,0};
    
        beacon3.shape = (BEACONSHAPE_STAR);
        beacon3.pos = &beacon3pos;
        beacon3.col = &beacon3col;
        beacon3.size = (.7);
        beacon3.falloff = (0.6);
        beacon3.period = (9);
        beacon3.duration = (5);
        beacon3.tofs = (5);
        beacon3.active = true;
        
        AddBeacon (&beacon3);


	// visual specs
	AddMesh ("chippersat");
// Now it is necessary to tune Payload Manager for your ship
	// default position and orientation for payload slots:
	PM_SetDefaultAttachmentParams(_V(0, 0, 38), _V(0, 0, 1), _V(0, 1, 0));
	// the special definition for default position and orientation for payload slot 0 (up-forward with 30 deg pitch):
	PM_SetSlotAttachmentParams(0, _V(0, 0, 38), _V(0, 0.5, 0.866025404), _V(0, 0.866025404, -0.5));
	// the special definition for default position and orientation for payload slot 1 (down-forward with -30 deg pitch):
	PM_SetSlotAttachmentParams(1, _V(0, 0, 38), _V(0, -0.5, 0.866025404), _V(0, -0.866025404, -0.5));
	// time interval between payload separation, s (1 second by default):
	PM_SetDetachInterval(0.5);
	// speed of payload separation, m/s (1 m/s by default):
	PM_SetDetachSpeed(30);
	// transfer control focus to separated payload if it allows control focus (true by default):
	PM_SetSendFocus(false);
	// let Payload Manager to know Principal Moments of Inertia (PMI) of vehicle ship:
	PM_SetVehiclePMI(_V(2.28,2.31,0.79));
	// let Payload Manager to know Cross Sections (CS) of vehicle ship and rules of calculating total cross sections:
	PM_SetVehicleCS(_V(10.5,15.0,5.8),_V(0,0,1));
	// maximum number of payloads capability for your vehicle ship (10 by default):
	PM_SetMaximumPayloadsNumber(11);
	// setting period of refreshing PMI and CS on 10 seconds
	PM_SetCapsRefreshPeriod(10);

}


// --------------------------------------------------------------
// Save/load vessele state to/from scenario
// --------------------------------------------------------------	
 

// Scenario Editor definations
DLLCLBK void secInit (HWND hEditor, OBJHANDLE hVessel){
	//Here you can define your own Scenario Editor vessel-specific pages
	//...

	//Define PayloadManager Scenario Editor interface
	PayloadManager::DefineScenarioEditorPage(hEditor, hVessel);
}




 
  
// --------------------------------------------------------------
// Called at each simulation time step before the state is updated
// --------------------------------------------------------------
 


// --------------------------------------------------------------
//Keyboard state handler. Check OrbiterAPI reference for details
// --------------------------------------------------------------
 

// ==============================================================
// API callback interface
// ==============================================================
// --------------------------------------------------------------
// Vessel initialisation
// --------------------------------------------------------------
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
	return new chippersat (hvessel, flightmodel);
}

// --------------------------------------------------------------
// Vessel cleanup
// --------------------------------------------------------------
DLLCLBK void ovcExit (VESSEL *vessel)
{
	if (vessel) delete (chippersat*)vessel;
}
OrbiterSoundLog Error File:
Code:
********************************************************
OrbiterSound 4.0 (3D) Build Nov 20 2012 01:00
********************************************************

Orbiter version: 100830
Advanced OrbiterSound settings: (Edit: 'Sound/cfg/Editable_Advanced_Configuration.cfg')
-------------------------------
Primary buffer			22050hz 16bits  (default 22050/16)
DopplerFactor			1.00		(default 1.00)
VaccumAttenuationFactor		1.00		(default 1.00)
SoundDistanceFactor		1.00		(default 1.00)
MaxSoundProcessPerSecond	60		(default 60)
MaxAnimCheckPerFrame		10		(default 10)
PlayWhenOrbiterInBackground	false		(default false)
WriteInLogAllLoadedSound	false		(default false)
-------------------------------

Orbiter directory:  C:\Users\crice\Documents\orbiter\
Listing planets winds and bases sounds:
  6 planet wind sound found
  5 bases sound found
Passed initModule - Ok
Attempting RenderViewport initialisation...
Attempting GetStartValue initialisation...
Passed GetStartValue - Ok
Initialising directsound...
   Sound hardware capabilities: Driver is not certified.
   Maximum hardware mixing buffers: 1.
   Maximum hardware 3D buffers: 0. 
   Speaker configuration: stereo with wide (arc of 20 deg.) geometry  
   Attempt to create Primary buffer: 22050hz 16bits 3d: yes 
   3D primary buffer initialised OK
directsound initialised - OK
Passed RenderViewport - Ok
Attempting Mp3 initialisation...
M3U list found attempting loading it.
MP3 found in playlist =  20
Mp3 initialised - Ok
Focus changed attempting to load vessel wave
Info: Sound config found for class: chippersat. 31 parameters set.
Focus changed load vessel wave - OK
FAILED, unable to load >8 megabyte sound (are you crazy ?) Sound\_CustomVesselsSounds\chippersat\mycountdown.wav
LoadWave3D->unable to load 3D wave: Sound\_CustomVesselsSounds\chippersat\mycountdown.wav  DX Code: E_FAIL
FAILED: FindResource  DX Code: E_FAIL
LoadWave3D->unable to load 3D wave: Sound\_CustomVesselsSounds\chippersat\hover.wav  DX Code: E_FAIL
Vessel chippersat-01 requested an ID, returned= 0 OK 
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\mypanelopening.wav  DX Code: E_FAIL
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\radflagstart.wav  DX Code: E_FAIL
Vessel chippersat-01 requested but had already an Id returned= 0 OK 
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\mypanelopening.wav  DX Code: E_FAIL
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\radflagstart.wav  DX Code: E_FAIL
Attempting to load Mp3...
Mp3 loaded - OK
Attempting to play Mp3...
Mp3 is playing - OK
Vessel chippersat-01 requested but had already an Id returned= 0 OK 
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\mypanelopening.wav  DX Code: E_FAIL
FAILED: FindResource  DX Code: E_FAIL
Vessel sound FAILED TO LOAD WAV missing wav file ?-> Sound\_CustomVesselsSounds\Chippersat\\Sound\_CustomVesselsSounds\Chippersat\radflagstart.wav  DX Code: E_FAIL
Vessel chippersat-01 requested but had already an Id returned= 0 OK 
 
Attempting to close viewport...
Attempting to kill DirectSound...
-------------------------------
Wav files Statistics:
---------------------
Nbr of wav loaded during simulation: 43
Nbr of wav re-used from memory: 0 (not loaded from disk so not counted in wav loaded)
Max nbr of wav in memory in same time: 43
Nbr of wav failed to load: 1436
Nbr of wav not unloaded at exit: 0
------------------------------- 
DirectSound killed - OK
Passed CloseRenderViewport - Ok
Exited to Orbiter Launchpad - OK
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,687
Reaction score
2,667
Points
203
Location
Dallas, TX
it looks good. the only thing that looks diiferent is I think this should go:
Code:
void chippersat::clbkPostCreation (void)


{
	CHIPSATID=ConnectToOrbiterSoundDLL(GetHandle());
    SetMyDefaultWaveDirectory("Sound\\_CustomVesselsSounds\\Chippersat\\");
	RequestLoadVesselWave(CHIPSATID,CHIPSATPanels,"Sound\\_CustomVesselsSounds\\Chippersat\\mypanelopening.wav",BOTHVIEW_FADED_MEDIUM);
	RequestLoadVesselWave(CHIPSATID,CHIPSATRadflag,"Sound\\_CustomVesselsSounds\\Chippersat\\radflagstart.wav",BOTHVIEW_FADED_MEDIUM);
 
	 
}
 
Top