Jump to content
tomhighway

Playing video on dedicated server

Recommended Posts

Hi all.

 

I can't figure out why the video intro I've made is interrupted in middle of playing. It works in preview window but when deployed on dedicated server it jumps out of video in the middle of playing it.

 

This is init.sqf starting line.

if (!isDedicated) then {
    intro_video = [] execVM "intro.sqf";
    waitUntil {scriptDone intro_video};
};

intro.sqf is as below.

cutText ["","BLACK FADED",2];
0 fadeSound 0;
0 fadeMusic 0;
enableEnvironment false;
enableRadio false;
intro_done = false;
sleep 2;

private _video = ["video\treadstone-intro.ogv"] spawn BIS_fnc_playVideo;
waitUntil {scriptDone _video};

cutText ["","BLACK FADED",4];
enableEnvironment true;
enableRadio true;
12 fadeSound 1;
12 fadeMusic 1;

sleep 4;

cutText ["","BLACK IN",2];
sleep 4;

intro_done = true;

The video starts playing but then in the middle it just goes back to player view like waitUntil {scriptDone _video} doesn't stop it from continuing. :(

Share this post


Link to post
Share on other sites

I'm going to reply to myself on this to help others. It seems waitUntil is script done gets on sooner than video ends. To go around, I've added sleep command after Bis_fnc_playVideo and now it works on both hosted and dedicated server. By dedicated server I mean when mission is deployed to the dedicated server.

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×