Jump to content
Official BF Editor Forums
Sign in to follow this  
Dogbox

Parenting A Scope

Recommended Posts

I parented my ACOG scope onto the m16, but when in 1p view, it floats in the wrong position. But when I switch it to 3p in the editor it shows it perfectly mounted.

1p:

wroks_not.png

3p:

works.png

How can I fix this?

Share this post


Link to post
Share on other sites
I parented my ACOG scope onto the m16, but when in 1p view, it floats in the wrong position. But when I switch it to 3p in the editor it shows it perfectly mounted.

How can I fix this?

This looks like it could be an XFORM problem. BEFORE YOU DO ANYTHING SAVE YOUR MAX FILE...... You cannot undo an XForm

I'm thinking that the best way to solve this is to unlink all parts from the hierarchy (you do not want any meshes linked, not to helpers or each other), select all meshes and apply "Reset XForm" located on the "Utilities Tab" (in case you're not sure). Then, with all mesh pieces still selected, convert to poly or go through and collapse the stack on each item. If you get inverted faces after this, just select them and "flip" located under poly tools. Now, rebuild your hierarchy and export, all should line up perfectly. If you want, you could unlink each mesh item one at a time, apply XForm, collapse and then re-attach to the hierarchy. Which ever way works best for you. If you are still having issues post screens again if it's something new. GL.

**EDIT** I'm wondering why you have the scope parented (Linked) to the gun instead of "Attached" on the poly level? Is there a reason for this I'm not aware of?

Edited by showNOmercy

Share this post


Link to post
Share on other sites

Yeah, the reason is cause I'm using Gmax not 3ds max.

Share this post


Link to post
Share on other sites
Yeah, the reason is cause I'm using Gmax not 3ds max.

GMAX is a chopped down version of 3ds max, you should still have the ability to attach geometry at the sub-object level. With your weapon selected, goto the "Modify" panel and you'll see the "Attach" button. Click it, then click on the parts you need to attach, like the ACOG. When you're finished right-click to exit Attach mode. If you haven't, I'd still reset the XForm on all your meshes, this is a part of every workflow for a game asset or any mesh to be exported. Certain cases where you need to be careful is when you have pivots that do not align with the world, Reset XForm will destroy local pivots.

AttachGeometry_040509.jpg

Edited by showNOmercy

Share this post


Link to post
Share on other sites

I want to know why it floats and how I can fix it in the editor

Share this post


Link to post
Share on other sites

You can't. If you attached a seperate model ( your scope ) via the editor , it will be in the same position, regardless if its the 1P or the 3P model. Real scoped weapons use a different approach and have the scope in the model ( in the geom0-Lod1 tree ) and do not attach it via the editor. It is then switched into the view with the 'zoomLod 1' statement in the zoom component of the weapon .

Your only chance is to decide which view is more important for you , 1P or 3P and then position the scope accordingly ( and aligned with the camera bone ).

Share this post


Link to post
Share on other sites

a few other pointers...

all handweapon meshes must have pivots set at the origin, 0/0/0 on the grid.

reset xfrom is very very important to do prior to uvmapping and creation of normal maps,flipped normals dont look so great..lol

.

and just to add to the confusion..lol...for minor adjustments of a mesh...

select the problem mesh then move it to the desired position,then go to hierachy tab and select "affect pivot only",using the transform move tool set the pivot to the origin(0/0/0),then select "affect object only" (hierachy tab),then "reset" transforms and scale...then export.

or

if pivot is at origin select the problem mesh,convert to editable poly/mesh,select all polies,then using the transform move tools move the polies to desired location...then export...EDIT...the first method is best cuz you can move the mesh in very small amounts by using numbers in the transform and move tool,very handy for positioning the zoom mode scope.

.

yo show no!...good to see ya still kickin around the forum.

Edited by BEEX

Share this post


Link to post
Share on other sites

Ok thanks allot for the info guys. So you cant do it in the editor.

If I should attach it in Gmax, how would I go about importing the m16 vbf2 model using Gmax? I figured it out already. I asked a friend who had 3ds max to import it for me using the POE tools and then I told him to save it as *.3ds for me.

I then loaded it into Gmax but then I had another problem. The textures weren't there. So I could attacth it in Gmax and all that etc but then I still want to have the same m16 texture.

When my friend imported the m16 he also didn't see the textures. He used "Mesh importer" under bf2/bf2 utilities.

So how can I get the textures to also load while importing it from bf2 to 3ds so that my friend can import it for me with the textures?

Thank you.

