Jump to content
Sign in to follow this  
rekkless

How to Lock 1st Person in Mission Parameters

Recommended Posts

So my group like to play custom zeus missions. I've built a series of maps based around our mods that utilize Zeus and MCC for the game master to make the most of.

However one thing I'd love to put into the parameters is to lock to 1st person.

Now I know you can do it in the editor, but I don't want to lock the mission to 1st person only. I just want the option to turn it on or off in the mission parameters depending on the type of mission we are going to create and how serious a mil sim we want to go.

We have the Death Match 4 missions on our server and in the parameters of that mission it has the option to allowed 3rd person or to disable it. So obviously there must be a way.

Can anyone let me know the script?

Cheers.

Share this post


Link to post
Share on other sites

restrict_view.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;
		};
	};
};
};

DESCRIPTION.EXT


class Params
{
class 3rdViewRestrictions
{
	title = "3rd View Restrictions";
	values[] = {0,1};
       texts[] = {"Script Disabled","Script Enabled"};
	default = 0;
};

};

INIT.SQF

//Grab parameters and put them into readable variables
for [ {_i = 0}, {_i < count(paramsArray)}, {_i = _i + 1} ] do
{
	call compile format
	[
		"PARAMS_%1 = %2",
		(configName ((missionConfigFile >> "Params") select _i)),
		(paramsArray select _i)
	];
};


if (PARAMS_3rdViewRestrictions == 1) then {_null = [] execVM "restrict_view.sqf";}; 

---------- Post added at 08:47 ---------- Previous post was at 08:39 ----------

You can have a look at one of my mission files and see how I done mine.

https://drive.google.com/open?id=0B7f7inkZ9lkafldlNThMR2oxWFQ2R21LOTBPcWFrSG5iOEY2THhuRUtTc1h1b1RqN2FNY28&authuser=0

Edited by kaysio

Share this post


Link to post
Share on other sites

You sir are a bloody legend. Thank you SO much man.

But I've noticed while it is locked to 1st person you still have 3rd person for vehicles.

I would like it so that if it is locked to 1st person it is totally locked. No crutches here. 1st person only in vehicles 1st person only in jets and helicopters.

How can I script that in?

Share this post


Link to post
Share on other sites

any idea what I would edit. It all might as well be in a foreign language I have no idea what any of it means.

Share this post


Link to post
Share on other sites
any idea what I would edit. It all might as well be in a foreign language I have no idea what any of it means.

Edit server profile and disable 3rd person view all together in Difficulties, no need for script workarounds if you don't want 3rd view at all.

Share this post


Link to post
Share on other sites

No I don't want to lock the server to full time 1st person. I want to be flexible, on less serious more muck around pub kind of missions I couldn't care less if people use 3rd person. But in TVT, PVP or more serious CO-Op games having the ability to to easily disable 3rd person in the mission parameters would be ideal.

Share this post


Link to post
Share on other sites
I want to be flexible, on less serious more muck around pub kind of missions I couldn't care less if people use 3rd person.
You can have two identical difficulty presets which will differ only by 3rd person view setting.

But if you still want to have it your way, you're almost there. All you need to do is just set Params_CameraView in kaysio's restrict_view.sqf to 3 instead of 1, like this:

Params_CameraView=3;

That should do the trick. :)

Share this post


Link to post
Share on other sites
Edit server profile and disable 3rd person view all together in Difficulties, no need for script workarounds if you don't want 3rd view at all.

true, but must admit it really would be convenient to be able to control this as a missionmaker with a simple parameter in the desciption.ext rather than depending on players or servers to do it for us.

sometimes first person is integral to the gameplay you are designing or when the match is serious and you dont want people peeking over cover while safely behind it.

Share this post


Link to post
Share on other sites
You can have two identical difficulty presets which will differ only by 3rd person view setting.

But if you still want to have it your way, you're almost there. All you need to do is just set Params_CameraView in kaysio's restrict_view.sqf to 3 instead of 1, like this:

Params_CameraView=3;

That should do the trick. :)

You sir are a bloody legend. Thanks mate it works a treat.

Share this post


Link to post
Share on other sites

restrict_view.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;
			};
		};
	};
};

DESCRIPTION.EXT

	
class Params
{
class 3rdViewRestrictions
	{
		title = "3rd View Restrictions";
		values[] = {0,1};
        texts[] = {"Script Disabled","Script Enabled"};
		default = 0;
	};

};

INIT.SQF

	//Grab parameters and put them into readable variables
	for [ {_i = 0}, {_i < count(paramsArray)}, {_i = _i + 1} ] do
	{
		call compile format
		[
			"PARAMS_%1 = %2",
			(configName ((missionConfigFile >> "Params") select _i)),
			(paramsArray select _i)
		];
	};


	if (PARAMS_3rdViewRestrictions == 1) then {_null = [] execVM "restrict_view.sqf";}; 

---------- Post added at 08:47 ---------- Previous post was at 08:39 ----------

You can have a look at one of my mission files and see how I done mine.

https://drive.google.com/open?id=0B7f7inkZ9lkafldlNThMR2oxWFQ2R21LOTBPcWFrSG5iOEY2THhuRUtTc1h1b1RqN2FNY28&authuser=0

 

How can I make it 3rd person in vehicles only without accessing the parameters menu on the server? Just load the mission and is it set? And will this work with ACE3?

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  

×