Home   Help Search Login Register  

Author Topic: "SetViewDistance" 2 questions.  (Read 2220 times)

0 Members and 2 Guests are viewing this topic.

Offline DOA

  • Members
  • *
  • ArmA 2 Rules - Nothing else comes close!
    • The Graveyard Shift
"SetViewDistance" 2 questions.
« on: 13 Feb 2005, 00:55:06 »
How can I use the "SetViewDistance" to set the view distance in my custom made missions? Where do you place this command?  What is the proper syntax?

Thanks.
« Last Edit: 13 Feb 2005, 00:57:17 by DOA »
ArmA 2 - Nothing else comes close!
--
DOA

Offline oyman

  • Members
  • *
  • king of pings
Re:"SetViewDistance" 2 questions.
« Reply #1 on: 13 Feb 2005, 01:44:34 »
you can put in in the Init of any vehicle or soldier

the code is

this setviewdistance x

x= your desired viewing distance

so like

this setviewdistance 2000

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:"SetViewDistance" 2 questions.
« Reply #2 on: 13 Feb 2005, 03:47:15 »
Quote
this setviewdistance x
Not quite. You don't pass an object to the command, only a number:

setviewdistance x

This sets the maximum distance the player can see on his screen. I'm not sure if it has any effect on the AI. You can put that line in any place that you would normally put script-lines: init fields, "on activation" fields (of triggers/WPs), scripts, etc.

Keep in mind that if the player has resistance, then he can manually adjust the viewdistance himself (by going into his video options), even after you set it with this command.

Check here for the com ref entry:
http://www.ofpec.com/COMREF/index.php?action=details&id=322

EDIT

I see this was posted in the MP board, so I assume you want to know how it works in MP. I believe the viewdistance will be the same for all players, but I could be mistaken. There is a script here that automatically negotiates the VD for MP:
http://ofpec.com/editors/resource_view.php?id=473
« Last Edit: 31 Dec 2008, 20:20:15 by Planck »
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:"SetViewDistance" 2 questions.
« Reply #3 on: 13 Feb 2005, 06:09:17 »
I see this was posted in the MP board, so I assume you want to know how it works in MP. I believe the viewdistance will be the same for all players, but I could be mistaken. There is a script here that automatically negotiates the VD for MP:
http://ofpec.com/editors/resource_view.php?id=473
viewDistance is "one of those commands".  Old man locality again ;)

The effect of a viewDistance call is local to the machine where it is issued.

What does that mean for MP mission editing?
  • You can call VD in the init line of an object and it will be issued on all machines, making things "just work".
  • Calling viewDistance <x> in the mission's init.sqs will do the same since it is run on all machines
  • One can imagine having different view distances for different players. Classic example: high VD for pilots, lower for grunts.
  • AI:s are affected by the view distance, so don't forget to issue it on the (possibly dedicated) server too
Example of how do do #3 above, different VD for different player roles. Imagine there being a bunch of normal foot soldier player slots and two pilot slots. The playable pilots are named "CASPilot" and "SARPilot" in the mission editor.
Code: [Select]
; init.sqs
; View distance is 900 m by default in MP. We'll use 1000 for grunts and 2000 for pilots here
_vdist = 1000

? player in [CASPilot, SARPilot]: _vdist = 2000

setViewDistance _vdist

Good luck!
« Last Edit: 31 Dec 2008, 20:22:39 by Planck »

Offline DOA

  • Members
  • *
  • ArmA 2 Rules - Nothing else comes close!
    • The Graveyard Shift
Re:"SetViewDistance" 2 questions.
« Reply #4 on: 13 Feb 2005, 06:57:40 »
Thank you gentlemen, outstanding replies.  Yes I wan to set he VD longer in a MP mission for pilots. Being able to set a greater view distance for seperate players is great. Thank you all...DOA
ArmA 2 - Nothing else comes close!
--
DOA