Jump to content
Official BF Editor Forums

Creating Your First Static In Max / Gmax


Recommended Posts

by mschoeldgen from eXperience World War II

Note: gmax hints are coloured in green

I extracted this quick and dirty tutorial from a post i made a few months ago. It should give you at least hints on how to setup your material manager and manage a successful export of your first static object to BF2/2142:

viewbox.jpg

gmax users should launch gmax using the 'BF2 gamepack' shortcut created by the gmax tools installer. Alternatively you can create a shortcut to gmax and append this to its properties:

-a gamepacks\\Battlefield2\\splash.bmp -i gamepacks\\Battlefield2\\gmax.ini -p gamepacks\\Battlefield2\\plugin.ini -t "Battlefield2 Game Tools"

*************************************************************************

Lets create a simple box :P . Prepare a folder in /objects/staticobjects/myBox and put a texture in there, preferably some wood or metal. Lets do this all in your mod.

Here i have provided a small DDS wood texture in case you don't have one handy:

http://www.schoeldgen.de/bf1942/tutorials/myBox.dds

gmax: in addition to the above DDS texture for the game you should also download the according TGA file for gmax display:

http://www.schoeldgen.de/bf1942/tutorials/myBox.tga

I assume you have setup your BF2 Tools for Max/gmax according to this thread :

http://bfeditor.org/forums/index.php?showtopic=9648

Launch Max and open the Material Manager and make one material using the BF2Staticmesh2 shader by pressing the 'Standard' button and selecting the 'BF2StaticMesh2' entry from the following list. Press 'Base' in the first line of the new Material and point the Base texture slot to the above mentioned texture. Leave the Detail slot empty for now , it can later be filled at will, but you'll need a second UVMap for it. Here's a view of the Material Manager with the setup for this simple box:

boxmat.jpg

gmax users: Open the Material Manager and press the 'New' button. Select 'BF2StaticMesh2' from the following dialog. Press the 'Base' button and browse to the 'myBox.tga' texture.

Note that the scale for BF2 models is metric and the scale from Max to BF2 is 10:1 . Either use the metric setup and use 0.1 for the units or use GenericUnits, where 10 units make 1 meter ingame. To create a box with 1 meter edge length in the game you will need to make a box with 10 generic units edge length in Max/gmax. This can be done easily with the 'Keyboard entry' rollout .

Create a box with the Max primitives and assign the material to it (leave the box selected and from within the Material manager press 'assign material to selection' ) . Convert the box to 'Editable Mesh' and give all faces the Material ID 1. Now all faces should have the texture on it. gmax users press the 'Apply' button in Material Manager to force the material on the mesh.

Leave the box selected and run the 'Static/Building' wizard from the BF2 utilities. Do this only ONCE.

Your box doesn't have a collisionmesh yet, we need to add it. Select the 'myBox__Anchor' object (its a dummy helper) and clone it with max' standard function, renaming the clone to 'nonvis_' .

