FOnline Development > Questions and Answers

Audio lines

(1/2) > >>

KingR:
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.

Slowhand:
Neither in FOClassic nor in Reloaded S2 such features do not exist. You cannot stop a sound once it's played.

KingR:
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.  ::)

KingR:
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);
   
}

Slowhand:

--- Quote from: KingR on March 01, 2025, 11:28:37 am ---   __DisableMouseEvents = true; // I added this, but the mouse freezes permanently

--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

Go to full version