EDIT: I loaded the m16 again in gmax and then I thought of having a look in it's UV files. To my surprise I found the original m16 UV's which meant I could just get the texture and apply it onto it and then I went to do it. When I did it, the texture was in perfect position automatically.

Which means I can now do all the editing in Gmax and export it with it's original texture...

Picture of the m16 in Gmax: itsthere.png

I have hidden all the other parts so you can have a clear view of it.

Edited by Dogbox

Share this post


Link to post
Share on other sites

I exported it and now it comes all dark and bright out: dark_lighter.png

Share this post


Link to post
Share on other sites

hmmm...a few things come to mind

.

1.seeing as you would now have 2 or more textures on 1 model you will need to have named your materials correctly,for the m16 call the bundledmesh material...

m16||ColormapGloss

then the scope bundledmesh material...

scope||ColormapGloss

then the zoom mode scope bundledmesh material,depending on if your using alpha channels...either of the 2...

zoomscope||ColormapGloss

or

Alpha

.

if you were to have all materials named ColormapGloss the exporter gets confused and can only use 1 of the materials correctly,incorrect specular is the main issue.

.

2.its common for the import tools to break the mesh down into many random groups of polygons,this problem might be difficult to fix,depending on if the .3ds file contained just 1 model(all weapon parts attatched together),it should be easy to resolve if the weapon is broken into the correct parts,(chassis,mag,trigger,bolt etc...),you can check this by using editable poly,element tool,select anywhere on the model,if the model appears to be broken into parts randomly then you will need to use the weld tool,select all verts for that part then hit weld,but use the weld option button,and set it to 0.01,so it doesnt weld the wrong verts.

.

3.check if the polies are flipped on the scope.

Share this post


Link to post
Share on other sites

Well I have to say that's the best answer I've got from everybody!

Before I do what you say, I just want to tell you that I use my own type of method when exporting objects. What I do is, I click new material, then I select "Standard" NOT "BF2 BundledMesh".

newmast.png

Then eventually it looks like this:

fgfd.png

Do you think I could still be able to rename all those stuff in the second pic correctly so that it will work or should I do everything with he bundledmesh thing all over again? And if I should do it all over again is there somewhere a tut for me showing how to do this right?

Share this post


Link to post
Share on other sites

I'm getting very desperate to get this right :P.

I did what you all told me and renamed everything.I even created a bf2 bundledmesh material under my multi materials.. When I hit export I get this error:

heelppp.png

Is there maybe something wrong with my renamed materials?:

helllpppp2.png

PLEASE HELP :).

Thank you all very much so far :D.

Share this post


Link to post
Share on other sites

oooooooooo aaahhhhh ouch!...gives me shivers just looking at your material manager...lol.

obviously your scope isnt uvmapped and textured correctly,due to the amount of materials your using.

now is probly a good time to look into uvmapping so you can avoid using so many materials,the more materials you use the more likely that object will become laggy.

beleive me,learning uvmapping is difficult at first but very fulfilling once its done,its the big link between a model and its best friend the texture...lol.

in general a uvmap is like unfolding a cardboard box,or the label on a tin can,with a can for example the label section would use a cylinder uvmap,and the top and bottom would use a planar uvmap.

.

ill throw together a quick tutorial.

.

here ya go mate,i figured making a very simple acog would be best for this tutorial,its the basics explained basically...lol

.

acoguvwtut1.th.jpg

.

enjoy!...any questions just ask.

Edited by BEEX

Share this post


Link to post
Share on other sites

Ahw man thanks allot but I know precisely how to do all of that (UV mapping and wrapping my objects).

I want to know and learn what to name the materials, how to set them up in Gmax etc. Like I don't know what to name them here:

helllpppp2.png

Like what material should I name to what?My point is that I have everything under control even the animations when it's exporting, its just the texture. The UV's are also fine I just need to name the things right....:P

Look, when I enter the m16 with the acog scope, he looks perfectly down the scope:

accooddfgg.png

Thanks :D

Share this post


Link to post
Share on other sites
yo show no!...good to see ya still kickin around the forum.

Good to see you too man, I'm always lurking... O.O Hows AUS been treating you mate?

I want to know and learn what to name the materials, how to set them up in Gmax etc. Like I don't know what to name them here:

Looking at your mat manager is giving me a headache!

Firstly, are all of your textures the proper DDS format? It is ok to use JPG's and TGA's for checking your work in GMAX but in order to export, you have to have the correct path location for your DDS textures present in your materials. Therefore, prior to exporting, you need to have all your textures saved as the correct DDS type and have them located in your weapons texture folder with the material pointing to them. Does GMAX support DDS image types? If not, it doesn't matter, it also doesn't matter that they do not show up in GMAX as long as the paths are correct. Here's an example of one of our DCON weapons:

