Jump to content
  • 0

Not sure if this idea is possible... any takers?


saintanthony

Question

Was wondering if this was possible, given Arma's limitations.  I know there are some players out there both for and against third person in DayZ Epoch.  There are several situations where 3rd person is a real time saver, like when you are backing up a vehicle.  However, it can easily get in the way of realism as well.  Could it be scripted so that 3rd person is only available when certain conditions are met.  For example when a player is not in combat or only when a player is in a vehicle.

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Was wondering if this was possible, given Arma's limitations.  I know there are some players out there both for and against third person in DayZ Epoch.  There are several situations where 3rd person is a real time saver, like when you are backing up a vehicle.  However, it can easily get in the way of realism as well.  Could it be scripted so that 3rd person is only available when certain conditions are met.  For example when a player is not in combat or only when a player is in a vehicle.

As I know of, not really.

The issue with that would be if some one was already in Third person.

You could always stop them from using third person, but the issue would be if third person was already pressed.

 

Best bet would be to mess around with variables and classes to figure out. You might be able to just set it so if they go into combat, but it could get glitched if they already are in third person.

 

Don't know, never tried.

Link to comment
Share on other sites

  • 0

Was wondering if this was possible, given Arma's limitations.  I know there are some players out there both for and against third person in DayZ Epoch.  There are several situations where 3rd person is a real time saver, like when you are backing up a vehicle.  However, it can easily get in the way of realism as well.  Could it be scripted so that 3rd person is only available when certain conditions are met.  For example when a player is not in combat or only when a player is in a vehicle.

 

it has already been done and i didnt even search for very long to find this, i also know there are more advanced version of this out there, that will allow you to restrict 3rdperson view in various enviorments or vehicle determind from predefined lists, (ex. allow 3rd person in skoda, but not in lada), if you cant find one, then this should be rather easy to edit to fit your needs:

 

http://forums.bistudio.com/showthread.php?145262-Allow-3rd-Person-View-just-for-Vehicles-helicopters

 

 

As I know of, not really.

The issue with that would be if some one was already in Third person.

You could always stop them from using third person, but the issue would be if third person was already pressed.

 

Best bet would be to mess around with variables and classes to figure out. You might be able to just set it so if they go into combat, but it could get glitched if they already are in third person.

 

Don't know, never tried.

 

what you are saying makes no sense ... obviusly you can just force the cameraview with code regardles of its current viewangle or whatever else.

 

i guess you havent heard of spectate or bullet-cam? ... not to mention other varius scripts for manipulating cameraview.

Link to comment
Share on other sites

  • 0

it has already been done and i didnt even search for very long to find this, i also know there are more advanced version of this out there, that will allow you to restrict 3rdperson view in various enviorments or vehicle determind from predefined lists, (ex. allow 3rd person in skoda, but not in lada), if you cant find one, then this should be rather easy to edit to fit your needs:

 

http://forums.bistudio.com/showthread.php?145262-Allow-3rd-Person-View-just-for-Vehicles-helicopters

 

 

 

what you are saying makes no sense ... obviusly you can just force the cameraview with code regardles of its current viewangle or whatever else.

 

i guess you havent heard of spectate or bullet-cam? ... not to mention other varius scripts for manipulating cameraview.

 

Thanks, I'll look into this!

Link to comment
Share on other sites

  • 0

Ok, changed it up a little bit so it suited what I'm trying to do, but I'm still getting my bearings with learning to script.  With that being said, somehow I FUBAR'd this.  Can you guys help me get this working?  Here is what I did:

 

In my init.sqf:

[] execVM "custom\launch3dperson.sqf";

In launch3dperson.sqf:

waitUntil { player == player };

if( local player ) then
{
[] execVM "custom\limitThirdPersonView.sqf";
};

In limitThirdPersonView.sqf:

private ["_timeout","_vehicletravel","_playercombat"];

_timeout = player getVariable["combattimeout",0];
_vehicletravel = ((vehicle player) == player) && (speed (vehicle player)) >= 10;
_playercombat = ((vehicle player) != player) && ((_timeout - time) > 0);


