Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Sweetcom

Terminate the BIS fnc playVideo after being spawned?

Recommended Posts

Hi there all!

I'm currently building a mission with a recorded intro playing at the beginning using the BIS fnc playVideo function. Everything works fine except I would like to implement an option for the player to skip the intro if wanted when already executed at mission start.

I have tried a lot of stuff now without any real sucess. I come up with one simpel solution with a "sleep delay" and "if statement" posted below but it's more of a workaround because you can only abort the intro before it have been spawned.

I'am quite new to the scripting part of ARMA 2 and would therefore be very happy to hear if some of you have any possible solutions for this purpose?

I thought I had a solution to exit videoPlay while running using the "3000 cuttext ["","plain"];" code that could be used to remove spawn BIS_fnc_AAN function which also is some kind of layer that plays on top of screen. However that didn't work for me at all and I am currently out of solutions.

This is what I've done at the moment:

init.sqf:


titleCut ["Call Radio ALPHA to skip Intro", "BLACK FADED", 2]; //Start from black screen.

titleText ["", "BLACK IN", 10]; //Fade in -intro.

[] execVM "intro.sqf"; //Executes my intro.sqf 

###################################################

intro.sqf:

skip=false;

_trg=createTrigger["EmptyDetector", [0,0,0]]; 
_trg setTriggerArea[0,0,0,false];
_trg setTriggerActivation["ALPHA","PRESENT",true];
_trg setTriggerStatements["this", "hint 'Skip Intro';skip=true", ""]; 

sleep 3; //Available time from start to abort the into, when passed the intro cannot be canceled.

if (skip) then 

{

exit //If Radio Alpha=true, intro.sqf will exit.

}

else

{

_video=["video\intro.ogv",[-0.6,-0.7,2.2,2.5]] spawn bis_fnc_playVideo; //BIS function Play video, my intro ogv.
waitUntil {scriptDone _video};//Terminates the script when done.

};

Edited by Sweetcom

Share this post


Link to post
Share on other sites

Okay, thanks Loyalguard -that was much appriaciated!

Somehow I missed that thread which gave me some more ideas now that I'm gonna try out.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×