Home   Help Search Login Register  

Author Topic: 1st person  (Read 1327 times)

0 Members and 1 Guest are viewing this topic.

Offline ZapBrannigan

  • Members
  • *
1st person
« on: 15 Dec 2007, 21:38:02 »
hey,
I need to find a way to lock the player in the 1st person so that he cant switch to 3rd person.

thanks

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: 1st person
« Reply #1 on: 15 Dec 2007, 21:45:30 »
3rd person is an "easymode" thing that can be switched on by the player, so I'm not sure it is appropriate to turn it off (the player, if at all serious, will not have it enabled...if not serious, then he probably really does want to see around corners and get all the benefits from this, even if you don't want to give him this ability).

Anyway, should you wish to override the player's preferences, you could make a null action that used the 3rd person key:
Code: [Select]
player addAction ["", "", nil, 0, false, true, "tacticalView"];

(I think "tacticalView" is the correct key name, but, if not, a list of action-keys is at the BIKI)
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: 1st person
« Reply #2 on: 15 Dec 2007, 22:08:02 »
Also, a slightly sneakier way (not foolproof, but practically) is to use the switchCamera command to force the player to return to 1st person view all the time. There are two ways you can do that, the easy "hack" way and the more complicated way:

The hack way is simple:

Code: [Select]
while {alive Player} do
{
Player switchCamera "gunner";
sleep 0.1
};

That will switch the player's camera to "gunner" once every 0.1 seconds : this WILL screw with other things though (for instance inside vehicles where "gunner" view can be a more zoomed-in view), and might not be the best solution.

The more complicated way is to read through this thread carefully, and to figure out how to find out when the player is changing the camera, and then resetting it to "gunner" or "internal" whenever that happens. Potential (untested) code:

Code: [Select]
while {alive Player} do
{
_wpos = positionCameraToWorld [0,0,0];
waitUntil {_wpos distance (vehicle Player) > 3};
Player switchCamera "Internal";
hint "3rd person camera is disabled!";
sleep 0.2;
};

As I said, haven't tried, but might work. ;D

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: 1st person
« Reply #3 on: 18 Dec 2007, 00:00:22 »
Or

Code: [Select]
// Check_for_cheater.sqf
// Run it in init.sqf or init.sqs
// When a cutscene is going to start set incutscene = true and after the cutscene switch back to false

while {true} do
{
   if (alive player) then
   {
      if ((vehicle player distance positionCameraToWorld [0,0,0]) > 3) && (!incutscene)) then
      {
         cutText["YOU CHEATER GO BACK TO FIRST PERSON VIEW!", "BLACK OUT"];
         waitUntil {(vehicle player distance positionCameraToWorld [0,0,0]) < 3};
         cutText["AND DONT TRY THAT AGAIN!", "BLACK IN"];
      };
   };
   Sleep 1;
};

BTW, I dont think the action-key overwrite will have any effect.

Offline ZapBrannigan

  • Members
  • *
Re: 1st person
« Reply #4 on: 20 Dec 2007, 06:29:10 »
Ahh, great
I will have to see how they work.

thanks guys :)