if (difficultyEnabled "3rdPersonView") then
{
while {true} do {

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

	if  (_vehicletravel || _playercombat) then {
		player switchCamera "INTERNAL";
	}
	sleep 0.1;
};
};

Nothing happens in game.  Any help would be appreciated.

Link to comment
Share on other sites

  • 0

change the limit in your server setup?

 

or, try this:

////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;
			};
		};
	};
};
Link to comment
Share on other sites

  • 0

change the limit in your server setup?

 

or, try this:

////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;
			};
		};
	};
};

Can you elaborate on that first part.  What limit are you referring too?  Also, I tired the above code.  It only does one of those 3 options, which is why I was trying to do it a different way.

What makes the above way so special?   Is there something wrong with the one I wrote?   I'd really like to just get a variant of my code working.

Link to comment
Share on other sites

  • 0

it has already been done and i didnt even search for very long to find this, i also know there are more advanced version of this out there, that will allow you to restrict 3rdperson view in various enviorments or vehicle determind from predefined lists, (ex. allow 3rd person in skoda, but not in lada), if you cant find one, then this should be rather easy to edit to fit your needs:

 

http://forums.bistudio.com/showthread.php?145262-Allow-3rd-Person-View-just-for-Vehicles-helicopters

 

 

 

what you are saying makes no sense ... obviusly you can just force the cameraview with code regardles of its current viewangle or whatever else.

 

i guess you havent heard of spectate or bullet-cam? ... not to mention other varius scripts for manipulating cameraview.

Did you ever find some of those more "advanced" versions?  As you can see with the code I wrote and posted above, I'm trying to do a little more than the original code you showed me, and its not cooperating...

Link to comment
Share on other sites

  • 0

 

Can you elaborate on that first part.  What limit are you referring too?  Also, I tired the above code.  It only does one of those 3 options, which is why I was trying to do it a different way.

What makes the above way so special?   Is there something wrong with the one I wrote?   I'd really like to just get a variant of my code working.

 

The first part is referring to the server settings. You have 3rd person either enabled or disabled.

Link to comment
Share on other sites

  • 0

The first part is referring to the server settings. You have 3rd person either enabled or disabled.

 

3rd Person is enabled.  As I understood this, it MUST be enabled for any of this to work right.  Is that correct?  Surely, getting my code to work should be a simple matter for someone more experienced than I.  I can't imagine that what I'm trying to do is not possible.  I've got to be missing something simple somewhere.

Link to comment
Share on other sites

  • 0
private ["_timeout","_vehicletravel","_playercombat"];

_timeout = player getVariable["combattimeout",0];
_vehicletravel = ((vehicle player) == player) && (speed (vehicle player)) >= 10;//wrong statement
_playercombat = ((vehicle player) != player) && ((_timeout - time) > 0); //again wrong statement


if (difficultyEnabled "3rdPersonView") then
{
while {true} do {

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

	if  (_vehicletravel || _playercombat) then {
		player switchCamera "INTERNAL";
	}
	sleep 0.1;
};
};

Nothing happens in game.  Any help would be appreciated.

 

not surprised if this does not work ...

 

from statements, this should activate when a player is not in a vehicle and going above 10km/h (which is a kinda wierd statement as a player rarely gets above 5 i think)

second statement i belive is supposed to say, if the player is not in a vehicle and has combat timer on, however this is also wrong aswell and im not sure why you would even check if he is in a vehicle or not ... imo if combat timer is on, it should switch either way.

 

 

try this:

if (difficultyEnabled "3rdPersonView") then
{
	while {true} do {

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

		if  (((vehicle player) != player) && (speed (vehicle player)) >= 10 || (dayz_combat == 1)) then {
			player switchCamera "INTERNAL";
		}
		sleep 0.1;
	};
};
Link to comment
Share on other sites

  • 0

 

not surprised if this does not work ...

 

from statements, this should activate when a player is not in a vehicle and going above 10km/h (which is a kinda wierd statement as a player rarely gets above 5 i think)