objects\Weapons\handheld\CAR15\Textures\car15_scope_c.dds

Are all of your textures the proper dimensions? Powers of 2? (256x512, 512x512, 128x256, 1024x1024 etc...)

It is not possible to export an object for BF2 unless the correct shader and shading names are present in the materials.

EVERY material in your setup (for textured not collision meshes) should have the BF2 Bundledmesh shader applied with the naming convention Mr. BEEX explained previously. Realistically, you should have a max of maybe 4 material slots for this weapon. Like BEEX mentioned previously, it looks like the weapon you imported was broken up into many sub-objects. Those objects need to be welded together and all parts that share the same texture and shader style should have the same MAT ID's.

Also, and this isn't necessarily a must but something I like to do. Looks like you have your collision and textured meshes sharing the same "Multi SUB/OBJECT" material. I would personally setup two "Multi SUB/OBJECT" material's and use one for the textured objects and the other for the col meshes. Makes things cleaner and more organized. This has always worked fine for me.

Edited by showNOmercy

Share this post


Link to post
Share on other sites

Two hints:

1. Use Object Editor to load a sniper rifle from e.g. BF2 and find the 'geom' section in the resource window on the left, at the very bottom. By clicking on the different geom and lod entries get an idea of what kinds of meshes are in the model hierachy.

Note how the scope is an enlarged model in geom0->lod1 .

Object Editor is also useful for rendering the collisionmeshes of your weapon. Here very simple meshes will do , like a box or so.

2. When diving into gmax' program folder, find the '_BF2Help' folder. Open it and dive deeper into the 'objects' folder to find a list of allowed shader techniques in a text document for bundledmeshes.

Depending on the kind of alpha you want ( i can't recommend alpha'd scopes because of some trouble with BF2 displaying funny things when looking through an alpha'd scope on alpha'd other stuff ) you could either go the modelling way of making a big scope with a modelled crosshair or use one of the 'Alpha_Test' techniques for 1-bit alpha or e.g. 'AlphaEnvmap' if you want floating alpha. It is important to know, though that if you use an alpha technique to also use the 'Alpha' keyword in front of the '||'. A full valid material name for flaoting alpha would e.g. be 'Alpha_scope_glass||AlphaEnvmap' . Envmap techniques will give you reflections of the environment on the glass surface.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

EDITIT OUT MY RANT....sorry peoples,and sorry to dogbox for my drunkard angry rant,i must learn not to post on forums when im drunk...sorry again mate.

Edited by BEEX

Share this post


Link to post
Share on other sites

Lol, BEEX , i know what you mean :P

But i am a little more patient maybe because i know of the material manager in gmax which is very different from what we know in 3DS. Its not as easy in gmax to create a Multi/Sub Material as it is in 3DS and requires to work your way through the ( excellent ) tutorial package which comes with gmax. Ok, Dogbox, here's what you need to do:

* Work your way through the gmax tutorials to learn handling the program. Making the P38 from the tutorial is a nice lesson for box modelling and using background pictures. Continue to learn the basics of uvmapping and texture application. The're also free gmax models at e.g. http://www.turbosquid.com . Load one or two of them and play around with it to get familiar with gmax.

* Create a small pistol or something with a basic uvmap and export it, using the knowledge from our tutorials here. I recently published a gmax tutorial for making your first static and maybe you should have a look at it.

* Now attack the scoped rifle once again with the accumulated knowledge and the help we posted here.

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites

I'm actually scared to ask for something now.

I went to edit the acog's textures. I took all those other textures and placed them in one file which was 1024x1024 in size.

So I just wanted to let you know that I'm still trying my best on this. I also just want to know if this links and naming is correct then I'll come back later or tomorrow with the m16's :D.

isthatright.png

Share this post


Link to post
Share on other sites

lol...sorry again mate,dont be afraid...just be afraid on friday's...lmfao

.

looks good to me,but you need to use .DDS format for your textures or else youl get uncle sam texture in editor and crash ingame.

download the "windows texture viewer" (WTV) to anylise bf2 textures for dxt type, number of mip maps,specular alpha,normals and opacity alpha.

.

many may disagree with me here but dont fuss about using multi sub materials unless its for collision materials,many have had slight lag issues with 1 mesh using multisub containing several types of bundledmesh shaders,EG:colormapgloss and EnvMapColormapGloss.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×