Adding FOV to seperate camera view?

Adding FOV to seperate camera view?

does anyone know how this was done??

takiwa

Posts: 128
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Adding FOV to seperate camera view?

to clarify my question...

I know how to code a zoomFOV onto a camera. What I don't understand is how he was able to separate the cameras, and still have access to the external views as well. I have tried switchable cams (like switchable ammo) to no avail, and I can't seem to understand what kind of sorcery this is...
takiwa

Posts: 128
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Adding FOV to seperate camera view?

If i would guess, i think its using the "allow nose camera view in aircraft" code. Its a server setting that only work for planes, but you could propably use it on other vehicles to.
You have to do a little digging becasue i dont remember exactly how this works, but i think it may be just the "ObjectTemplate.SetVehicleCategory VCAir" that triggers the behavior of that "extra" camera.

rem *** AichiValCamera ***
ObjectTemplate.create Camera AichiValCamera
ObjectTemplate.OutsideHudOffset 0.004/0/3.5 <-------------

just guessing really.

freddy

Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Adding FOV to seperate camera view?

He and I already use that code. When you watch the video, he goes from a driver view to a standard sight view. This is the offset code you mentioned. I use it as well in my mod.

What he has done that I can'r figure out is he has added an additional camera view with an FOV to simulate zoom, separate from the 4 existing cam view and the offset cam. I have tried to figure this out for about 3 weeks now, and for the life of me I can't find how he did it...
takiwa

Posts: 128
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Adding FOV to seperate camera view?

edit: i thought i recognized that vid check here http://team-simple.org/forum/viewtopic. ... 42#p108942

freddy

Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm

Re: Adding FOV to seperate camera view?

takiwa wrote:What he has done that I can'r figure out is he has added an additional camera view with an FOV to simulate zoom, separate from the 4 existing cam view and the offset cam. I have tried to figure this out for about 3 weeks now, and for the life of me I can't find how he did it...

I'm also interested in this ...

He added Zoom to the second F9 view. So you have 1x zoom for normal F9 camera then secondary F9 camera has zoom.

Swaffy

Posts: 1711
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Adding FOV to seperate camera view?

Swaffy wrote:I'm also interested in this ...

He added Zoom to the second F9 view. So you have 1x zoom for normal F9 camera then secondary F9 camera has zoom.

actually...no. His first F9 view is of the driver view. The second F9 view (or offset cam view) is the gunner reticle. He has both of these intact. I use that same system for my mod as well. According to his video, he also has full use of F10-F12 views.

The interesting part is when he switches from the driver/gunner view (F9 and offset) to his "new" cam view which has an FOV coded to it. At least that;s what I see when I watch the vid, it seems he has actually added another cam view. Am I seeing this wrong?
takiwa

Posts: 128
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Adding FOV to seperate camera view?

Oh, I get that part since I did it to a stationary scoped MG42.
ObjectTemplate.vehicleFov 0.25

I added this to the PCO and it gives the camera zoom. The camera doesn't have any code on it.

If we can find a way to toggle this zoom we could make some pretty cool stuff... also, in the video he is not switching seats. That is why the "unzoomed" camera is next to the barrel, because it is still the same seat.

I looked at the code in the mod and can't seem to find any zoom code... period. It just looks like a normal camera. The PCO doesn't have any zoom code either.