Now clone your original box , rename it to 'col0' and parent it under the nonvis_ dummy. ( This is done with the 'select and Link' button in max, more about that in this thread :

http://bfeditor.org/forums/index.php?showtopic=5013 )

Now clone the 'col0' box to a 'col1' and a 'col2' box, all are parented under the same 'nonvis_' dummy. Here's a view using the "Select by Name" window (button in the top toolbar) of the complete hierachy:

boxhier.jpg

You're now ready to export this simple model. You should export it into your mod into the same folder you created above : Enter '/staticobjects/' (without the quotes ) into the export path and uncheck the box adjacent to ''Custom lightmap Uvs". Press "Export Object" . A new folder 'myBox' will be created inside /objects/staticobjects and it will be called after your object. It contains a subfolder /meshes with the staticmesh file, a samples file for lightmapping with the editor and a collisionmesh.

gmax users now need to assign the acccording DDS texture before export. Open the material manager again and manually change the extension of the BASE texture from 'tga' to 'dds' . You are now ready to export. The object will loose its texturing in gmax but this is normal. gmax can't display DDS textures.

Its now ready to be examined in the BF2 Editor. Your first task should be to map materials to it. Open the box in object editor by browsing the resource window and doubleclicking the box. Now find the 'Default' tweaker where you find an entry called 'Map Materials' . Open it and assign a wood material to your box. Save the object.

Place it on a test map , pack your mod and go ingame. There you go :D

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

You're the second one who tries to repost one of my tutorials on the PR site. Whats that with you guys ? Can't add a bookmark to the bfeditor forums ? We have guest access here, too :P Basically i'm opposed to those reposts because they miss all the discussion that follows , error corrections and in this case you'll miss part 2 :

Adding a Detail channel - soon to come :P

Better make a link collection in your PR forums pointing to the most useful tutorials on the net.

Link to comment
Share on other sites

well over at PR we like to encourage our community to start modding/mapping, did do a link back to this post so they can see where it's come from etc :)

EDIT: if you really dont want it up there then I can take it down or only leave a link up.

btw I do have a list of tuts on there already but that's for mapping.

http://www.realitymod.com/forum/f189-moddi...rt-mapping.html

Edited by Rhino
Link to comment
Share on other sites

Ok, after this short excourse into the world of PR forums lets now continue with our static:

Creating a static Part II:

In this follow-up we'll add a Detail channel to our box from Part I of this tutorial. A Detail channel has higher resolution and we can add a normal map to our object. For this purpose i've provided 2 new textures:

http://www.schoeldgen.de/bf1942/tutorials/dirty_white_c.dds which is a small whitish texture and

http://www.schoeldgen.de/bf1942/tutorials/myBox_b.dds which is the texture for the NDetail slot, our 'bump/normal' map.

The Detail channel also provides for glossiness in its alpha channel. I've updated the texture from Part I for an alpha channel and you should probably download the new texture here:

http://www.schoeldgen.de/bf1942/tutorials/myBox.dds

gmax users find the TGA textures for viewport display here:

http://www.schoeldgen.de/bf1942/tutorials/dirty_white_c.tga

http://www.schoeldgen.de/bf1942/tutorials/myBox_b.tga

Download all textures and put them in the folder of our object. Optionally you could place all textures into a subfolder or a dedicated /textures folder for all your staticobjects. The exact location really doesn't matter much as long as it is within the /objects folder.

Ok, after making sure of the location of the textures lets start by loading the 'myBox' scene into Max and open the Material Manager. What we want to do now is to move our wooden texture to the detail channel and add a new color texture, the 'dirty_white_c.dds' you just downloaded. Color and Detail channel are multiplied so a white color texture will not affect the Detail texture very much but only adds a little dirt to it.

You could also use the dedicated 'dirt' channel but for a simple object its really not necessary. DICE mostly used the COlor channel for basic coloring and the Detail channel for the structure. If you take a closer look at existing textures you'll often find black & white detail textures to blend into the colors imposed by the Base channel.

Press 'Base' and browse to the 'dirty_white_c.dds' texture. ( gmax users do use the 'dirty_white_c.tga' texture instead) Note how the box in the viewport turns all white when we replace the original texture. Now press the 'Detail' button and browse to the 'myBox.dds' texture. ( gmax:'myBox.tga' ) Hmm, after assigning it nothing in the viewport has changed ? Thats because the 'BF2StaticMesh2' shader can only display one map channel at a time. To switch to another channel you can press the little number on the right of the texture in Material Manager. Initially it is set to display channel 1 but you can press the little '2' in the Detail texture row to switch over to display the detail channel. Before closing the Material Manager lets quickly add our bump texture by pressing the 'NDetail' button and assigning 'myBox_b.dds' to this texture slot. (you guessed it: gmax users take 'myBox_b.tga' instead ) Note the little '2' in the row - this means that the NDetail texture will also map on channel 2 so both 'detail' and 'normal-detail' will use channel 2.

If you tried to switch to channel 2 already you will have noticed that the box turns into an ugly brown or something, the wood texture seems to have gone. But don't worry thats only because our object has no uvmap on channel 2 yet. Thats what the material manager should look like after assigning all our textures:

boxmatB.jpg

Close the material manager with channel 2 selected and select your box mesh if not done already. Add a new 'UVW Map' modifier, switch it to 'Box' and look for the 'Map channel' setting in its rollout. Enter a '2' into the channel and notice how the box gets its structure again.

boxdetailA.jpg

Collapse the UVW Map modifier on the mesh.

Everything looks good, lets export the box once again. We don't need to change anything in the code but we can use the editor to look at our improved box. Note how some depth is added by using the detail channel with its bump map.

Our gmax friends need to open the Material Manager again and manually change the '.tga' to the '.dds' extensions in all texture slots before export.

Things you can try:

* Change the tint of the color texture and notice how it affects the overall toning of the object.

* use other textures for the detail channel, like brickstones or a metal surface. Try to adjust your color texture so that the object looks natural.

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

  • 2 weeks later...

I can´t export anything :(

When i click export object in 3d studio max it just says:

Error! could not create file!

C:/Program Files/EA GAMES/Battlefield 2/mods/BF2WW/Objects/mybox/mybox.dat

and thats it no more explonation can someone please help me!

Edited by mrful
Link to comment
Share on other sites

I think you're using Max 9 ( or higher ) with the older set of tools from Rexman ? In this case you have to create the target folder in your mod before exporting. That is, go to your /objects/staticobjects/ folder and create a new folder in there named 'mybox' . Export should work now.

This problem can be avoided when using newer tools like the PoE2 tools or the updated doomlab package

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

I think you're using Max 9 ( or higher ) with the older set of tools from Rexman ? In this case you have to create the target folder in your mod before exporting. That is, go to your /objects/staticobjects/ folder and create a new folder in there named 'mybox' . Export should work now.

This problem can be avoided when using newer tools like the PoE2 tools or the updated doomlab package

Thanks man!

BTW: where can i get these tool?

it would be very appreciated!

/Mr ful

Link to comment
Share on other sites

No wizard ( except the car wizard ) will create any 'nonvis_' dummy for you. You somehow will need to create or clone it yourself. And believe me - the fastest way to obtain the col0 is to clone the main object and parent it under 'nonvis_' .

For the simple box its then easiest to continue cloning col0 to a col1 and a col2 simply for the fact that they already reside under 'nonvis_'

Link to comment
Share on other sites

ok, well what ive been doing.

-make a box w/ texture

-clone it as col0 - apply material

- clone that twice more as col1 & col2

now have 4 objects in total, the main visible object and the 3 cols.

-select all 4, run the wizard and export.

the cols and anchor are all parented under _nonvis

woks fine for me?

Link to comment
Share on other sites

  • 1 month later...

gmax comes with a comprehensive tutorial package and you should work your way through them to get accustomed to the UI of it . Make use of this offer :P

I think you're looking for the 'Select by Name' window. Find it in the top toolbar and check 'Display Subtree' in the followoing window. This will display the hierachy .

To me your object looks ok. Its only the helpers ( 'nonvis_' or the '__Anchor' ) giving you the wireframed cube.

Link to comment
Share on other sites

  • 1 month later...

There are two basic material techniques in BF2 : 'StaticMesh' and 'BundledMesh' . BundledMesh is used for vehicles, kits, soldiers and weapons .

'StaticMesh' is used for all the buildings, trees . Now, there's 2 types of objects in BF2 for statics 'SimpleObject' and 'Bundle' . A 'Bundle' can have children ( which is useful for e.g. attaching ladders or windows to a house ).

So what do you want to export? If its a house where you want attach children in the bf2editor export as usual with the name of the object followed by '__Bundle' ( note the double underline) .Find more examples in our hierachy thread:

http://bfeditor.org/forums/index.php?showtopic=5013

Link to comment
Share on other sites

There are two basic material techniques in BF2 : 'StaticMesh' and 'BundledMesh' . BundledMesh is used for vehicles, kits, soldiers and weapons .

'StaticMesh' is used for all the buildings, trees . Now, there's 2 types of objects in BF2 for statics 'SimpleObject' and 'Bundle' . A 'Bundle' can have children ( which is useful for e.g. attaching ladders or windows to a house ).

Uppsss... Sorry. I roger that.

My question is not right.

I want to make a BundledMesh. A glass for building. I have no problem with transparency or something. I just cant export my windows as a BundledMesh.

There is)

Thanks :rolleyes:

Link to comment
Share on other sites

A window is not hard to make.

First make sure you use your bundledmesh material with your desired alpha technique, like 'AlphaEnvmap'.

The model hierachy looks just like any simple static with one difference . As the exporter determines the kind of mesh by the root point helper name , you have to rename it to e.g. 'root_bundledmesh_mywindow' . Have a standard 'geom0' with at least one lod and the collisionmeshes parented as usual to the 'nonvis_' helper below your visible mesh.

Link to comment
Share on other sites

The model hierachy looks just like any simple static with one difference . As the exporter determines the kind of mesh by the root point helper name , you have to rename it to e.g. 'root_bundledmesh_mywindow'.

That is ALL that i need to know) Now it works

thank you very much! :lol:

Link to comment
Share on other sites

Thanks a bunch for that tutorial. I can finally make stuff for BF2 now! :P

Also a little warning for some out there. If your object does not have any light mapping done to it, you may need to set the Lightmap size to "none" prior to export or 3DSMax may freeze up upon export. I had this happen to me quite often.

Link to comment
Share on other sites

Indeed , i forgot to mention that :unsure: Leave everything on 'Auto' regarding lightmaps when exporting unless you are willing to make your own flattened mapping in UV Channel 9 - which would probably part of an advanced statics tutorial :P

I put that in the tutorial .

Hopefully also all the links to the TGA files should be fixed now. Sorry for that blunder :oops:

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...