second statement i belive is supposed to say, if the player is not in a vehicle and has combat timer on, however this is also wrong aswell and im not sure why you would even check if he is in a vehicle or not ... imo if combat timer is on, it should switch either way.

 

 

try this:

if (difficultyEnabled "3rdPersonView") then
{
	while {true} do {

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

		if  (((vehicle player) != player) && (speed (vehicle player)) >= 10 || (dayz_combat == 1)) then {
			player switchCamera "INTERNAL";
		}
		sleep 0.1;
	};
};

I'll give it a shot later tonight, after work.  I see the typo i made now with the vehicle stuff.  Should be if player IS in a vehicle and moving faster than 10, then disable 3rdpersonview.  The second is if player IS on foot and in combat, then disable 3rdpersonview.  Looks like you figured that out though. lol. I'll let you know what happens.  If this works, I'll re-release in mods corner and give you credit. I'm sure everyone would like to at least know this is possible.

Link to comment
Share on other sites

  • 0

its off the top of my head, but it should work like that ...

 

 

If this works, I'll re-release in mods corner and give you credit. I'm sure everyone would like to at least know this is possible.

 

im sure most scripters, with a decent knowlage about the arma engine, already knows this ... but its a nice thought tho

Link to comment
Share on other sites

  • 0

its off the top of my head, but it should work like that ...

 

 

 

im sure most scripters, with a decent knowlage about the arma engine, already knows this ... but its a nice thought tho

Same problem as before.  Nothing happens.  If I shoot or travel in a vehicle while in third person view it remains in third person view.  I can't help but feel like I'm missing something simple somehow.

Link to comment
Share on other sites

  • 0

try this:

//preventing start on server

if(isServer)exitwith{};

if (!isDedicated) then {
	waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned
	if (difficultyEnabled "3rdPersonView") then{
		while {true} do {
			waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};
			if  (((vehicle player) != player) && (speed (vehicle player)) > 10 || (dayz_combat == 1)) then {
				(vehicle player) switchCamera "INTERNAL"; //changed player to (vehicle player)
			};// was missing ";"
			sleep 0.1;
		};
	};
};

 and no script to start this, just add to buttom of init, whatever you called the script and its path

 

(it would also be helpful to see error messages from client rpt)

Link to comment
Share on other sites

  • 0

there was two errors actually ... one was a missing ";" ...

 

the other was rather important aswell as there are no player cam for a player in a vehicle, has to be "vehicle player" or camera will detach from the player when it switces cam in a vehicle (it dosnt matter if player is not in a vehicle "vehicle player" will then refer to player).

 

edited above post to working code ...

Link to comment
Share on other sites

  • 0

try this:

//preventing start on server

if(isServer)exitwith{};

if (!isDedicated) then {
	waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned
	if (difficultyEnabled "3rdPersonView") then{
		while {true} do {
			waitUntil {cameraView == "EXTERNAL" || cameraView == "GROUP"};
			if  (((vehicle player) != player) && (speed (vehicle player)) > 10 || (dayz_combat == 1)) then {
				(vehicle player) switchCamera "INTERNAL"; //changed player to (vehicle player)
			};// was missing ";"
			sleep 0.1;
		};
	};
};

 and no script to start this, just add to buttom of init, whatever you called the script and its path

 

(it would also be helpful to see error messages from client rpt)

Figured it out.  It was really close.  Small typo before the sleep command, and I had to change the way the camera was being changed for when you are in a vehicle.  Also, increased the vehicle speed before activation.  Everything works great!  Thank you SOOOO much!  I couldn't have gotten this working without your help. **Edit** LOL. I didn't see your last post until just now.  Here is the final code:

if (!isDedicated) then { //preventing start on server

	waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned

	if (difficultyEnabled "3rdPersonView") then
	{
		while {true} do {

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

			if  (((vehicle player) == player) && (dayz_combat == 1)) then {
				player switchCamera "INTERNAL";
			};
			sleep 0.1;

			if (((vehicle player) != player) && (speed (vehicle player)) >= 30) then {
				(vehicle player) switchCamera "Internal";
			};
			sleep 0.1;
		};
	};

};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...