PDA

View Full Version : Custom view angles for cockpits...how?



AXE
Jan 17 2003, 22:42
I would like to be able to turn the pilot view far enough
back that I can see the wings, but I can't seem to figure
out how to edit the max\min view angles for pilot view.
currently the view can only move 100 degrees left and
right, 25 degrees up and 15 degrees down. I've tried to
change the viewpilotbase class (from the commented .cpp
files) in my .cpp, but it always gives me the "undefined
base class" error when I load it up. Some help would
be appreciated. http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

BratZ
Jan 17 2003, 23:20
All you really need to change or add to under your cfgvehicles in the config.cpp
Is this:
fov=0.5;

setting it higher (.6 +) will bring you farther away (wider fov)
setting it lower will give the zoom in effect


But if you want to control how much you can move your head you need to add/change a class viewpilot that is also defined under you cfgvehicles

class ViewPilot
{
initFov=0.600000;
minFov=0.400000;
maxFov=0.850000;
initAngleX=0;
minAngleX=-75;
maxAngleX=10;
initAngleY=0;
minAngleY=-150;
maxAngleY=150;
};

AXE
Jan 17 2003, 23:59
Thank you very much! http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

mooncaine
Feb 18 2003, 19:33
I tried your FOV suggestion, but saw no difference at all. My config.cpp looks like this:
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles
{
class All {};
class AllVehicles&#58; All {};
class Land&#58; AllVehicles {};
class LandVehicle&#58; Land {};
class Tank&#58; LandVehicle {};
class MOO_TT&#58; Tank
{
*** *** *** *** *** *** *** ***vehicleclass=&#34;Armored&#34;;
*** *** *** *** *** *** *** ***ejectDeadCargo=1;
*** *** *** *** *** *** *** ***armor=750;
*** ***armorStructural=3.5;
&#60;blah blah&#62;
getInRadius = 5.5;
// *** *** *** *** *** *** *** ***forcehideGunner = true;
*** *** *** *** *** *** *** ***forceHideDriver = false;

irScanRange = 4000; // long range radar
irScanGround = true; // NO IR on ground targets
gunnerCanSee = CanSeeOptics+CanSeeEar+CanSeeCompass+CanSeeRadar;
commanderCanSee = CanSeeOptics+CanSeeEar+CanSeeCompass+CanSeeRadar;
// driverCanSee = CanSeeOptics+CanSeeEar+CanSeeCompass+CanSeeRadar;
driverCanSee = CanSeeAll
// fov=0.9
// perhaps default is .5? I read that setting it .6 and higher gives wider FOV.
// RESULTS&#58; changing this setting has had NO effect, so I commented it.[/QUOTE]<span id='postcolor'>

Of course, I tried it with the "fov=0.9" uncommented. I tried values of 0.2, 0.5, 0.6, 0.8 and 0.9. I viewed from commander, gunner, driver and backseat positions, turned in and turned out. I also looked at the external view and the tactical view. No difference.

Why? Is it in the wrong place in the config? It&#39;s within the "class MOO_TT: Tank" .... [or so I believe].

AXE
Feb 18 2003, 20:04
FOV refers to how "zoomed in" the ziew is.
you&#39;ll need to add this to your cfgvehicle section:
class ViewPilot
{
initFov=0.700000;
minFov=0.300000;
maxFov=0.850000;
initAngleX=0;
minAngleX=-50;
maxAngleX=25;
initAngleY=0;
minAngleY=-115;
maxAngleY=115;
};
initFOV = standard view FOV
minFOV = how much you can zoom out
maxFOV = how much you can zoom in
minanglex = how far you can look down
maxanglex = how far you can look up
min/maxangley = max left and right

mooncaine
Feb 18 2003, 20:44
hmm, OK. I&#39;ll paste that stuff in and give it a test. Thanks&#33;

....

OK, I pasted in your given ViewPilot class, and I tried several tests with different values--I even made screenshots to compare, in case the values produced only very subtle results.

Nothing changes in my tank. All the occupants, including the driver, have exactly the same FOV and range of head motion, regardless of the contents of this file.

What do you think is the problem? Is it the *position* in the config.cpp file? I put this in last, just before the last closing brackets that close out the cfgVehicle class.

Or is there yet something else required, such as further lines in the config that force these viewPilot values to be applied to the various crew members in the tank?

mooncaine
Feb 18 2003, 21:23
OK, I made some progress: position was the problem. If I put this section right after the very first open bracket of my "class MOO_TT: Tank", then the tank&#39;s driver does indeed show the changes you told us about. Great&#33;

I infer from this example that, if I want to affect the view angles of other occupants, I will have to know which names to apply to them, and create a new ViewFoo class for each "Foo" in the vehicle.

First, I&#39;ll try ViewCommander and ViewGunner ....

YEPPER&#33; That&#39;s IT&#33; Thanks&#33;

mooncaine
Feb 18 2003, 21:39
I&#39;m especially happy about learning this because I want to simulate next-generation tanks, as well as current tanks that have on-board video systems for viewing all sides of the vehicle.

It occurs to me that I can build my current test tank, a fictional model [because I&#39;m learning and don&#39;t want to be constrained by &#39;real&#39; tank specs], so that the commander can look over his shoulder and see the view out that back of the tank. I can model up a frame as if he&#39;s looking at a viewscreen, when in fact he&#39;s just looking through a hole in the geometry. I guess I can do the same for side views, if I can be sure that the gunner is hidden, but since both commander and gunner interior environments are in the "View Cargo" LOD, I&#39;m not sure that&#39;ll be possible. One side view would be looking at the gunner&#39;s head ....

I noticed that one of the named selections in the t72 is a mirror; now that I think about it, I can&#39;t recall whether any vehicles have rear or side mirrors that function. I&#39;m going back to test that. My fictional tank, conceived for urban and counterterrorist ops, should have external side view mirrors like a truck, I&#39;d think .....

BratZ
Feb 18 2003, 22:32
Oops sorry I didn&#39;t follow this,yes viewpilot is only for pilot heres some more (i&#39;ll post from cfgvehicles so you see it has to under that class):


class Plane: Air {};
class A10: Plane {};
class BrtSB2C: A10
{
scope=public;
crew = "SoldierWPilot";
*** *** *** *** *** *** *** ***side = 1;
displayName="Curtiss SB2C Helldiver US Navy";
driverAction = ManActCessnaCargo;
*** *** *** *** *** *** *** ***typicalCargo[]={SoldierWPilot};
*** *** *** *** *** *** *** ***driverCanSee = CanSeeEye+CanSeeEar;
*** *** *** *** *** *** *** ***cargoCanSee = CanSeeEye+CanSeeEar;
*** *** *** *** *** *** *** ***//gunnerAction[]={"ManActCessnaCargo"};
*** *** *** *** *** *** *** ***gunnerIsCoDriver[]={1,0};
accuracy=0.40;
vehicleClass = "BraTTy WW2 Warplanes";
*** *** *** *** *** *** *** ***namesound= "plane";
*** *** *** *** *** *** *** ***//extCameraPosition[] = {0,0,-12};
*** *** *** *** *** *** *** ***castdrivershadow= 1;
armor=27;
*** *** *** *** *** *** *** ***cost=200000;
*** *** *** *** *** *** *** ***landingSpeed=115;
*** *** *** *** *** *** *** ***maxSpeed = 487;
*** *** *** *** *** *** *** ***landingAoa="3.5*3.1415/180";
flapsFrictionCoef=2.2;
model="&#92;Brt_SB2c&#92;BrtSB2C.p3d";
*** *** *** *** *** *** *** ***type="VAir";
//threat[] VSoft, VArmor, VAir
*** *** *** *** *** *** *** ***threat[]={1.00000,1.,1.00000};
aileronSensitivity = 0.3;
elevatorSensitivity = 0.25;
gearRetracting = true;
ejectSpeed[]={0,0,0};
fov=0.6;
*** *** *** *** *** *** *** ***preferRoads=false;
*** *** *** *** *** *** *** ***formationX=20;
formationZ=30;
*** *** *** *** *** *** *** fuelCapacity=160;
noseDownCoef = 0.7;
precision=60;
brakeDistance=50;
*** *** *** *** *** *** *** ***hasGunner=1;
*** *** *** *** *** *** *** ***ejectDeadCargo=1;
weapons[]={"brtfmgun"};
magazines[]={brtfmgun,brt1kb};
*** *** *** *** *** *** *** ***minGunElev=0; // default - fixed gun
maxGunElev=+60;
minGunTurn=-60;
maxGunTurn=+60;
*** *** *** *** *** *** *** ***hiddenSelections[]={"fpt1","fpt2","fpt3","fpt4","npt1",&amp
;quo
t;npt2","npt3","npt4"};
transportsoldier=1;
transportAmmo=0;
*** *** *** *** *** *** *** ***camouflage=8
*** *** *** *** *** *** *** ***audible=6;
*** *** *** *** *** *** *** ***soundEngine[]={"&#92;Brt_SB2C&#92;engine.wav",1,4};
soundEnviron[]={Objects&#92;noise,db-30,1.0};
soundServo[]={Vehicles&#92;gun_elevate,db-30,1};
*** *** *** *** *** *** *** ***animated=1;
*** *** *** *** *** *** *** ***gunnerOpticsModel = "optika_HK";
*** *** *** *** *** *** *** ***gunnerUsesPilotView = false;
*** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***class ViewPilot
{
initFov=0.600000;
minFov=0.400000;
maxFov=0.850000;
initAngleX=0;
minAngleX=-75;
maxAngleX=50;
initAngleY=0;
minAngleY=-150;
maxAngleY=150;
};
class ViewOptics
{
initAngleX=0;
minAngleX=0;
maxAngleX=0;
initAngleY=0;
minAngleY=0;
maxAngleY=0;
initFov=0.500000;
minFov=0.500000;
maxFov=0.500000;
};
class ViewGunner
{
initAngleX=5;
minAngleX=-85;
maxAngleX=30;
initAngleY=0;
minAngleY=-120;
maxAngleY=120;
initFov=0.700000;
minFov=0.400000;
maxFov=0.850000;
};
*** *** *** *** *** *** *** *** class TransportMagazines
{

class _xx_SmokeShell
{
magazine="SmokeShell";
count="2";
};
};


Passengers would use a "viewcargo" class

And I was not correct in stating that the fov is for pilot,it actually is only for your outside view(3d view)

ie: ***fov=0.6;

BratZ
Feb 18 2003, 22:45
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (mooncaine @ Feb. 18 2003,23:39)</td></tr><tr><td id="QUOTE">I&#39;m especially happy about learning this because I want to simulate next-generation tanks, as well as current tanks that have on-board video systems for viewing all sides of the vehicle.

It occurs to me that I can build my current test tank, a fictional model [because I&#39;m learning and don&#39;t want to be constrained by &#39;real&#39; tank specs], so that the commander can look over his shoulder and see the view out that back of the tank. I can model up a frame as if he&#39;s looking at a viewscreen, when in fact he&#39;s just looking through a hole in the geometry. I guess I can do the same for side views, if I can be sure that the gunner is hidden, but since both commander and gunner interior environments are in the "View Cargo" LOD, I&#39;m not sure that&#39;ll be possible. One side view would be looking at the gunner&#39;s head ....

I noticed that one of the named selections in the t72 is a mirror; now that I think about it, I can&#39;t recall whether any vehicles have rear or side mirrors that function. I&#39;m going back to test that. My fictional tank, conceived for urban and counterterrorist ops, should have external side view mirrors like a truck, I&#39;d think .....[/QUOTE]<span id='postcolor'>
Make sure for your vehicle positions you have the correct proxy,and try to use proper positions to match your base class

ex: Plane

cessnapilot : pilot
cessnacargo : passenger

and you also need the matching view otherwise you will experience behind the head or on the ground view stuff

On that plane example you need a View - Pilot and a View-Cargo LOD

Now for a tank I see you used a t72 so use matching positions (I dont make tanks,dunno exact names ,but)
Looking in Data3d I see some proxies:

t72commander -View Commander
t72gunner -View Gunner
t72driver - View Pilot

and some "out" positions I see,but you get the idea?

mooncaine
Feb 19 2003, 02:42
omigawd, it&#39;s so great to find out so much info. BratZ, you maybe saved me a few days of searching, testing, and retesting.

I was just about to ask, "Where/How do I find the proxies I want?", because I don&#39;t want t72 crew, but rather the most modern looking western crew I could get. I was also about to ask, "Where/How do I find the optics I want?"

But I read between the lines, and I realized that the "Data3D" you mentioned looking through was no folder that I had.... it was a PBO file on the CD&#33; I decompressed that, and I haven&#39;t even tried opening up any of these models, but I want to say it&#39;s already fantastic just knowing what&#39;s in there.

If I understand this right, it means I can create a proxy for anything in the Data3d.PBO file .... and that means I can use the proxies, and optics, I want. Correct me if I&#39;m wrong.

AXE
Feb 19 2003, 21:04
The data3d.pbo is also in your ofp/dta folder and
your ofp/res/dta (if you have resistance) folder. However,
every object in this folder is in an un-editable format called
"ODOL", while the models you make in oxygen are in "MLOD"
format.

mooncaine
Feb 19 2003, 21:50
Ah. Yeah, I discovered that I couldn&#39;t open any of those models--what a shame--but at least I could make a PDF of the file listing. I can use those names to incorporate those models into my own addons, via config files... right?

I was wondering if that were the way to add an M2 gunner position to the bed of a truck ....

BratZ
Feb 19 2003, 21:58
Yes thats how its done,proxy the M2 to the vehicle,or make your own.

Have you checked Brssebs nice tutorial site? If you look at the car tut,shows some proxy naming and placement

Weapon proxies are similiar but more confusing,I have not completely mastered them yet,and whoever has isn&#39;t saying much ,as it seems each and every modeler has to figure this stuff out,lol