Home   Help Search Login Register  

Author Topic: Picture in picture  (Read 7103 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Picture in picture
« on: 09 Mar 2013, 13:03:19 »
Is there any intel about scripting Picture in picture?

I mean something like in Infantry Showcase, when Alpha find the Iranian spotters and patch me video on my HUD at right down corner.

Is it possible to recreate it?

I want something like satellite script, but player can switch on/of the live satellite feed on his HUD.
Fix bayonet!

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Picture in picture
« Reply #1 on: 11 Mar 2013, 04:27:22 »
Hey pal,
Haven't figured the modules out yet but....
TO CALL

Code: [Select]
[Source, target, viewer] call BIS_fnc_liveFeedSource variable represents where you want the view to be seen from
Target variable represents what the source will be looking at
Viewer variable is what unit you want the livefeed dialog to appear on screen for.

Change the vision mode
Code: [Select]
[] call BIS_fnc_liveFeedEffects0 = normal vision
1= black hot vision
2= white hot vision


To Terminate the liveFeed
Code: [Select]
[] call BIS_fnc_liveFeedTerminate
To Zoom in or out, the global variable is BIS_liveFeed
Code: [Select]
BIS_liveFeed camPrepareFOV 0.04;
BIS_liveFeed camCommitPrepared 10;

Other camera commands can be used to manipulate the view, such as assignment of a new target,
Code: [Select]
BIS_liveFeed camPrepareTarget newtarget;
BIS_liveFeed camCommitPrepared 5;

This function is obviously what they use to get the rear view cameras on the vehicles. Have fun with it!

You can use these calls in triggers as well to grant the player that sat/uav footage you were talking about. Or use it in a dialog to give him controls for zooming or target acquisition. I can also see this being used for deploy-able robots.


If anyone figures out how to use the modules, please post here in this thread, thanks.
« Last Edit: 11 Mar 2013, 04:31:41 by savedbygrace »

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Picture in picture
« Reply #2 on: 12 Mar 2013, 20:41:16 »
Thank you boddy!

So when BIS show an other soldier's view to player's HUD right down corner, they use a dialog? Damn, I never made dialog before. So probably I have to wait for beta or release to small object laptop to show the uav picture on that laptop. Or I have to learn about dialogs. :)

If I collect more info, I will post it here.
Fix bayonet!

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Picture in picture
« Reply #3 on: 13 Mar 2013, 06:36:57 »
Its a premade dialog bu BIS, called by a BIS function. All you have to do is follow the lines above and you'll replicate what you saw in the Infantry SHOWCASE.

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: Picture in picture
« Reply #4 on: 13 Mar 2013, 14:03:25 »
If the CALL makes the game stop, SPAWN could work. Some of the functions arent returning returning values, to handlers, then spawn is used. I havent yet tried the functions myself, but sounds like a cool feature. I wish my 3d card would be faster.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Picture in picture
« Reply #5 on: 13 Mar 2013, 16:55:11 »
Don't be shy SaOk, you did the most playable mission for arma3a. ;) Just please make a new one for 6-8 players too (instead of 20, it's too much).
This island and the lack of units is tie my hands because my style is bigger combined assaults with support (IFVs), but in this type of terrain is unfightable for bigger formation (e.g: platoon or company) because only one or two squad have place in a valley, the other units are in other valley, so they cannot support each other. But this kind of terrain gave us the greek culture, what is the base of European (and North American) culture. This terrain let the greek to defend their cities with a few against the whole ancient iranian, the persian. So what is bad for a mission maker, good for a history maker. :D

@savedbygrace: I just test it and works! Thanks for your help!
What I found:
1. The viewer is not important in single player mode, because whatever you give it, the player's HUD show the feed.
2. If source is a man, the camera will be at his legs, so most time you see nothing, just grass.
3. If you create a GameLogic in the air, and give this as source, it's a fine UAV/sat view. (Only problem is the good old direction flip from OFP/ArmA1/ArmA2.... :) )
« Last Edit: 13 Mar 2013, 17:11:03 by bardosy »
Fix bayonet!

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: Picture in picture
« Reply #6 on: 13 Mar 2013, 17:13:06 »

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Picture in picture
« Reply #7 on: 13 Mar 2013, 17:36:34 »
The test works fine, when I put a radio trigger's activation filed the function.
But when I start scripting, it stopped works  ???

I create two sqf file for ON and OFF the feed.

Code: [Select]
player removeAction myuavcameraaction;

myuavcameraaction = player addAction ["UAV camera OFF", "scripts\uavcameraoff.sqf", [], 1, false, true, "", "true"];};

[kam, player, player] call BIS_fnc_liveFeed;

sleep 5;

[2] call BIS_fnc_liveFeedEffects;

and I add this in init.sqf to the player. And when I use the action menu, it removes the ON action and add the OFF action but no feed. Even if I delete the last line.

If I use this line ([kam, player, player] call BIS_fnc_liveFeed;) in a trigger, it works fine.

