Hi
Let's say I have a 4-seater airplane model. There are separated low detailed Exterior and high detailed Interior models. Passengers in 1st Person view mode, mostly look at the same elements.
The problem is with LodSelector. It looks fine for 1st seat. While sitting inside I can see only high detailed version of model (Interior), and the Exterior is kept hidden, this is OK. The problem appears whereas I switch to another seat, so the Exterior model assigned to 1st seat comes visible and overlaps with Interior model of 2nd seat. For every seat there is created individual LodSelector.
I don't get why the game even has to display the Exterior while being inside. That doesn't make sense for me.
tl;dr How can I halt the Exterior model from being displayed in 1st Person View Mode?
Is this understandable at all?
Thanks in advance
Cockpit LodSelector issue
Re: Cockpit LodSelector issue
Hmm. I can think of a few solutions just off of my memory:
- Try using the same LOD selector for all seats
- Create sepatate LOD selectors for each seat if first solution doesn't work
- Merge the 1st person and 3rd person meshes so that the details exist regardless of the player's camera being in 1st or 3rd person view
I think the vanilla M3A1 halftrack and the Hanomag uses the 3rd person mesh for the interior seats.
- Try using the same LOD selector for all seats
- Create sepatate LOD selectors for each seat if first solution doesn't work
- Merge the 1st person and 3rd person meshes so that the details exist regardless of the player's camera being in 1st or 3rd person view
I think the vanilla M3A1 halftrack and the Hanomag uses the 3rd person mesh for the interior seats.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Cockpit LodSelector issue
Thanks for quick answer.
So there is no option to simply turn the Exterior off using single line of code? Merging Exterior and Interior is not a way to go either since the Interior is very detailed.
So there is no option to simply turn the Exterior off using single line of code? Merging Exterior and Interior is not a way to go either since the Interior is very detailed.
Re: Cockpit LodSelector issue
Well, the 1P mesh shows only when the player is using 1st person camera (F9). That is how the code is set up.
rem *** lodSBDCockpit ***
ObjectTemplate.create LodObject lodSBDCockpit
rem -------------------------------------
ObjectTemplate.addTemplate SBDCockpitExternal
ObjectTemplate.addTemplate SBDCockpitInternal
rem -------------------------------------
ObjectTemplate.lodSelector sbdcockpitSelector
rem *** SBDCockpitExternal ***
ObjectTemplate.create SimpleObject SBDCockpitExternal
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.geometry SBD-6_fus_M1
rem *** SBDCockpitInternal ***
ObjectTemplate.create SimpleObject SBDCockpitInternal
ObjectTemplate.geometry 1p_SBD-6_cockpit_m1
rem *** sbdcockpitSelector ***
LodSelectorTemplate.create DistCompareSelector sbdcockpitSelector
LodSelectorTemplate.addLodDistance 10
LodSelectorTemplate.addLodComparison 0.5
Notice here that there is a "cockpit internal" and a "cockpit external". Also note the different meshes each of them use. The internal cockpit will use your 1P (detailed) mesh and only show when the payer is in first person view. Both meshes usually do not show at the same time. I see you don't want the 3P mesh to show when a player is in 1P view. Maybe it's the code you're using that's loading both?
rem *** lodSBDCockpit ***
ObjectTemplate.create LodObject lodSBDCockpit
rem -------------------------------------
ObjectTemplate.addTemplate SBDCockpitExternal
ObjectTemplate.addTemplate SBDCockpitInternal
rem -------------------------------------
ObjectTemplate.lodSelector sbdcockpitSelector
rem *** SBDCockpitExternal ***
ObjectTemplate.create SimpleObject SBDCockpitExternal
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.geometry SBD-6_fus_M1
rem *** SBDCockpitInternal ***
ObjectTemplate.create SimpleObject SBDCockpitInternal
ObjectTemplate.geometry 1p_SBD-6_cockpit_m1
rem *** sbdcockpitSelector ***
LodSelectorTemplate.create DistCompareSelector sbdcockpitSelector
LodSelectorTemplate.addLodDistance 10
LodSelectorTemplate.addLodComparison 0.5
Notice here that there is a "cockpit internal" and a "cockpit external". Also note the different meshes each of them use. The internal cockpit will use your 1P (detailed) mesh and only show when the payer is in first person view. Both meshes usually do not show at the same time. I see you don't want the 3P mesh to show when a player is in 1P view. Maybe it's the code you're using that's loading both?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Re: Cockpit LodSelector issue
Yeah Swaffy, this is how it works for me too (it works for all single seaters as well). However imagine a Passenger who sits just behind the pilot and who is able to see pilot's cockpit. Of course you could attach 1P cockpit model to Passenger seat but the problem is that the Pilot's 3P model goes visible for our Passenger (so Pilot 3P and Passenger 1P do overlap).
I tried the ObjectTemplate.CreateInvisible command but obviously it causes that 3P model is not visible from outside...
I tried the ObjectTemplate.CreateInvisible command but obviously it causes that 3P model is not visible from outside...
Re: Cockpit LodSelector issue
Sorry, I don't know a way around that.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
- Apache Thunder
- Posts: 1210
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Cockpit LodSelector issue
How detailed is the cockpit? You my not need to use a lod system for it. Passenger seats are seperate PCOs and can not share the same LOD system with respect to each other. As soon as you switch out from the driver seat the exterior LOD will activate regardless of what you want. Using separate LOD objects for each passenger seat would just result in all their exterior meshes being visible at once. You can use a dummy object for their exterior mesh, but you still need to find a way to make the exterior mesh of the driver seat get along with the cockpit meshes of the passenger seats as they will inevitably be both visible at the same time.
Even if you have the other seats use the same Lod object and lod selector, the game is hardcoded and can't "link" them together and thus the game engine can't tell when and when not to activate the exterior lod of the driver seat when switching to other seat positions. There's no communication going on between the separate objects so nothing happens.
The only way around this is to either alter the meshes in Gmax/3DS Max so that they can overlap without clipping, merge them into one object, or simply not have the passenger seats use a cockpit mesh at all.
Coding alone won't solve this issue unfortunately.
Even if you have the other seats use the same Lod object and lod selector, the game is hardcoded and can't "link" them together and thus the game engine can't tell when and when not to activate the exterior lod of the driver seat when switching to other seat positions. There's no communication going on between the separate objects so nothing happens.
The only way around this is to either alter the meshes in Gmax/3DS Max so that they can overlap without clipping, merge them into one object, or simply not have the passenger seats use a cockpit mesh at all.
Coding alone won't solve this issue unfortunately.
I have cameras in your head!
Re: Cockpit LodSelector issue
Alright, I was just hoping there is some helpful code line in the BF script that simply I don't know about. So it appears that altering the meshes is the only reasonable solution in my case, assuming that the way of handling interiors by BF42 engine is so freak.
Anyway thank you for your interest guys!
Anyway thank you for your interest guys!