Author Topic: Audio lines  (Read 880 times)

Audio lines
« on: February 25, 2025, 09:09:36 pm »
Hi all.
I added Marcus' audio lines, in this form, in dialog.fos

void r_PlayMarcus(Critter& player, Critter@ npc, int val)
{
   
    if(val == 1)
        PlaySound(player, "MCS1A.ACM");
    else if(val == 2)
        PlaySound(player, "MCS1B.ACM");

The problem is that if the player go too quickly in the dialogue, the audio lines are added one on top of the other.

I would like to find a line code that stops the sounds played, just before launching the audio line. Does anyone have an idea how to do it? I'm worked on the Reloaded Season 2 server.

Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Re: Audio lines
« Reply #1 on: February 27, 2025, 08:33:59 pm »
Neither in FOClassic nor in Reloaded S2 such features do not exist. You cannot stop a sound once it's played.

Re: Audio lines
« Reply #2 on: March 01, 2025, 11:26:35 am »
Thank you very much Slowhand, you save me many hours of testing for nothing.  ;D
They had wanted to include this in this form: bool canStop

void PlayVideo(Critter& cr, string& videoName, bool canStop)// Export   
{
    if(cr.IsPlayer())
        cr.RunClientScript("_PlayVideo", canStop ? 1 : 0, 0, 0, videoName, null);
}



But it is not developed.  ::)

Re: Audio lines
« Reply #3 on: March 01, 2025, 11:28:37 am »
On the other hand, do you know a trick to disable the player's mouse for a given time? I saw something about it in the code, but I couldn't develop it.

void _QuakeScreen(int noise, int timeMs, int, string@, array<int>@)
{
   
   __DisableMouseEvents = true; // I added this, but the mouse freezes permanently
   //Player.loseTurn = true;
   //QuakeScreen(noise, timeMs);
   
}
« Last Edit: March 01, 2025, 11:33:31 am by KingR »

Offline Slowhand

  • Go for the eyes, Boo! Go for the eyes!
Re: Audio lines
« Reply #4 on: March 01, 2025, 02:04:55 pm »
   __DisableMouseEvents = true; // I added this, but the mouse freezes permanently

Well, I haven't tried, but where is the code where you enable the mouse events? Somewhere you should be calling __DisableMouseEvents = false; right? Maybe add an event timer for it? Just some ideas.

Re: Audio lines
« Reply #5 on: March 01, 2025, 02:40:00 pm »
Yes, absolutely! This command is in config.fos. I copied and pasted this into the _QuakeScreen void to test. (it's launched from a dialog line)

void InitializeGame()                  // Export
{
...
__DisableMouseEvents = false;
}

But there is another one in this form in client_cutscene.fos :

void mouse(int onoff, int, int, string@, array<int>@)
{
__DisableMouseEvents = (onoff <= 0);
}

However I don't know how to add a time event in :

void _QuakeScreen(int noise, int timeMs, int, string@, array<int>@)
{
   
   //__DisableMouseEvents = true;
   //Player.loseTurn = true;
   QuakeScreen(noise, timeMs);
   
}

in this form?

 CreateTimeEvent(AFTER(REAL_SECOND(X)), "name_lineX", npc.Id, false); //goes towards an uint

 ???
« Last Edit: March 01, 2025, 02:57:29 pm by KingR »

Re: Audio lines
« Reply #6 on: March 02, 2025, 09:58:48 pm »
Problem solved thanks !!!!
« Last Edit: March 02, 2025, 10:23:58 pm by KingR »