And this is the OFF code:
Code: [Select]
player removeAction myuavcameraaction;

myuavcameraaction = player addAction ["UAV camera ON", "scripts\uavcamera.sqf", [], 1, false, true, "", "true"];};

[] call BIS_fnc_liveFeedTerminate;


Do I something wrong or it's impossible to call from script? Or I have to compile this function first?
I tried to change call to spawn but I gave some error messages so I changed it back.
Fix bayonet!

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: Picture in picture
« Reply #8 on: 13 Mar 2013, 17:57:13 »
Is it that "};"? :)

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Picture in picture
« Reply #9 on: 13 Mar 2013, 21:23:03 »
Quote
Is it that "};"?

Shit! Thanks! I'll check it without this soon. :)
Fix bayonet!

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Picture in picture
« Reply #10 on: 14 Mar 2013, 02:05:02 »
It worked fine in a script for me, or triggers. I had as you did, a source on a tower corner which panned from right to left to symbolize a moving security camera to monitor two roads that ran perpendicular to one another and their intersection.

You have to terminate the function completely before it can be called again. It can not be called more than once at a time, or it will prevent the function from being used until the mission is reverted.

It would almost be worth creating a small, semitransparent 2 button dialog which displays below where the live feed will appear to give the player control of On and Off from there rather than wasting radio triggers.

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: Picture in picture
« Reply #11 on: 15 Mar 2013, 22:26:46 »
If you insert position instead of object as source, it unlocks the camera to moved freely with camera.sqs code:

Code: [Select]
[getposATL player, player, player] call BIS_fnc_liveFeed;
BIS_liveFeed  camPrepareTarget [-93444.48,9377.59,25401.25];
BIS_liveFeed  camPreparePos [3211.86,5831.95,0.43];
BIS_liveFeed  camPrepareFOV 0.543;
BIS_liveFeed  camCommitPrepared 0;
BIS_liveFeed camPrepareTarget [-27322.93,99388.77,-17714.95];
BIS_liveFeed camPreparePos [3208.10,5827.30,3.58];
BIS_liveFeed camPrepareFOV 0.543;
BIS_liveFeed camCommitPrepared 5;
sleep 5;
BIS_liveFeed camPrepareTarget [-89453.59,26863.72,-31137.93];
BIS_liveFeed camPreparePos [3214.26,5831.05,7.16];
BIS_liveFeed camPrepareFOV 0.543;
BIS_liveFeed camCommitPrepared 5;
sleep 60;
[] call BIS_fnc_liveFeedTerminate;

You just need to change _camera to BIS_liveFeed.

This gives nice extra to the radiomessages too, you can have e.g. live video of the commander's face giving orders for you with HQ background ambiance (lip files dont just work yet). So much possibilities. I hope the livefeed screen size could also be tweaked.

Edit: Made a script that send live feed from any nearby US chopper if its flying high enough. Scans random units and random spots on grounds. An endless loop.

Code: [Select]
private ["_source","_target","_ran","_ran2","_fov","_open"];
_source = player;
_target = player;

_open = true;
waitUntil {sleep 5; {(getposATL _x select 2) > 10} count (nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2000]) > 0};
{if ((getposATL _x select 2) > 10) then {_source = _x;};} foreach (nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2200]);
_target = (getposATL _source) nearEntities [["SoldierEB","SoldierWB"],750];
if (count _target > 0) then {_target = _target call BIS_fnc_selectRandom;} else {_target = [(getposATL _source select 0) + 300 - (random 600),(getposATL _source select 1) + 300 - (random 600),0];};
if (_open) then {[_source, _target, player] call BIS_fnc_liveFeed;};
//hint format ["%1",nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2000]];
while {true} do {
if ({(getposATL _x select 2) > 10} count (nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2000]) == 0) then {[] call BIS_fnc_liveFeedTerminate; _open = true; waitUntil {sleep 5; {(getposATL _x select 2) > 10} count (nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2000]) > 0};} else {_open = false;};

{if ((getposATL _x select 2) > 10) then {_source = _x;};} foreach (nearestObjects [vehicle player,["B_MH9_F","B_AH9_F"],2200]);
_target = (getposATL _source) nearEntities [["SoldierEB","SoldierWB"],750];
if (count _target > 0) then {_target = _target call BIS_fnc_selectRandom;} else {_target = [(getposATL _source select 0) + 300 - (random 600),(getposATL _source select 1) + 300 - (random 600),0];};
if (_open) then {[_source, _target, player] call BIS_fnc_liveFeed;};
_ran = 7 + (random 10);
_ran2 = 2 + (random 5);
_fov = 2 - (random 1);
BIS_liveFeed camPrepareFOV _fov;
BIS_liveFeed camPrepareTarget _target;
BIS_liveFeed camCommitPrepared _ran2;
sleep _ran;
};
« Last Edit: 17 Mar 2013, 20:10:25 by SaOk »