THIS THREAD NO LONGER APPLIES
Continued from here http://www.matrixgames.com/forums/tm.asp?m=1788372
Now it is time to start using the supplied scenedit program to allow us to start placing objects on the map. Before we do that we first need to talk about how graphics assets are identified and located. In PCK any map related graphic asset is identified in the code by an *id* and *not* by a *filename*. These links are kept inside the actual code library of PCK. It is possible to add your own new assets however, but first we must define the links between the id and the filename. We do this with a file called media.xml which resides in the map directory.
Consider this snippet of a media.xml file which comes from the Kharkov_L1A map
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE resources [
<!ELEMENT resources ANY>
<!ELEMENT resource ANY>
<!ATTLIST resource id ID #REQUIRED>
]>
<resources path="Media/">
<resource id="D_T34_1941_tank" filename="kharkov_L1A/Extras/T34_1941_tank_destroyed.x" />
<resource id="T34_1941_body_destroyed.dds" filename="kharkov_L1A/Extras/T34_1941_body_destroyed_summer.dds" />
<resource id="T34_1941_tread_destroyed.dds" filename="kharkov_L1A/Extras/T34_1941_tread_destroyed_summer.dds" />
</resources>
The first bit is the xml schema for integrity purposes. You could leave this out if you wanted.
<resources path="Media/"> tells us where the root path of the asests are
<resource id ="..." filename="..."> define the link between the in-game id and the actual location of that asset.
Notice how you need to define both the mesh (.X) elements and the texture (.DDS) elements
So we need to write our own custom media.xml for the Colo_River map referencing our new work. To do this it should look like this
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE resources [
<!ELEMENT resources ANY>
<!ELEMENT resource ANY>
<!ATTLIST resource id ID #REQUIRED>
]>
<resources path="Media/">
<resource id="colo_terrain" filename="Colo_River/colo_terrain.x" />
<resource id="colo_wall" filename="Colo_River/colo_wall.x" />
<resource id="colo_water" filename="Colo_River/colo_water.x" />
<resource id="colo_bridge" filename="Colo_River/colo_bridge.x" />
</resources>
As I will be using texture defines which I will include in the main map scene file and I will be using pre-existing textures which have already been defined by the internal game library "media.xml" I won't need to include the texture links here.



