Importing .3DS objects with masked textures is tricky. The reason is that the client has to have a special bit set when a texture is masked (e.g. tree leaves). The way KhaN has been doing it is to create the zone, save it to .SCN, and then edit the .SCN file in a text editor for those special textures. Tree leaves, for instance, have to have their "masked" property set to true, and they also have to have their "solid" property set to false so the client will let players pass through them (it's another special polygon property that the client looks for).
OpenZone has a dialog under Edit...Change polygon properties... that lets you set the "solid" property, but not the "masked" property. I've added a setting that lets you change the "masked" property, and I've added a toolbar button to make accessing the dialog easier (second to last button, right next to the help button).
OpenZone can convert a 24-bit non-alpha-masked .BMP texture to a 32-bit alpha-masked BMP texture under File...Convert to transparent bitmap... It pops up a dialog that lets you enter input and output texture file names. It works by looking at the pixels in each corner of the texture and choosing the one that's most prevalent as the mask color. This is useful, for instance, if you have magenta as your mask color and you need the mask information to be in the alpha channel instead. If you already have an alpha-masked texture then you don't need to use this feature.
If you want to go the text-edit route to change the .SCN file, you need to know the formats of the TRIANGLE, TRIANGLETEX, RECTANGLE, and RECTANGLETEX tokens:
Code:
TRIANGLE x1, y1, z1, x2, y2, z2, x3, y3, z3, texturename, transparent, semitransparent, solid, color, hascolor, tag, hastag, angle, hasangle, masked, hasmasked, hasnormal, nx1, ny1, nz1, nx2, ny2, nz2, nx3, ny3, nz3
TRIANGLETEX x1, y1, z1, x2, y2, z2, x3, y3, z3, tx1, tz1, tx2, tz2, tx3, tz3, texturename, transparent, semitransparent, solid, color, hascolor, tag, hastag, angle, hasangle, masked, hasmasked, hasnormal, nx1, ny1, nz1, nx2, ny2, nz2, nx3, ny3, nz3
RECTANGLE x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, texturename, transparent, semitransparent, solid, color, hascolor, tag, hastag, angle, hasangle, masked, hasmasked, hasnormal, nx1, ny1, nz1, nx2, ny2, nz2, nx3, ny3, nz3, nx4, ny4, nz4
RECTANGLETEX x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4, tx1, tz1, tx2, tz2, tx3, tz3, tx4, tz4, texturename, transparent, semitransparent, solid, color, hascolor, tag, hastag, angle, hasangle, masked, hasmasked, hasnormal, nx1, ny1, nz1, nx2, ny2, nz2, nx3, ny3, nz3, nx4, ny4, nz4
Most likely you'll be dealing with TRIANGLETEX tokens. If hascolor/hastag/hasangle/hasmasked is FALSE then it means that OpenZone is to ignore the color/tag/angle/masked setting. If hasnormal is FALSE, then the normal values aren't present.
I'm looking into the possibility of allowing you to set these properties for all polygons with a certain texture. I'll update my post here if I can pull it off.
EDIT: Okay, the edit polygon properties now has a checkbox at the very bottom that, if checked, will cause OpenZone to scan every object in your zone and change all matching polygons instead of just the one you select. This will only work for imported objects (not scripted objects, for example), and will warn you whenever you check it. Also, if you are using it to change a polygon's texture, it's really easy to select the new texture but forget to add it to the texture list and the dialog will warn you if you forget to do so.
The gist of all this is that you could click on a polygon with tree leaves, open the edit polygon properties dialog, check the "change all" box, check the "masked" and "player can pass through" boxes, click Ok, and OpenZone will change the settings for ALL polygons with that texture.
Last edited by Windcatcher; 05-23-2005 at 11:35 PM..
|