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: Problem using SoundOptionOnOff  (Read 2949 times)

0 Members and 1 Guest are viewing this topic.

Offline Orbiter Fan

  • Full Member
  • ***
  • Posts: 162
  • Karma: 0
27 November 2003, 11:28:33
Hello.

I'm having some issues with OrbiterSoundSDK command SoundOptionOnOff. I have added it to my
HST update 2 source code and it won't work! I'm trying to disable the RCS thrust sound for the
HST as it doesn't use thrusters. Here's how my ovcInit looks like:

// Vessel initialisation
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
   return new HST (hvessel, flightmodel);
   ConnectToOrbiterSoundDLL();
   SoundOptionOnOff(PLAYATTITUDETHRUST,FALSE);
}

MS VC++ doesn't complain or anything when it compiles the dll. How do you actually turn off the
RCS sound effects for an specific vessel only? I need to know this since this is the only thing that
would prevent me from releasing update 2.


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #1 - 30 November 2003, 21:49:11
Sorry david didn't had time this week-end
I'll see that next week.

Dan


Offline Orbiter Fan

  • Full Member
  • ***
  • Posts: 162
  • Karma: 0
Reply #2 - 04 December 2003, 20:57:20
Have you had any time to check this? Or could you maube just post the code that the DGII uses for
silent RCS?


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #3 - 04 December 2003, 22:02:34
mhhh is this the original code you posted ?
because if you put the code after a "return"
it will never be executed....

try this:


// Vessel initialisation
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{

ConnectToOrbiterSoundDLL();
SoundOptionOnOff(PLAYATTITUDETHRUST,FALSE);

return new HST (hvessel, flightmodel);
}


Dan


Offline Orbiter Fan

  • Full Member
  • ***
  • Posts: 162
  • Karma: 0
Reply #4 - 04 December 2003, 22:11:50
Thanks, will try it! I'm still new to Orbiter programming so thanks for the answer!


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #5 - 05 December 2003, 01:49:49
You welcome,

Sorry for delay I didn't looked at your code at first.

Dan


Offline Orbiter Fan

  • Full Member
  • ***
  • Posts: 162
  • Karma: 0
Reply #6 - 05 December 2003, 09:22:21
I think that I have found a bug in the SoundOptionOnOff command. Instead of just disabling RCS
sound for Hubble it also disables the RCS sound for the standard Atlantis! I believe this is
something that needs looking into to.


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #7 - 06 December 2003, 20:13:45
Remember that the sound are global
so it's your responsibilies to manage the sound
when the user switch from one vessel to another.
Hey now that you are programmer it's time to work :)

look at: opcFocusChanged to manage this.

So when user "goes" into the hubble you must detect
this in "opcFocusChanged" and set RCS sound off
You must also do the same when the shuttle
gain the focus... ie: detect it in opcFocusChanged
and allow again the RCS.
Look also to "oapiGetObjectName" wich will return
the name of an object given it's handle, so you can
make the test.

something like that: (from memory, it need perhaps some tuning)

DLLCLBK void opcFocusChanged (OBJHANDLE new_focus,OBJHANDLE old_focus)
{
char FocusName[255];

oapiGetObjectName (new_focus,FocusName,255);

// if it's hubble we disable the RCS
if(strcmp(FocusName,"hubble" ) ==0)
{
SoundOptionOnOff(PLAYATTITUDETHRUST,FALSE);
}
else // all other vessel have RCS
{
SoundOptionOnOff(PLAYATTITUDETHRUST,TRUE);
}
}



You want to disable the RCS sound because hubble is controlled
with Gyroscop?


Dan


« Last Edit: 06 December 2003, 20:52:56 by DanSteph »

Offline Orbiter Fan

  • Full Member
  • ***
  • Posts: 162
  • Karma: 0
Reply #8 - 06 December 2003, 20:52:56
DanSteph wrote:

> You want to disable the RCS sound because hubble is controlled
> with Gyroscop?
>
>
> Dan
>
>

Yes. Having the Reaction Wheel Assembly onboard the HST sound like thrusters firing is a little bit
too odd to me.

« Last Edit: 06 December 2003, 20:52:56 by Orbiter Fan »