Handling map-objects (md3, ase)
In this tutorial I would like to show you how to insert pre-modelled and skinned map-objects (md3 and ase only) and how to modify them. Also to export your brushwork as an ase-model can be helpful sometimes. Check it out. Before starting make sure that you are using Q3Map2 compiler version 2.5.16 or newer and check if GtkRadiant 1.4.0 or newer is installed and set up correctly for World of Padman standalone game. With older versions errors may occur with this tutorial.
1. Insert a map-object
There are two different 'misc' entities you can chose to insert a model as a map-object, 'misc_model' and 'misc_externalmodel'. Both are available over the entity context menu and both need the correct path to the model file (usually in '\models\mapobjects\...'), to be entered in the entity menu window (press 'N'). But they use the model file in a different way.
Using the 'misc_model' entity effects that the model is calculated as a fixed component into the brush work of the map during the bsp-stage of the compiling procedure. That means that you don't have to release the model file itself with your map, because it's part of the BSP file now. But the model texture must be attached in the correct sub-directory within the PK3, if it is not already archived in one of the wop_00*.pk3 files.
Using the 'misc_externalmodel' entity effects that the model is not compiled into the BSP file, that allows a maximum of flexibility. For example we use this method to insert the sprayroom teleporter into the map for SyC FFA and SyC TP game types only. A disadvantage is, that a 'misc_externalmodel' is shown as an orange box and not as the model you want to insert. To place it correctly and to find out how it looks in game just use a little trick. Insert the map-object with 'misc_model' method, make all modifications of your choice (next chapters) and change the 'classname' back to 'misc_externalmodel' when you are done.
2. Rotate a map-object
In further times the possibilities to rotate a model in GtkRadiant was limited to the Z-axis by using the key 'angle'. Owing to Q3Map2 there are extended possibilities now. By using a similar key called 'angles' you are able to rotate a model now in all three axes. Therefore you must enter degree numbers between 1 and 360 into the value field for each of the three axes, with a blank separated and one behind the other. Whereas the first value defines the X-axis, the second value defines the Y-axis and the third value defines the Z-axis. To avoid conflicts never use both keys 'angle' and 'angles' with the same entity at the same time!
3. Scale a map-object
Also owing to Q3Map2 there are possibilities now to scale map-objects. First method uses the key 'modelscale'. Entering decimal values between 0 and 1 into the value field effects scaling the model down. Decimal values greater than 1 scales the model up. Second method uses the key 'modelscale_vec'. Here you are able to scale a model in all three axes differently. Therefore you must enter decimal values for each of the three axes, with a blank separated and one behind the other. Whereas the first value defines the X-axis, the second value defines the Y-axis and the third value defines the Z-axis. But in consideration of the fact of stretching model textures you shouldn't use too large scaling factors. To avoid conflicts never use both keys 'modelscale' and 'modelscale_vec' with the same entity at the same time!
4.Clip a map-object
Map-objects usually are non solid for bots, players and weapon fire. You can easily walk through them, if you don't clip them. To do so, create a couple of brushes in the shape of the map-object and envelope it roughly. Use the weapon-clip texture ('\common\weapclip') on all surfaces of the brushes here to block players, bots and weapon fire. This method needs more time but it is a good way to save performance.
A second possibility is to use 'spawnflags'. Enter value '2' in the entity menu to force the Q3Map2 compiler to clip the model automatically. This method is really easy but should be used with low poly map-objects only to avoid a decrease in fps in game. This method effects also players, bots and weapon fire.
5. Export a brushwork as an ase-model
Rotating and scaling a complex brushwork in GtkRadiant can cause unpleasant effects and may distort your construction. That's why it can be helpful to export your brushwork as an '*.ase' model file, because an imported model can be rotated and scaled without any problem.
To create an ase-model is very easy. All you need is your textured brushwork ready to be exported, which you copied into an empty map-file. Make sure that your brushwork is centred to the point of origin! Envelope your brushwork with a closed skybox, which is textured all over with the caulk-texture ('\common\caulk'). Also caulk all surfaces of your brushwork, which cannot be seen by the player in game later to save polygons. Now place an 'info_player_start' somewhere inside the skybox and save the map.
figure 1: Compile command 'map2ase' in GtkRadiant Build-menu
Start to compile your little map by using the 'map2ase' compile command in the GtkRadiant Build-menu (figure 1), which was placed there especially for this reason. After the successful compiling procedure you'll find a new ase-file inside of the '\maps' sub-directory. Create a new sub-directory under '\model\mapobjects' and shift your model file into it. Now you're able to implement your brushwork as an ase-model via the 'misc_model' entity. Open the entity menu window (press 'N') and enter 'spawnflags' with value '4' to force the Q3Map2 compiler to lightmap the model automatically. In contrast to the md3-model format models in ase-format are not light mapped by default. Entering 'spawnflags' with value '6' effects how the map-object gets light mapped and clipped.
6. List of 'keys' and [values]
- 'angle' [z]: rotates around z-axis only (enter degree numbers between 1 and 360 for z)
- 'angles' [x y z]: rotates around all axes (enter degree numbers between 1 and 360 for x, y and z)
- 'modelscale' [x]: scales a model up or down in all dimensions (enter decimal numbers)
- 'modelscale_vec' [x y z]: scales a model up or down in dimensions of your choice (enter decimal numbers for x, y and z)
- 'spawnflags' : clips a model to block players, bots and weapon fire
- 'spawnflags' : lightmaps a model (only use with ase-model format)
- 'spawnflags' : lightmaps and clips a model (only use with ase-model format)