HOW TO GET A LIGHTMAPPED STATIC PROP INTO GRAW

PAGE 3

 

8.EXPORT!FINALLY!

 

No wait! Stop! Dim the lights...and ponder for exactly what it is you are doing..is it a prop? is it a character? Bah this is stupid, ofcourse its a prop! so head to your game directory, go to Data\objects\props and a create a folder called “wall” or whatever the name of your prop is. Usually a describing name is nice. Im gonna call my folder “wall” .

 

Then you head back to 3dsmax, choose export,  the diesel exporter, choose a nice destination, preferably directly inside of the folder you just created, press export, and ok and blam blam blam you got yourself a diesel file in the folder.

 Its that simple.and if it messed up, its probably your fault but you can still PM me or mail me and ask for help ofcourse. I am quite the nice guy when I feel like it.

 

9.So what now?

 

Ok here begins the tricky bits, well they arent really tricky... but they begin here anyway.

 

Now go to your folder that you created again, create a file called “wall.xml” (or whatever your folder was called, its nice to keep the names concistent).

Well inside that file you have...nothing..yet, but we are about to create it! (oh btw, this is the MODEL.XML file but now with a less generic name)

All the model.xml files, are built up in a very similiar fashion and they almost always start off like this:

 

WARNING!!XML AHEAD!!WARNING

 

<?xml version="1.0" encoding="iso-8859-1"?>

<dynamic_object xmlns:xi="x">

it is a dynamic object we are creating

<diesel file="/data/objects/props/wall/wall.diesel" materials="/data/objects/props/wall/materials.xml" orientation_object="root_point"/>

this should be really quite selfexplanatory  as it just points out where your files are... and the orientation object is the root_point object created earlier.

 

then we add some collision!

 

<body editable="true" name="wall" tag="stone" template="static">

 This creates a “physics body” that can contain many diffrent objects to build upp a collission mass

 It tells us that its editable in the editor but static in the game and that it is made out of stone

        <object name="root_point"/>

The root_point should always be specified in the first body in the scene , but only once, never double, specify the root point

        <object collision_type="mesh_mopp" hidden="false" material="stone" name="gfx_wall"/>

this is mesh_mopp collission, it means that it uses per-face-collission, this is the heaviest form of collision and should only be used when you have to and almost NEVER on dynamic objects! In a later tutorial I will show you how to make a more computer-efficent collision.but you can use sphere, capsule ,box, ..bah ill tell you later.

 

You dont want your mesh to be hidden since its the same as the graphicsmesh and the name of it is gfx_wall, or whatever you named it.

</body>

dont forget to close your tags!!

 

</dynamic_object>

dont forget to close your tags!!

 

So now we have a file that looks like this:

 

 

<?xml version="1.0" encoding="iso-8859-1"?>

<dynamic_object xmlns:xi="x">

    <diesel file="/data/objects/props/wall/wall.diesel" materials="/data/objects/props/wall/materials.xml" orientation_object="root_point"/>

 

 

<body editable="true" name="wall" tag="stone" template="static">

        <object name="root_point"/>

        <object collision_type="mesh_mopp" hidden="false" material="stone" name="gfx_wall"/>

</body>

                     

</dynamic_object>

 

 

 

 

but over the <body>  tag we add

 

<lightmap>

                          <object name="gfx_wall" width="64" height="64"/>

</lightmap>

 

in here we specify which objects in the dieselfile that will be lightmapped and the size of the lightmap that its generated

look in other props xmls to see what sizes they are to get a hoohumm about good sizes!

 

 

and

   

   

 <decal_surfaces static="true">

                                            <ds_mesh object="gfx_wall" material="stone"/>

</decal_surfaces>

 

this specifies wich objects in the dieselfile that should be used to display the decals, we´ll just use the normal gfx_wall for this now, it works.

 

And now we have a file that looks like THIS!

 

<?xml version="1.0" encoding="iso-8859-1"?>

<dynamic_object xmlns:xi="x">

    <diesel file="/data/objects/props/bunker/bunker.diesel" materials="/data/objects/props/bunker/materials.xml" orientation_object="root_point"/>

 

                     

 

    <lightmap>

                          <object name="gfx_wall" width="64" height="64"/>

    </lightmap>

   

   

   

    <decal_surfaces static="true">

                                            <ds_mesh object="gfx_wall" material="stone"/>

    </decal_surfaces>

     

       <!-- COLLISION !-->

      

       <body editable="true" name="wall" tag="stone" template="static">

        <object name="root_point"/>

        <object collision_type="mesh_mopp" hidden="false" material="stone" name="gfx_wall"/>

       </body>

       

                     

                     

</dynamic_object>

 

thats all you need in the model.xml or in this case wall.xml to make a prop that has per face collision, can be shot at so effects and decals are shown and that can be lightmapped.

 

Now your homework before we continue is to look at other similar props and see that are they built up almost EXCACTLY the same.

 

 

                                                                                      

Previous page ------ Next page