Jump to content
Sign in to follow this  
JeckoFR

Scripts for lock 3rd person

Recommended Posts

Hello, I'am french so, sorry for my basic english. I need the commands to disable 3rd person, weapons cursor, and the commands to force viewdistance and grass on my mission.

Thanks

Share this post


Link to post
Share on other sites

I doesn't have a server, but, i found a script with can force the 1st person off vehicle, but it's possible to switch between 1st and 3rd in vehicle, in a trigger

Share this post


Link to post
Share on other sites

Every body can change the difficulty, i play in multiplayer with this mission

Share this post


Link to post
Share on other sites

while {true} do {if(vehicle player != player) then {player switchCamera "Internal";};sleep 0.5;};

Share this post


Link to post
Share on other sites

BangaBob, I think he wanted the opposite, when in vehicle, be able to switch from 1st to 3rd. I may be wrong but I think you have to do the if(vehicle player = player) then... force internal

thanks for this code, I was curious also to know a way to programmatically do it!

regards,

Holo

Share this post


Link to post
Share on other sites

Google for "3rdperson.fsm" for another way to do it.

Share this post


Link to post
Share on other sites

This is what we use, forces no 3rd on player but allows any vehicle to have it , you can chnage as you see fit

Params_CameraView=1;  // could set in decription but no need for this mission
// ----------------------------------------------------------------------------
//                          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
Hello, I'am french so, sorry for my basic english. I need the commands to force viewdistance and grass on my mission.

Thanks

As Killzone mentioned:

setViewDistance = 1500

http://community.bistudio.com/wiki/setViewDistance

For terrain detail:

setTerrainGrid = 50

http://community.bistudio.com/wiki/setTerrainGrid

And your English is fine :p

Share this post


Link to post
Share on other sites

this script prevents 3rd person as long as the player is outside of a vehicle and is rather small codewise.Bangabobs script prevents people from using their ironsights since its always forcing the internal view.

[]spawn{
while {true} do {
	waitUntil{
			sleep 5; //used to save recources and allows for a quick "stylecheck" adjust as you see fit
			cameraOn == player && cameraView == "External"
		}; 
	player switchCamera "Internal";
	};
};

Share this post


Link to post
Share on other sites
this script prevents 3rd person as long as the player is outside of a vehicle and is rather small codewise.Bangabobs script prevents people from using their ironsights since its always forcing the internal view.

[]spawn{
while {true} do {
	waitUntil{
			sleep 5; //used to save recources and allows for a quick "stylecheck" adjust as you see fit
			cameraOn == player && cameraView == "External"
		}; 
	player switchCamera "Internal";
	};
};

how would I call this script? via mission init or trigger? Any downside on performance or anything if its checking this for each player every 5 seconds?

thanks

Share this post


Link to post
Share on other sites

You could put it in the init.sqf and wrap it in a if (hasInterface) then {... structure.

(you don't want a DS or HC's to run this but you do for a locally hosted server, MP client or SP)

EDIT:

Something like this:

if (hasInterface)then {
[] spawn {
	while {true} do {
		waitUntil{
				sleep 5; 
				cameraOn isEqualTo player and {cameraView == "External"}
		}; 
		player switchCamera "Internal";
	};
};
};

You can speed it up a bit by using isEqualTo instead of == in the cameraView statement. I was reticent to change it as I wasn't sure if "External" was in the right case. I guess you could do some cameraView isEqualTo toLower "external" check, but it's prob better to check the string and make sure the upper and lower cases are proper. (if you care about making it as quiuck as can be that is).

Edited by Das Attorney

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  

×