Jump to content
Sign in to follow this  
1para{god-father}

Allow 3rd Person View just for Vehicles / helicopters

Recommended Posts

Need some help on Allowing 3rd person view just for Vehicles / Helicopters Why does this not work ?

Thanks

init.sqf

if( local player ) then
{

[] execVM "limitThirdPersonView.sqf";

};

limitThirdPersonView.sqf

while {(true)} do
{
if (cameraView == "External") then
{
	if ((vehicle player) == player) then
	{
		player switchCamera "Internal";
	};
};
sleep 0.1;
};

Edited by psvialli

Share this post


Link to post
Share on other sites

Pm Melbo mate, he has just implemented a no 3rd party script unless in vehicles on our server..

Share this post


Link to post
Share on other sites

I have set our server to stop 3rd part so that bit is fine, I Just need it to be allowed for Helicopters / vehicles can he post his script then ?

Share this post


Link to post
Share on other sites

I'm also thing about something close to this, where you are in a chopper with cargo (boat) attached, as that always looks bad as the boat is drawn outside I was thinking of forcing an external view. camera view isn't enough I want it a little further away.

So if there is any script I wouldn't mind using it as I really suck at camera stuff.

Also if you come across how to get full screen as showCinemaBorder true/false only seems to work when it feels like it.

Share this post


Link to post
Share on other sites

I use this script to disallow 3rd party for infantry but allow it for vehicles, but it requires the server to allow 3rd party view so I don't know if its of any use.

if (!local player) exitwith {};
while {true} do {

waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};

if (vehicle player isKindOf "man") then {
	player switchCamera "INTERNAL";
} else {
	waitUntil {vehicle player isKindOf "man"};
};		
};

I would be interested if anyone has a better way of achieving this.

Share this post


Link to post
Share on other sites

ok worked it out using the AAS scripts that i found and it works great you can then set it to what you like in parameters at mission start.

in my Init.sqf i have this

[] execVM "Launchthirdperson.sqf";

then

Launchthirdperson.sqf


waitUntil { player == player };

if( local player ) then
{

[] execVM "limitThirdPersonView.sqf";

};

limitThirdPersonView.sqf

////Params_CameraView=1;  ////uncomment this if you do not set up parameters on mission start
// ----------------------------------------------------------------------------
//                          MAIN ROUTINE
// ----------------------------------------------------------------------------

// no loop need, if third person view is not available anyway
if (difficultyEnabled "3rdPersonView") then
{
switch (Params_CameraView) do
{
	case 1://vehicles only
	{
		while {(true)} do
		{
			if (cameraView == "External") then
			{
				if ((vehicle player) == player) then
				{
					player switchCamera "Internal";
				};
			};
			sleep 0.1;
		};
	};
	case 2://infantry only
	{
		while {(true)} do
		{
			if (cameraView == "External") then
			{
				if ((vehicle player) != player) then
				{
					(vehicle player) switchCamera "Internal";
				};
			};
			sleep 0.1;
		};
	};
	case 3://disabled
	{
		while {(true)} do
		{
			if (cameraView == "External") then
			{
				if ((vehicle player) == cameraOn) then
				{
					(vehicle player) switchCamera "Internal";
				};
			};
			sleep 0.1;
		};
	};
};
};

Share this post


Link to post
Share on other sites

is this still working?

cant make it work :/

Share this post


Link to post
Share on other sites
onEachFrame {
if(cameraOn == vehicle player) then {
	if(vehicle player == player) then {
		if(cameraView == "EXTERNAL") then {
			player switchCamera "INTERNAL";
		};
	};
};
};

Edited by SaMatra

Share this post


Link to post
Share on other sites
onEachFrame {
if(cameraOn == vehicle player) then {
if(vehicle player != player) then {
if(cameraView == "EXTERNAL") then {
player switchCamera "INTERNAL";
};
};
};
};



still as an alternative:
{_x addAction ["", {}, "", 0, false, true, "curatorPersonView","{_x switchCamera 'INTERNAL';hint '3D off'} foreach crew _target"];} forEach vehicles
Made with KK's SQF to BBCode Converter

Share this post


Link to post
Share on other sites
great guys.

where to inset it??

init.sqf in my case.

Share this post


Link to post
Share on other sites

tnx will try!!!!

---------- Post added at 16:09 ---------- Previous post was at 15:21 ----------

No luck.

My init.sqf :

onEachFrame {

if(cameraOn == vehicle player) then {

if(vehicle player != player) then {

if(cameraView == "EXTERNAL") then {

player switchCamera "INTERNAL";

};

};

};

nopop=true;

tf_no_auto_long_range_radio = true;

[] execVM "VCOM_Driving\init.sqf";

[] execVM "briefing.sqf";

Share this post


Link to post
Share on other sites

You didn't copy the full code, one }; is missing. Btw I had a typo in condition making it no 3rd person in vehicles instead of when on foot, opposite of what you need. Fixed it in original post and posting here again, make sure to copy full code piece!

onEachFrame {
if(cameraOn == vehicle player) then {
	if(vehicle player == player) then {
		if(cameraView == "EXTERNAL") then {
			player switchCamera "INTERNAL";
		};
	};
};
};

Also since onEachFrame is not stackable make sure other scripts don't override it and no 3rd person stops working.

Share this post


Link to post
Share on other sites

I actually think that we have misunderstood each other from the start.

What I seek is a script that allows the driver of the car or the pilot of the helicopter to choose whether he wants to see first person or in 3person

Edited by loopdk
misunderstanding

Share this post


Link to post
Share on other sites
onEachFrame {
   if(cameraOn == vehicle player) then {
       if(vehicle player == player) then {
           if(driver vehicle player == player) then {
               if(cameraView == "EXTERNAL") then {
                   player switchCamera "INTERNAL";
               };
           };
       };
   };
};

Share this post


Link to post
Share on other sites

with the new 1.58 update is there anyway to make the External and internal views for aircraft usable through an addAction?

What I have so far:

 

Initialization for vehicle -

  vehicle player addAction ["Internal","Internal.sqf"];

  vehicle player addAction ["External","External.sqf"];
 
Internal.sqf -
  vehicle player switchCamera "INTERNAL";
  sleep 0.1;
 
External.sqf -
  vehicle player switchCamera "External";
  sleep 0.1;

 

(It works for like 1 millisecond, both with a sleep command and without.)

Share this post


Link to post
Share on other sites

Sorry for the necro but as anyone found a solution?

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  

×