Home   Help Search Login Register  

Author Topic: Setting an Individuals viewdistance?  (Read 1097 times)

0 Members and 2 Guests are viewing this topic.

Cam51

  • Guest
Setting an Individuals viewdistance?
« on: 18 Nov 2004, 03:30:27 »
Is it possible?

If yes, then can it be possible to set triggers based on a player altitude?
ie: looking to increase viewdistance the higher u go, then drop it back down when u land.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Setting an Individuals viewdistance?
« Reply #1 on: 18 Nov 2004, 03:40:48 »
Are you talking about SP? Cause then the setviewdistance command would be what you are looking for...

But if it is for MP, and you're saying that command doesn't work for individual clients, then I don't know what to say. I assume fog is the same on all clients?

In either case, it isn't very hard for a player to set his own viewdistance really. I started making a script to do the same thing you are talking about, but after playing around with it, I decided it wasn't worth the effort, at least from my point of view. I guess it could be worthwhile still though. Check this thread here for a wee bit of info:

http://www.ofpec.com/yabbse/index.php?board=12;action=display;threadid=19777
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 Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Setting an Individuals viewdistance?
« Reply #2 on: 18 Nov 2004, 10:04:42 »
I could see that possible in any occasion.

In MP name all the players and Build a script called 'vd.sqs'. Launch it from the init.sqs or where ever for each playable units like:
[dude1] exec "vd.sqs"
[dude2] exec "vd.sqs"
[dude3] exec "vd.sqs"
...

then you'd need in 'vd.sqs' something like this:

_this select 0 = _unit
?!local _unit: exit

#loop
_height = (getpos _unit select 2)
?_height > 40: setviewdistance (_height * 10)
~2
goto "loop"

So when you're at 150 meters your viewdistance will be 1500 meters. Haven't tested that ever, but it should work.
« Last Edit: 18 Nov 2004, 10:05:17 by Artak »
Not all is lost.

Cam51

  • Guest
Re:Setting an Individuals viewdistance?
« Reply #3 on: 18 Nov 2004, 18:17:32 »
I get an Error...

_this select 0 |#|= _unit: Error Unknown Operator

I copied and pasted what you wrote and did exactly like you said.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting an Individuals viewdistance?
« Reply #4 on: 18 Nov 2004, 18:37:02 »
_unit = _this select 0
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Setting an Individuals viewdistance?
« Reply #5 on: 18 Nov 2004, 18:38:03 »
* Artak slaps forehead
doh  :-X
Not all is lost.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Setting an Individuals viewdistance?
« Reply #6 on: 19 Nov 2004, 00:22:50 »
i spy another problem.
the accepted range for the setviewdistance command are 500-5000
so for any height below 50 it won't accept the command.
I don't know if this will result in an error or what, or if you made it like that on purpose, but i just thought i'd point that out

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Setting an Individuals viewdistance?
« Reply #7 on: 19 Nov 2004, 01:29:25 »
Well simple enough to alter it like so:

?(_height >= 50) && (_height <= 500): setviewdistance (_height * 10)

That should work ok.


Planck
I know a little about a lot, and a lot about a little.

Cam51

  • Guest
Re:Setting an Individuals viewdistance?
« Reply #8 on: 19 Nov 2004, 02:22:10 »
it works but wowzers is it choppy.  Not because of graphics lag, but its gotta reset the view distance with every little elevation change :o.

If it was smoother it would be exactly what I need.  Thnx for ur help guys.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Setting an Individuals viewdistance?
« Reply #9 on: 19 Nov 2004, 02:28:58 »
Increase the delay in the loop.......Try ~5 or ~10 instead of ~2.


Planck
I know a little about a lot, and a lot about a little.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Setting an Individuals viewdistance?
« Reply #10 on: 19 Nov 2004, 09:39:14 »
The bigger the delay is, the harder the transition will be.
I.e. You get in a chopper and start elevating. Your viewdistance is 500. Then in 10 seconds you gain the altitude of 200 and B00m! the viewdistance suddenly changes to 2000. First you saw shit and now you can see like an eagle. Then you drop to 80 meters fast and Flash! your viewdistance is suddenly 800 again.

That doesn't sound like it would look good.

Maybe the setfog command is less cpu heavy and could be used in addition with the setviewdistance command to make the effect smoother between changes and yet lag free.
Setfog, like the other environment effect commands, should be local to the clients where they are executed, if I remember right.
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting an Individuals viewdistance?
« Reply #11 on: 19 Nov 2004, 12:55:35 »
The way to change viewdistance is to do it gradually.


_i = 500
_j = 5

#lop

~1

? _i > 850 : goto "next"

_i = _i + _j

setViewDistance _i

goto "lop"

#next
Plenty of reviewed ArmA missions for you to play

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Setting an Individuals viewdistance?
« Reply #12 on: 19 Nov 2004, 21:56:05 »
~Macguba
but... that has nothing to do with the units altitude, does it?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting an Individuals viewdistance?
« Reply #13 on: 20 Nov 2004, 16:19:42 »
No, that's just an example (lifted from a working mission) of how you can change viewdistance without anybody noticing.   As with so much in OFP it took some experiment to discover the optimal rate of 5m/s.    In your case it might be different, since the circumstances are different, but at least it gives you a starting point.
Plenty of reviewed ArmA missions for you to play

Cam51

  • Guest
Re:Setting an Individuals viewdistance?
« Reply #14 on: 04 Dec 2004, 02:39:05 »
that script you just posted doesn't work... or am I not using it correctly?  I just pasted it over the old script in the vd.sqs file.  Still that the init.sqs with dude1 in it.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Setting an Individuals viewdistance?
« Reply #15 on: 04 Dec 2004, 05:06:28 »
I've polished up and submitted my view distance script to the ed depot. It can be found here:

http://www.ofpec.com/editors/resource_view.php?id=731

The script will set it so the player can always see the ground X meters in front of him, regardless of height. For example, you could set it to be 1000 meters, which would mean that on the ground, viewdistance = 1000, while at an altitude of 500 meters, viewdistance = 1120.

I still think the player can just adjust this himself (I can set my VD to 5000 on Nogova without much lag), but if you only have v1.46, or a slow comp, this could be handy. And I guess you can use this kinda like you would use fog, to limit the player's view, as well.
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!