Jump to content
Djavu

some help Please live feed does not work anymore

Recommended Posts

Hello everyone, I have used this Kill Zone Kid script for several times, it always worked, now no more, will it be due to the recent Arma updates?

Here the original script.

/* create render surface */ 
_bb = "Land_Billboard_F" createVehicle position player; 
_bb setObjectTexture [0, "#(argb,512,512,1)r2t(uavrtt,1)"]; 
/* create uav and make it fly */ 
uav = createVehicle ["B_UAV_01_F", _bb modelToWorld [0,100,100], [], 0, "FLY"];
createVehicleCrew uav; 
uav lockCameraTo [_bb, [0]]; 
uav flyInHeight 100;
/* add loiter waypoint */ 
_wp = group uav addWaypoint [position _bb, 0]; 
_wp setWaypointType "LOITER"; 
_wp setWaypointLoiterType "CIRCLE_L";
_wp setWaypointLoiterRadius 100;
/* create camera and stream to render surface */ 
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
/* attach cam to gunner cam position */ 
cam attachTo [uav, [0,0,0], "PiP0_pos"];
/* make it zoom in a little */ 
cam camSetFov 0.1;
/* switch cam to thermal */
"uavrtt" setPiPEffect [2];
/* adjust cam orientation */
addMissionEventHandler ["Draw3D", { 
_dir = (uav selectionPosition "PiP0_pos") vectorFromTo (uav selectionPosition "PiP0_dir"); 
cam setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ]; }];

 

Share this post


Link to post
Share on other sites

Just spawn it

0 = [] spawn { the code here}

and mind for your pip resolution (options /video) not disabled.

Share this post


Link to post
Share on other sites

Pierremgi, Thank you very much, I did not have to change anything, my video configuration of the game that was with PIP disabled, Thanks again.

Share this post


Link to post
Share on other sites
On 10/03/2018 at 11:17 PM, pierremgi said:

Just spawn it

0 = [] spawn { the code here}

and mind for your pip resolution (options /video) not disabled.

Hello Friend. I'm having a problem. I'm using the Killzone Kid script to stream drone images onto a screen. "(I made my adaptations)". On the dedicated server, everyone can view the drone images, but the camera only transmits the image at the point where it was attached, "cam attachTo [uav, [0,0,0]," PiP0_pos "]," (without the quotes) when the shooter's camera is moved, the camera does not move together. But, however, if I'm alone on the server, everything works perfectly. Below is the code I am using:

Calls the addaction for the object in init.sqf

[screen1, ["<t color=""#33CCFF"">Ligar</t>", {
 { null = execVM "script\uav\not_init.sqf" } remoteExec [ "call" ,0,true]; }, nil , 10 , true , true , "" , "_this distance _target < 2"]
 ] remoteExec ["addaction",-2,true];
   

not_init.sqf

[[],{removeAllActions screen1;}] remoteExec ["call",0,true];

if (!alive uav) then {["The UAV was shot down!!"] remoteExec ["hint",0,true]; 
[[],{removeAllActions screen1;}] remoteExec ["call",0,true];

[screen1,[0,"img\MapaMundi.jpg"]] remoteExec ["setobjecttextureglobal",0,screen1];
[screen2,[0,"img\MapaMundi.jpg"]] remoteExec ["setobjecttextureglobal",0,screen2];
};
[screen1,[0,"img\MapaMundi.jpg"]] remoteExec ["setobjecttextureglobal",0,screen1];
[screen2,[0,"img\MapaMundi.jpg"]] remoteExec ["setobjecttextureglobal",0,screen2];

[screen1, ["<t color='#2bf000'>DRONE RECON</t>",{ { null = execVM "script\uav\drone1\drone1.sqf" } remoteExec [ "call" ,-2,true]; }, nil , 10 , false , true , "" , "_this distance _target < 2"]] remoteExec ["addaction",0,true];
//[screen1, ["<t color='#2bf000'>DRONE ATAQUE</t>", { { null = execVM "script\uav\drone2\drone2.sqf" } remoteExec [ "call" ,-2,true]; }, nil , 10 , false , true , "" , "_this distance _target < 2"]] remoteExec ["addaction",0,true];

publicVariable "screen1";
publicVariable "screen2";

drone1.sqf

[[],{removeAllActions screen1;}] remoteExec ["call",0,true];
[screen1, ["<t color='#2bf000'>DESCONECTAR DRONE RECON</t>", { { null = execVM "script\uav\drone1\fechar.sqf" } remoteExec [ "call" ,-2,true];}, nil , 10 , true , true , "" , "_this distance _target < 2"]] remoteExec ["addaction",0,true];

[screen1, ["<t color='#2bf000'>USER CAMERA RECON</t>",{player action ["SwitchToUAVGunner",uav]}, nil , 10 , true , true , "" , "_this distance _target < 2"]] remoteExec ["addaction",0,true];
[screen1, ["<t color='#2bf000'>PILOT DRONE</t>",{player action ["SwitchToUAVDriver",uav]}, nil , 9 , true , true , "" , "_this distance _target < 2"]] remoteExec ["addaction",0,true];

[screen1,[0, "#(argb,512,512,1)r2t(uavrtt,1)"]] remoteExec ["setobjecttextureglobal",0,true];
[screen2,[0, "#(argb,512,512,1)r2t(uavrtt,1)"]] remoteExec ["setobjecttextureglobal",0,true];
publicVariable "screen2";
publicVariable "screen1";

// Criar a camera
 cam = "camera" camCreate [0,0,0]; 
cam cameraEffect ["external", "Front", "uavrtt"]; 
cam attachTo [uav, [0,0,0], "PiP0_pos"];
publicVariable "uav";

cam camSetFov 0.06;

PublicVariable "cam";
"uavrtt" setPiPEffect [0];
publicVariable "uav";


evento1 = addMissionEventHandler ["Draw3D", { _dir = (uav selectionPosition "PiP0_pos")vectorFromTo (uav selectionPosition "PiP0_dir");
 cam setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ];

}];

PublicVariable "cam";
if (!alive uav) then {{nul = execVM "script\uav\not_init2.sqf" } remoteExec ["call",0,true];};

publicVariable "evento1";

The event handler

evento1 = addMissionEventHandler ["Draw3D", { _dir = (uav selectionPosition "PiP0_pos")vectorFromTo (uav selectionPosition "PiP0_dir");
 cam setVectorDirAndUp [ _dir, _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] ];

}];

does not seem to work, does not update camera position

Edited by Djavu

Share this post


Link to post
Share on other sites

As the camera is local to the player, and the script that creates it is called for all players, then it works, but the same script that creates the camera calls the event handler on the mission, and is called on all players. But how could it be possible to call the event handler outside the script, where the camera is local?

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

×