Code: Select all
rem *** TigerTower ***ObjectTemplate.create RotationalBundle TigerTowerObjectTemplate.setNetworkableInfo TigerTurretInfoObjectTemplate.setAttachToListener 1ObjectTemplate.loadSoundScript Sounds/tigertower.sscObjectTemplate.geometry Tiger_Tow_M1ObjectTemplate.hasMobilePhysics 1ObjectTemplate.hasResponsePhysics 1ObjectTemplate.hasCollisionPhysics 1rem -------------------------------------ObjectTemplate.addTemplate TigerGunBaseObjectTemplate.setPosition 0/0.325/1.295rem ObjectTemplate.addTemplate TigerTowerHatchrem ObjectTemplate.setPosition -0.792/0.95/-0.232ObjectTemplate.addTemplate Tiger_MG_PCO1ObjectTemplate.setPosition -0.482/0.85/-1.05ObjectTemplate.setRotation 180/0/0rem -------------------------------------ObjectTemplate.setMaxSpeed 6/0/0ObjectTemplate.setAcceleration 100/0/0ObjectTemplate.setInputToYaw c_PIMouseLookXrem *** TigerGunBase ***ObjectTemplate.create RotationalBundle TigerGunBaseObjectTemplate.setNetworkableInfo TigerGunInfoObjectTemplate.setAttachToListener 1ObjectTemplate.loadSoundScript Sounds/TigerGunBase.sscrem -------------------------------------ObjectTemplate.addTemplate lodTigerCockpitObjectTemplate.addTemplate TigerGunBarrelObjectTemplate.addTemplate Coaxial_MG34ObjectTemplate.setPosition 0.5/-0.105/-0.699ObjectTemplate.addTemplate TigerCameraObjectTemplate.setPosition -0.77/-0.05/0.23rem -------------------------------------ObjectTemplate.setMinRotation 0/-17/0ObjectTemplate.setMaxRotation 0/6.5/0ObjectTemplate.setMaxSpeed 0/3/0ObjectTemplate.setAcceleration 0/100/0ObjectTemplate.setInputToPitch c_PIMouseLookYrem *** lodTigerCockpit ***ObjectTemplate.create LodObject lodTigerCockpitrem -------------------------------------ObjectTemplate.addTemplate TigerCockpitExternalObjectTemplate.addTemplate TigerCockpitInternalObjectTemplate.setPosition -0.77/-0.1/0.46rem -------------------------------------ObjectTemplate.lodSelector TigercockpitSelectorrem *** TigerCockpitExternal ***ObjectTemplate.create SimpleObject TigerCockpitExternalObjectTemplate.geometry Tiger_Cannon1_M1rem *** TigerCockpitInternal ***ObjectTemplate.create SimpleObject TigerCockpitInternalObjectTemplate.geometry 1p_Tiger_Gunner_m1rem *** TigercockpitSelector ***LodSelectorTemplate.create DistCompareSelector TigercockpitSelectorLodSelectorTemplate.addLodDistance 1LodSelectorTemplate.addLodComparison 0.5rem *** TigerCamera ***ObjectTemplate.create Camera TigerCameraObjectTemplate.OutsideHudOffset 0.0005/0.617/0.9

Swaffy

Posts: 1711
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Adding FOV to seperate camera view?

Swaffy wrote:I looked at the code in the mod and can't seem to find any zoom code... period. It just looks like a normal camera. The PCO doesn't have any zoom code either.

He hasn't released this code yet in the mod, just the video...I talked to him about sharing the code, but he doesn't want to, although he said it has a bug that he can't figure out, but doesn't want any help fixing it :/
takiwa

Posts: 128
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Adding FOV to seperate camera view?

takiwa wrote:
Swaffy wrote:I looked at the code in the mod and can't seem to find any zoom code... period. It just looks like a normal camera. The PCO doesn't have any zoom code either.

He hasn't released this code yet in the mod, just the video...I talked to him about sharing the code, but he doesn't want to, although he said it has a bug that he can't figure out, but doesn't want any help fixing it :/

Since this topic is less than a year old I think it's not a problem for me to reply here.
It's obvious why you couldn't find any zoom code: he placed it in a place where nobody will ever think to search for it (I think it was done in purpose). But with the help of search software I could locate following lines in... game.rfa\bf1942\game\damage_system\7,62mmR.con:
Code: Select all
ObjectTemplate.active brummbarObjectTemplate.vehicleFov 0.4... <--- about 200 similiar strings which activate almost every vehicle in gameconsole.bindKeyToConsoleScript 1 Bf1942/game/damage_system/47mmL43

A tricky one, isn't it?
And in 47mmL43.con almost the same story:
Code: Select all
ObjectTemplate.active brummbarObjectTemplate.vehicleFov 0.999...console.bindKeyToConsoleScript 1 Bf1942/game/damage_system/7,62mmR

So he just made these 2 scripts which activate each other after pressing binded key. The question is, how do we first execute this script in game? Here it is, in 9x19mmBR.con:
Code: Select all
ControlMap.create defaultGameControlMapControlMap.addKeyToTriggerMapping c_GIScript1 IDFKeyboard IDKey_F9 c_CMNonRepetiveconsole.bindKeyToConsoleScript 1 Bf1942/game/damage_system/7,62mmR... - similiar strings assigning C, F10, F11, F12 and E keys to next c_GIScripts and binding different "caliber" scripts to these keys.

And now the main file which executes 9x19mmBR.con file - materialManagerSettings.con:
Code: Select all
...run damage_system/9x19mmBR <---4357th string...

Well, it turned out to be pretty easy-to-implement feature. I hope I can use this script calling to make player being able to stick his head out of tank to have better view of battlefield. But I don't know if there is a possibility to bind "trigger mapping to console script" so the player can press his crouch key (for me it's left ctrl) to call script, not the mod-precoded key.

metan

Posts: 2
Joined: Sun Oct 28, 2018 7:53 pm