Simple Unit Tutorial, step 8 .
基本模型教程,步骤八
Exporting the Model From 3ds max
After you’ve previewed your model, optimized it, and debugged it, you can export it for use in the game. Make sure to save your work first.
Choose File->Export from the list. You will see the “Select File to Export” dialog. Choose “Warcraft III Model” from the “Save as type” combo selector. If you do not choose a file extension for your model, it will be exported in binary format with the file extension .MDX. Otherwise, if you enter a filename that ends in .MDL, the model will be exported in text format. You should not use the text format except for debugging purposes. After you enter the filename and click “Save”, the Warcraft III Art Tools will convert the model data into the correct format. If there are problems with the model, you will be presented with warnings for the model. If there are errors that would prevent the model from working, you will receive an error message, and the export will not continue. After the data are processed, the model file is saved, and all of the textures used by the model are converted to “blip” format (.BLP file extension) and saved in the same directory as the model. The model is now ready to use in the game.
Figure 23
从3ds max中导出模型
当您预览好模型,优化,测试过模型,您就可以把它导出到游戏中使用了。首先请确保保存过文件了。
选择菜单-导出,在下拉式菜单中选择导出类型为“Warcraft III Model”。如果您没有选择文件后缀,程序将会自动导出为带有“.mdx”后缀的二进制格式。而如果您输入后缀名为“.mdl”模型将会被导出为类文本格式。除非出于调试模型的目的,请不要将模型导出为这种类文本格式。当您输入好名字,选择好导出格式,点击了“save”按钮,Warcraft III Art Tools将会将模型数据转换为游戏专有格式。如果模型有问题,您将会看到一些警告提示。如果模型有一些导致不能正常运行的关键性错误,您将收到错误信息,导出将不能继续。反之当模型数据转换成功,文件写入完毕,所有模型使用到的贴图将会被自动转为“blip”(.blp)格式并被存放到模型目录。现在模型可以在游戏中被使用了。
Importing the Model into a Map Using WorldEdit
Once the model and textures have been exported to files on disk, they can be imported for use in maps or campaigns via the Warcraft III World Editor, which comes with the game. This is done using the Import Manager module (Module>Import Manager) for maps, or the Imported Files tab within the Campaign Editor module (Module->Campaign Editor) for campaigns. Note that you must have The Frozen Throne expansion pack to access the Import Manager and Campaign Editor modules.
用WorldEditor导入模型到地图中
当模型和贴图被导出并写入硬盘后,他们就能通过魔兽自带的编辑器(WE)导入到自定义地图或战役中使用了。导入通过输入管理器模块(菜单模块-输入管理器)实现导入到地图,或者在战役管理器模块(模块-战役编辑器)的导入文件栏实现导入到战役中。注意您必须有冰峰王座扩展包(war3x.mpq)才能保证能使用输入管理器和战役编辑器模块。
Import the model and textures files by using the File->Import File(s) command in the Import Manager (Edit->Import File(s) in the Campaign Editor), and selecting the file or folder to import. Once the import is complete, you will need to adjust the path of the texture files to match the way they are referenced from within the model file. By default, all files are imported to the war3mapImported directory for map files, or war3campImported for campaign files. This can be changed by modifying the properties of the imported file via Edi->Modify File Properties, or simply double-clicking the file in the list. In the resulting Imported File Properties dialog, check the box titled Use custom path and enter the path to the texture file as it is referenced from within the model file. This often means simply deleting the extraneous war3mapImported or war3campImported directory name from the path.
After you import the model and texture files, we recommend that you save your map or campaign, then close and reload it. This will ensure that the editor has loaded your new model and textures and will display them properly when they are subsequently used.
You can then select your model file from the Import menu in any model selection dialog. This dialog is used when modifying model fields in the Object Editor (such as Art – Model File for units), as well as parameters for certain trigger functions in the Trigger Editor (such as the Special Effect actions).
导入模型和贴图在输入管理器中使用文件-导入文件命令(或者在战役管理器中通过菜单编辑-导入文件),然后选择您想要导入的文件或文件夹。当文件导入成功,您需要修正贴图文件的路径以确保它们相应于模型文件的位置。默认地,地图导入文件都被放在war3mapImported目录下面,战役导入文件都被放在war3campImported目录。通过菜单编辑-修改文件属性,或者在列表中的文件上双击来修改路径。在弹出来的导入文件属性面板中钩选“use custom path”使用自定义路径,并手动输入(主要是指贴图)文件相对应于模型的路径。通常地我们只需要在路径中删除外部目录名war3mapImported或者war3campImported。
导入模型和贴图文件后,我们建议您保存您的地图或者战役,关闭并重新启动编辑器。再次载入地图(或战役)后将能保证编辑器能够正确加载您的模型和贴图并在随后的使用中能够正确的被预览和显示出来。
现在您就可以在任何一个模型选择对话框(比如单位的art-model file)中选择导入的模型了。同样在某些触发器功能参数中也可以选择(比如一些特效动作)。
Optional: Creating Model Portraits
Units can have a separate model for a portrait. This new art model will have the suffix “_Portrait.mdx”. Example: Footman.mdx and Footman_Portait.mdx. A portrait needs a target camera in the model.
可选的:创建肖像模型
单位模型通常可以包括一个单独的肖像模型。这个特殊用途的模型必须包括“_Portrait.mdx”这样的后缀名。例如:Footman.mdx and Footman_Portait.mdx就是步兵模型和其对应的肖像模型。肖像模型需要在模型中包括一个目标摄像机(3ds max中创建的)。
Doodads and Destructibles
Warcraft III can have multiple MDX files as variations of the same type of tree, and this multi-file approach works for any destructible or doodad. Up to 10 variations can be made by adding a one-digit number suffix starting with 0 (i.e., newtree0.mdx, newtree1.mdx, etc.).
Trees are set up as Simple Destructible objects so they can draw many on screen very quickly. For each tree the game will read three different MDX files: one with the standing tree and no animation, one with the dead version with no animation, and one version with all of its animation. These files will be named by adding an S for stand and a D for dead. When the letters are added, the above variation names will therefore become newtree0S.mdx, newtree0D.mdx, newtree0.mdx.
地形装饰物和可破坏的
魔兽三里同样的一种树可以有多个mdx模型文件作为变化,这种多文件(实现多样化)的方法对于任何地形装饰物和可破坏的都有效。最多可达10种变化通过在每一个mdx模型文件名字后面添加一个字符后缀,比如:newtree0.mdx, newtree1.mdx,等等。
树是一种简单的可装饰物,必须能够在屏幕上快速地被大量绘制。游戏必须为每棵树读取3个不同的mdx文件,一个是站立的没有动画的文件,一个是包括死亡但没有动画的文件,而另外一个是包括所有动画的文件。站立的树的模型文件必须在名字后面添加字符S,死亡的树的模型文件必须在名字后面添加字符D,这样一来,这三种不同模型的名字应该例如:newtree0S.mdx, newtree0D.mdx, newtree0.mdx。 |