Jump to content
FAILIX

"3rd Person View in vehicle only" script broken with 1.58

Recommended Posts

Hi Guys,

I've added a small script to the mission on our dedicated server, that only allows a player to switch to 3rd Person view while in a vehicle.

While on food it disables 3rdpersonView.

The changes to difficulty options in 1.58 screwed up the script.

Here is what is in the script now:

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

	waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned
//changed from "if (difficultyEnabled "3rdPersonView") then" to adjust for difficulty changes in v1.58	
	if (difficultyOption "3rdPersonView") then 
	{
		while {true} do {

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

			if  ((vehicle player) == player) then {
				player switchCamera "INTERNAL";
			};
			
		};
	};

};

As I understood it, I just need to change difficultyEnabled to difficultyOption. But this does nothing right now.

I've also tried to replace "3rdPersonView" with "thirdPersonView", but that also didn't help.

Does anyone has an idea how to fix the script?

 

Share this post


Link to post
Share on other sites

Hi Guys,

I've added a small script to the mission on our dedicated server, that only allows a player to switch to 3rd Person view while in a vehicle.

While on food it disables 3rdpersonView.

The changes to difficulty options in 1.58 screwed up the script.

Here is what is in the script now:

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

	waitUntil {!isNull (findDisplay 46)}; //making sure player is spawned
//changed from "if (difficultyEnabled "3rdPersonView") then" to adjust for difficulty changes in v1.58	
	if (difficultyOption "3rdPersonView") then 
	{
		while {true} do {

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

			if  ((vehicle player) == player) then {
				player switchCamera "INTERNAL";
			};
			
		};
	};

};

As I understood it, I just need to change difficultyEnabled to difficultyOption. But this does nothing right now.

I've also tried to replace "3rdPersonView" with "thirdPersonView", but that also didn't help.

Does anyone has an idea how to fix the script?

I've never used the command but looking at the wiki page difficultyOption returns a number now instead of a bool which difficultyEnabled did.

Share this post


Link to post
Share on other sites

Oh, this slipped through as I looked it up at the page. So I probably just need to switch the true to 1 and it might work then. Thanks, I will let you know if it works.

Share this post


Link to post
Share on other sites

Oh, this slipped through as I looked it up at the page. So I probably just need to switch the true to 1 and it might work then. Thanks, I will let you know if it works.

Damn, this did not work.

Anyone else here who knows how to get this fixed?

Share this post


Link to post
Share on other sites

Damn, this did not work.

Anyone else here who knows how to get this fixed?

 

Isn't it thirdPersonView instead of 3rdPersonView, along with what lala14 said, should work.

hint str (difficultyOption "thirdPersonView")

Returns 1 for me, means activated.

 

Using your code:

 

if(!isDedicated) then 
{
    waitUntil {!isNull (findDisplay 46)}; // Wait for main display
    if((difficultyOption "thirdPersonView") isEqualTo 1) then 
    {
        while {true} do 
        {
            waitUntil {cameraView isEqualTo "EXTERNAL" || cameraView isEqualTo "GROUP"};
            if((vehicle player) isEqualTo player) then 
            {
                player switchCamera "INTERNAL";
            };
        };
    };
};

Share this post


Link to post
Share on other sites

Isn't it thirdPersonView instead of 3rdPersonView, along with what lala14 said, should work.

hint str (difficultyOption "thirdPersonView")

Returns 1 for me, means activated.

Yes, that is true. I've actually tried both. Now having "thirdPersonView", while checking it in game it also returns 1. But the script still doesn't work :(

 

Here is what the script looks like now:

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

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

	if (difficultyOption "thirdPersonView") then 
	{
		while {1} do {

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

			if  ((vehicle player) == player) then {
				player switchCamera "INTERNAL";
			};
			
		};
	};

};

Share this post


Link to post
Share on other sites

Yes, that is true. I've actually tried both. Now having "thirdPersonView", while checking it in game it also returns 1. But the script still doesn't work :(

 

I edited my post with your code.

Share this post


Link to post
Share on other sites

Hey Hoverguy...

your code works!

 

Thanks a lot for your help, very much appreciated!

Share this post


Link to post
Share on other sites

Now I am lost

https://community.bistudio.com/wiki/Arma_3_Difficulty_Menu

thirdPersonView = true; // 3rd person view
indicates a bool return not scalar

yet (difficultyOption 'thirdPersonView') returns a number?

In the config, yeah it is a bool but the command interprets it as a scalar because of this

#define true 1
#define false 0
Or maybe they simply changed it to scalar in the config, either way is correct. If you want to make your own presets use 0 or 1 or define true to be interpreted as 1 etc... because I dont know if the conversion is handled by the command or simply just defined in the default config as stated just above.

EDIT: Useful info page 6 here ->https://forums.bistudio.com/topic/188661-difficulty-overhaul/page-6 last two posts from rebelvg and That1Drifter

Share this post


Link to post
Share on other sites

 

Isn't it thirdPersonView instead of 3rdPersonView, along with what lala14 said, should work.

hint str (difficultyOption "thirdPersonView")

Returns 1 for me, means activated.

 

Using your code:

if(!isDedicated) then 
{
    waitUntil {!isNull (findDisplay 46)}; // Wait for main display
    if((difficultyOption "thirdPersonView") isEqualTo 1) then 
    {
        while {true} do 
        {
            waitUntil {cameraView isEqualTo "EXTERNAL" || cameraView isEqualTo "GROUP"};
            if((vehicle player) isEqualTo player) then 
            {
                player switchCamera "INTERNAL";
            };
        };
    };
};

Where do I stick it?

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

×