fodev.net
FOnline Development => Questions and Answers => Topic started by: KingR 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.
-
Neither in FOClassic nor in Reloaded S2 such features do not exist. You cannot stop a sound once it's played.
-
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. ::)
-
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);
}
-
__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.
-
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
???
-
Problem solved thanks !!!!