Jump to content

Recommended Posts

Hi
Can some one help me please?

Im trying to play an .ogv file on a screen and I need it to loop for ever and not stop.

Iv got this in my screen object init. but an error said Picture \music\tor1.ogv could not be found.

this setObjectTexture [1,"\music\tor1.ogv"];

This works fine with a texture and i know the ogv is in the music folder.


where do it put this part ? 
 

call BIS_fnc_playVideo;

 

Share this post


Link to post
Share on other sites

Thanks harzach i had a look but i dont understand where to put the code ? do you know ?

would this go in the object init or in the  init.sqf ? or seperate sqf ?
 

with uiNamespace do {
    _tv = "Land_FlatTV_01_F" createVehicle (player modelToWorld [0,0.5,0]);
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
};


and this in the description ?
 

class RscMissionScreen
{
	idd = -1;
	movingEnable = 1;
	duration = 1e+011;
	fadein = 0;
	fadeout = 1;
	onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];";
	class controls
	{
		class Picture_0: RscPicture
		{
			idc = 1100;
			text = "";
			x = "safezoneX";
			y = "safezoneY";
			w = "safezoneW";
			h = "safezoneH";
			autoplay = 1;
			loops = 1;
		};

 

Share this post


Link to post
Share on other sites

I'd imagine you would call that code from wherever and whenever you want. I guess it depends - do you want a player to trigger it with an addaction or dialog? Have it start automatically on mission init?

The other bit...I'm not sure. Maybe in description.ext? I'm no good with UI stuff, so hopefully someone smart will be along to help with that.

 

Also keep in mind that this doesn't really work the way you likely want it to. No positional audio being the main thing.

Share this post


Link to post
Share on other sites

no i dont need an addaction for this. yea i need it to start automatically.

thats what i thought, it looked like the cfgmusic stuff so.

thats ok i dont want the ogv to play any audio.

Share this post


Link to post
Share on other sites

Oh, and you'll need to close those curved brackets:

class RscMissionScreen
{
    idd = -1;
    movingEnable = 1;
    duration = 1e+011;
    fadein = 0;
    fadeout = 1;
    onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];";
    class controls
    {
        class Picture_0: RscPicture
        {
            idc = 1100;
            text = "";
            x = "safezoneX";
            y = "safezoneY";
            w = "safezoneW";
            h = "safezoneH";
            autoplay = 1;
            loops = 1;
        };
    };
};

 

Share this post


Link to post
Share on other sites

I found this page DataTerminal and followed the instructions and the Data Terminal worked first try and the news video plays with no problems.

I tried and get it to play my video but i get the same error. Picture could not be found.

this works 

_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
     disableserialization; //thank you so much tankbuster
    _object setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
};
sleep 10;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;


but this don't work and its the same thing but with a different directory for the .ogv
 

_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
     disableserialization; //thank you so much tankbuster
    _object setObjectTexture [0,"\video\ee7.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\video\ee7.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
};
sleep 10;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;


 

Share this post


Link to post
Share on other sites

Try removing the \ in front of the "\video\" to "video\ee7.ogv"

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, Rockapes said:

Try removing the \ in front of the "\video\" to "video\ee7.ogv"

why was this the problem when the other chunk of code had back slashes in them aswel ? it worked though :) 

Share this post


Link to post
Share on other sites

I tried replacing 
 

_scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];

with
 

loops = 1;

I didnt get any errors but it didnt work either.

I tried replacing CloseDisplay 1; with loops =1; but that caused errors.

 

Share this post


Link to post
Share on other sites

ok iv found these bits on the event handlers page but how do i put it together ?
_timeline "looped"

this didnt work.

_timeline "looped";



i couldnt see _scr on the event handler page so im a bit lost.

 

 

This dont work.
 

_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
     disableserialization; //thank you so much tankbuster
    _object setObjectTexture [0,"video\ee7.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "video\ee7.ogv";
 
    _scr ctrlCommit 0;
   
};
loops = 1;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;

 

Share this post


Link to post
Share on other sites
4 hours ago, Quack Rejackt said:

why was this the problem when the other chunk of code had back slashes in them aswel ? it worked though :) 

This would be because the code is referencing data in another .pbo. in the Arma 3 folder. When referencing inside a mission pbo you dont need the extra \. 

  • Thanks 1

Share this post


Link to post
Share on other sites

Im no scripter so dont take this as gospel but my understanding is that _scr and _timeline are just variables. Until you define them they mean nothing. You have _scr declared but I see no reference to _timeline. Arma wont know what it is or what to do with is until its declared. 

 

Try putting this around the code if you want it to loop forever

 

while {true} do { // Stuff here };

Share this post


Link to post
Share on other sites

Thanks for the help rockapes. I have while do true looping my audio so ill have a look at that later and see if i can see the pattern or whatever and get this working with it.

Share this post


Link to post
Share on other sites

yea i did at the top you can see i pasted the kk code, and in it, it says loop = 1; and i thought i would just be able to paste that in the open terminal code but im struggling to chop, change and paste it together.

Share this post


Link to post
Share on other sites
20 hours ago, Rockapes said:

while {true} do { // Stuff here };


No it didnt work, but it didnt create any errors either.
 

while {true} do 
{ 
_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
     disableserialization; //thank you so much tankbuster
    _object setObjectTexture [0,"video\ee7.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "video\ee7.ogv";
 
    _scr ctrlCommit 0;
   
};
sleep 10;
loops = 1;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;

};

 

Share this post


Link to post
Share on other sites

Im not at home but just from a quick visual view try moving the last }; above the sleep 10 line because it appears like your " while {true}" is encompassing the whole script which I dont think will work. Your addaction to close the terminal should ( I think ) be outside };

Share this post


Link to post
Share on other sites

Nice, it wokred :) Thank you rockapes.
 

while {true} do 
{ 
_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
     disableserialization; //thank you so much tankbuster
    _object setObjectTexture [0,"video\ee7.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "video\ee7.ogv";
 
    _scr ctrlCommit 0;
   
};


};


sleep 10;
loops = 1;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;

 

  • Like 1

Share this post


Link to post
Share on other sites

How do i make this autoplay without the need for an addAction ? iv tried adding 

autoplay = 1;

above loops = 1; but it still requires the addaction to trigger the video as the terminal opens. 
if i switch the numbers on these bits _object = _this select 0; _caller = _this select 1; the terminal dont open but the video plays on the big screen when you click open.

Share this post


Link to post
Share on other sites
29 minutes ago, Quack Rejackt said:

How do i make this autoplay without the need for an addAction ? iv tried adding 


autoplay = 1;

above loops = 1; 

 

Neither autoplay nor loops are scripting commands. They are variables available to/in RscMissionScreen. They are doing nothing in your script.

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
Sign in to follow this  

×