模拟城市中文网

 找回密码
 入住
搜索
查看: 11438|回复: 12

[转自天都城]BATforMAXv2的安装与使用

[复制链接]
发表于 2007-6-25 08:05 | 显示全部楼层 |阅读模式
原贴 by yogafish

以下说明是本人根据BATforMAXv2压缩包中的Instruction一文翻译过来,E文好的最好以原版的文字为主,本人的翻译仅供参照。

1、简介

本插件应用于3DSMAX,用以从3DSMAX生成sc4model文件,具体过程后面有介绍。

本插件经测试在3DSMAX的4.2/5版本下均能正常运行,3DSMAX 6 也应该没什么问题。

关于本插件的讨论请前往Simtropolis论坛"3D Studio Max BAT Release !!" 一贴
http://www.simtropolis.com/idealbb/view.asp?topicID=52137

2、必要的工具与程序
- 3dsmax version 4.2/5.1/6 (perhaps, with luck, later versions of 3dsmax as well)
- (optional) the ilive reader or Datgen (available at Simtropolis)
- fishTool (copyright (c) Denis Auroux 1998-2002) (已包含在压缩包内)
- ilive DatCmd 0.1 (已包含在压缩包内, auto deletes and inserts fsh files through the command line)
- Dos deltree.exe (you should find it under \Windows\command)
- gmax/BAT
- Plugin Manager
- Lot Editor
- SimCity 4/Rush Hour


3、功能介绍

本插件的目的在于使玩家能够采用3DSMAX下对你的BAT建筑进行渲染,并以3DSMAX的渲染效果取代由GMAX+BAT生成的sc4model中的贴图效果。

所以说,这一插件并非能够取代GMAX+BAT,而仅仅是用3DSMAX的渲染取代了GMAX的渲染。

4、安装

安装步骤:

1、直接将解压后的gamepack目录移动到你的3dsmax根目录下

2、进3dsmax的目录确认下在你3dsmax根目录下的是\gamepacks\BAT,而不是\gamepacks\gamepacks\BAT。:)
以下是gamepacks目录树结构——

\gamepacks
   \BAT
                 System.bmp  (如果此文件缺失,则无法进行渲染)
                 Batformax.ini (请按后面的提示修改此文件
                 fshtool.exe
                 fshtool.c
                 fshtoolreadme.txt
   DatCmd.exe
   OR_DAT.dll
   cr.txt (该文件包括了auto prompting in batch过程中返回的文件列表)
   DELTREE.EXE (可以从Windows\Command目录下找到该文件复制至此处)
     \Maps
         \NightWindows
            \Beige
                 BeigeWindowTexture-z5.jpg  (etc. copy the five .jpg files from gmax/BAT if they are missing)
            \Blue
                  BlueWindowTexture-z5.jpg  (etc. copy the five .jpg files from gmax/BAT if they are missing)
            \Green
                  GreenWindowTexture-z5.jpg  (etc. copy the five .jpg files from gmax/BAT if they are missing)
     \NeonRed
    NeonRedWindowTexture-z5.jpb (etc.)
         \OutputFiles
                 (empty)  你需要在每次完成建筑生成后清空此目录
         \plugins
         \scenes
            \CamLightRigs
                 TB2_CameraLightRig.max
                 TB2_CameraLightRigBig.max
                 TB2_CameraLightRigHuge.max
                 TB2_CameraLightRigMedium.max
            \startup
                 TB2_CameraLightRig.max
         \scripts
                 CPBuildingMill.ms
                 CPCameraRig.ms
                 CPFileUtils.ms
                 CPModelNames.ms
                 CPScriptUtil.ms
                 CPStringUtil.ms
                 CPTB2Main.ms
                 CPTB2MainUI.ms
                 CPTextureUtils.ms
            \startup
                (CPTB2Startup.ms 和 SimTropolis_Tools_V104.ms 这两个文件需要被移动到3dsmax\scripts\startup 目录下)
         \temp

3、将CPTB2Startup.ms 和 SimTropolis_Tools_V104.ms 这两个文件移动到3dsmax\scripts\startup 目录下

4、重要!!
     找到BATFORMAX.INI这一文件,用NOTEPAD打开该文件
     在以下两行
     TempPath=
      DestPath=
     填写你的\gamepacks\BAT\temp  和  \gamepack\BAT\OutputFiles 目录的确切位置
      同样在以下一行
      SC4PluginPath=
      填写你的SC4 My documents\Simcity 4\plugin 目录的确切位置

5、 在你3dsmax的根目录下找到3dsmax.ini文件,将其在某处备份,这样当下面步骤出现错误时能够恢复你原先的3dsmax的配置。

6、 在notepad打开3dsmax.ini.  在Directories section, 编辑PlugCFG一行,填写\gamepacks\BAT目录的确切位置。例如:PlugCFG=C:\Program Files\3dsmax42\gamepacks\BAT

7. 你可以在你的\Windows\Command 目录下找到deltree.exe文件复制到\gamepacks\BAT下。如果你用的是XP系统, 这一文件可能在你CD安装盘上。如果实在找不到这个deltree.exe文件,你可以使用压缩包中自带的文件,但本人不对由此造成的任何损失负责任。:)

5、使用

1. 启动3dsmax,制作你的建筑模型。

2. 在右边的滚动面板中,点击最后那个有个榔头图标的一栏,如果你的插件安装正确的话,下方应该出现BATforMAX的面板

3. 在这里,你可以在"Parameters"一栏中创建LOD shell(yoga注:LOD具体含义不是很清楚),你也可以自己制作LOD shell。无论采用哪种方法,这一过程的同采用GMAX+BAT效果相同。

4. 一旦你的LOD创建好,选中它们(可以用H键,在列表中选中LOD3, LOD4, LOD5)。在"File"菜单中, 选择"Export Selected",将其保存为一个 .3ds 文件。

5. 退出 3dsmax,进入 gmax/BAT.

6. 通过"File"->"Import" ,导入你在步骤4中由LOD生成的3ds文件。 在接下来的对话窗口中,选择 "Merge objects with current scene" ,必须去掉"Convert Units"项前面的叉(否则导出的LOD尺寸会不对!!).  当你在GMAX+BAT的任何时候,不要点击"refit LODS"以及任何LOD的按钮!!

7. 这个时候你不需添加任何灯光或贴图。 The LODS are simply a poly area for projecting your final Model Fsh files.

8. 点击"Export"按钮,等待……

9. 当导出过程完成后(一般不会花很长时间) 退出GMAX+BAT。

10. 找到导出的.SC4Model文件,复制下其文件名,我们需要将其文件名粘贴到3dsMAX的"Export"一栏中

11. Restart 3dsmax.  Open your model.  Open the "Export" rollout (see steps 2 and 3).  If you are using the night material library nightlighting option (see below), open your "-night" material library.  The rollout will tell you whether or not it will use your -night material library to perform night renderings.  If you want to assign maxis-style "night windows" or to add nitelites, you can do that now as well.  The process is the same as in gmax/BAT.

12. 粘贴你的sc4model的文件名到3dsMAX的"Export"一栏中。

13. 点击 "Render BAT".(以下内容不是很重要,就不翻译了~~)
    If it asks if you want to save the model, hit "Yes" if you haven't already saved it, as this may be your last chance.  (At various times during the rendering process all materials in the scene are removed and replaced.)  "Render BAT" will cause either one or three renderings for each zoom and rotation, depending on which nightlighting options are in effect.  These renders do not necessarily correspond to what eventually ends up in the game.  (Don't be alarmed if they look weird).  In addition, larger renders will trigger a fourth, seemingly random 256x256 render of one of the viewports.  It will look like it is malfunctioning, but it is supposed to do this, (for reasons I won't go into here.)  In addition there may be a lag between renders, where it appears to be doing nothing.  This is normal.  (It is doing a bunch of calculating, compositing, applying night windows, generating alpha maps, slicing, swapping materials, etc.)  This lag between renders can last for a few minutes on very large buildings (or very slow computers).  Eventually, a messagebox will pop up telling you the export was successful.  Note that you can cancel the rendering process by hitting "escape" but if you do, shut down 3dsmax immediately, and DO NOT SAVE YOUR MODEL.

14. 当渲染完成后,接下来就该轮到Batch CMD 面板了。默认情况下,面板中的 auto execute选项是非选中的。

15. 如果你刚完成渲染,不要点击Clear Outputfiles ,否则会删除所有你刚刚辛辛苦苦生成的FSH文件:(

16. 测试下FSH Batch Build(this runs the batch file created by the rendering)

17. 如果你先前在步骤12中输入的文件名是有效的, 点击 "DAT FSH insert" 按钮,DATCmd 会被以何时的参数自动调用,用以自动生成你的sc4model文件。

18. 如果你上述三个batch CMD按钮都工作正常的话,那么你可以在"AutoExecute"前打勾,下次你进行渲染,整个过程会自动执行知道生成最后的sc4model文件。

Instruction的最后还有关于 应用FshTool和Reader/Datgen手动生成sc4model的过程,NightLight一些相关的设置问题 等高阶应用
这里就不作翻译了~~~(哈欠~~其实是好困了)
 楼主| 发表于 2007-6-25 09:04 | 显示全部楼层
原贴 by 天唐永thianz

輸出出問題時訊息代碼表示意思一覽,不過這應該要下載一個script。僅供參考有需要者請見原文
(摘自http://www.simtropolis.com/forum/messageview.cfm?catid=49&threadid=52137第九頁)

Hopefully you'll never encounter any of these, but if you do, here are what the new error codes mean:

100 - Problem deleting old directories (deletetree).

102 - Problem setting render type.

104 - Problem setting cameras.

106 - Problem resetting cameras.

108 - Model name structure failed to initialize.

110 - Problem cleaning out temp folder.

112 - Problem cleaning up destination folder.

114 - Problem deleting temporary meshes leftover from previous renders.

116 - Problem creating .bat file.

118 - Problem creating temporary light.

120 - System.bmp file missing from BAT directory or corrupted.

122 - Failed to find or create LODS

124 - Failed to get the LOD for the current zoom level

126 - Failed to set up render viewport

128 - Problem deleting temporary light or resetting camera rig after rendering complete

130 - Problem creating fsh files/updating .sc4model file.


150 - Problem saving temporary day material library

152 - Problem adding scene materials to temporary day material library or temporary material library is empty.  (Possible cause: scene is empty or has no materials).

154 - Problem saving temporary night material library

156 - Problem adding scene materials to temporary night material library or temporary material library is empty.  (Possible cause: scene is empty or has no materials).

158 - Problem initializing temporary night alpha material library

160 - Problem building the night alpha library.  (Possible cause: Bad or incompatible material in scene.  Standard materials work best with night library render.)

170 - Problem getting night window opacity

174 - Problem setting night window opacity in file properties

180 - Problem getting night window texture map

190 - Problem getting name of night window texture file

196 - Problem getting truncated filename of night window texture

204 - Failure to get LODS

210 - Failure to create LOD

220 - Failure to create LODs 3 4 or 5

230 - Problem setting up LODS/setting render region

250 - Problem backface culling LOD shell

260 - Problem slicing LOD shell


300 - Failure to apply screen region UV mapping

320 - Failure to apply diced region UV mapping

400 - Pre-render setup problem (day render)

404 - Problem making or cleaning up daytime render directory

410 - Rendering problem for daytime render (may be 3dsmax or memory problem)

412 - Problem processing daytime alpha map

416 - Problem processing daytime render or converting to .bmp

418 - Failure deleting source render (.tga) files


490 - Problem enabling/disabling nitelites

500 - Problem making or cleaning directories for night render

510 - Incorrectly set render type

511 - Problem loading night library or assigning night library materials to objects

513 - Problem setting up nitelites

514 - Problem setting main lighting rig for night render

516 - Night render failure (nitelites) (may be memory problem)

518 - Problem restoring lighting level

590 - File preparation problem for Nightwindows processing

592 - Problem converting day render to night colors

594 - File handling problem, post day -> night conversion (nightwindows)

600 - Problem loading temporary alpha library or assigning alpha materials to objects (for nitelite or night library alpha render)

602 - Problem disabling lighting rig

604 - Night Alpha render failure (may be memory problem)

606 - File handling problem (night alpha)

608 - Problem during alpha adjustment

610 - Night alpha file handling problem, post-adjustment

612 - Failure restoring lighting rig or camera rig

614 - Failure loading temporary day materials library, or reassigning day materials to objects

700 - Nightwindows post-processing setup

703 - Problem setting texture tiling parameters

704 - Failure opening nightwindow texture file.  Possible cause: File name doesn't conform to standard.

705 - Problem tiling nightwindow texture.  Possible cause: Image size not 256 x 256.

706, 707, 708 - File handling problem, nightwindows

709 - Failure placing nightwindows onto night render

710 - File handling problem - night windows

800 - Night Alpha post-processing, file handling problem

814 - Alpha compositing problem

815 - File handling problem, post-compositing

816 - Same

817 - Problem deleting temporary camera, or memory cleanup

900 - Image dicing initialization problem (pre-render)

910 - Problem rendering the 256x256 dicing source image.  If you get this error, try disabling the render viewport, or pan the render viewport until all geometry is far outside of the viewport.  This will save memory (and reduce render time).

912 - Problem initializing file names for image dicing

914 - Problem creating temporary bitmaps for dicing

950 - Night dicing initialization problem

952 - Failure deleting source files (Source file missing?)

954 - Problem during dicing of temporary daytime or daytime alpha bitmap.  Problem could be occuring while: Making or cleaning out directory for fsh slice, pulling grayscale bitmap (gbuffer channel) from dicing source image, writing pixels to daytime slice or daytime alpha slice, writing lines to .bat file, writing index.fsh file, or writing .tgi file.

960 - Same as 954 except nighttime

968 - Problem during post-dicing cleanup.
 楼主| 发表于 2007-6-25 09:07 | 显示全部楼层
原贴 by 天唐永thianz



如果你遇到這樣的問題,請檢查你的模型是否有些vertex什麼的超出了LOD
界限,如果一切無恙,那麼請開new檔,把你舊檔的"所有object"merge進來,
(所以這招叫merge招),然後另存新檔再輸出即可。這個問題我遇過,這個方法是bixel教我的。
========================================



如果你遇到這樣的問題,就是你的模型從天外插進來莫名其妙的樓層,最近我輸出的模型大約有一半有這問題,那麼依bixel說的,請在一些
官網BAT頁下載這個script.http://simcity.ea.com/downloads/getfile_pri.php?filename=ModelNames.ms(請用滑鼠右鍵點這個連結再另存目標)放到哪呢?

把這個檔(ModelNames.ms)放在你的scripts目錄下,通常是C:\\gmax\gamepack\bat\scripts\,取代原有的同名的檔。官網把這稱為Texture fix,Updated 02/24/04.
我昨天才剛下載,下載後才重新輸出一次,就是之前一直出現亂插樓的檔,果然修正了這問題,希望它一直有效。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?入住

x
发表于 2008-1-9 16:35 | 显示全部楼层
天堂,把ModelNames.ms共享一下,好吗?ea还要产品注册啊,好像。我注册不成功。谢谢
发表于 2008-1-9 18:51 | 显示全部楼层
附件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?入住

x
发表于 2008-1-9 19:08 | 显示全部楼层
原帖由 天唐永thianz 于 2008-1-9 18:51 发表
附件


什么都不用说了

发表于 2008-1-9 19:14 | 显示全部楼层
放到gmax\gamepack\bat\还是3dsmax\gamepack\bat\里?
发表于 2008-1-9 19:34 | 显示全部楼层
問得好,但EA是說放到gmax\gamepack\bat\scripts\,所以我就放到gmax那裏面去囉。
3dsMAX裏面我沒放這個檔…
(這我也有一點點疑問啦,不過EA是針對gmax的,而bat4max是玩家自己搞的,所以以上只能參考,你也可以放到3dsMAX試試,我不能說什麼,只能參考)

順便請問你一下,你的3dsMAX\gamepack\bat\scripts\裏面有什麼檔,我想看一下別人的…

[ 本帖最后由 天唐永thianz 于 2008-1-9 19:37 编辑 ]
发表于 2008-1-9 19:48 | 显示全部楼层
原帖由 天唐永thianz 于 2008-1-9 19:34 发表 問得好,但EA是說放到gmax\gamepack\bat\scripts\,所以我就放到gmax那裏面去囉。3dsMAX裏面我沒放這個檔…(這我也有一點點疑問啦,不過EA是針對gmax的,而bat4max是玩家自己搞的,所以以上只能參考,你也可以放到3dsMAX試試,我 ...


ModelNames.ms是后来添加的。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?入住

x
发表于 2008-1-9 19:51 | 显示全部楼层
那ModelNames.ms你現在兩個地方都放還是只放3dsMAX裏面? 之後追蹤一下…呵呵:)
发表于 2008-1-9 20:52 | 显示全部楼层
都覆盖吧,大概看了下脚本内容,应该没问题吧
发表于 2008-1-9 21:11 | 显示全部楼层
原帖由 天唐永thianz 于 2008-1-9 19:51 发表
那ModelNames.ms你現在兩個地方都放還是只放3dsMAX裏面? 之後追蹤一下…呵呵:)



我两个地方都放了,还不知道会怎么样?

不过我觉得应该只是放在gmax下,因为3ds只管渲染,对model的生成是gmax的事——这是我的理解。

[ 本帖最后由 柏海 于 2008-1-9 21:12 编辑 ]
发表于 2008-3-19 23:06 | 显示全部楼层
幾個常見的error問題
--

目前已知不外乎就那幾個錯誤:內存不夠;max中文版;max安裝到了program file底下了;燈光用了gmax不能接受的複雜燈光……
以上這幾項全都是必定出問題,凡是想再試驗以上"是否"只是某些個人的人品問題的,不必了,因為必定出問題,謝謝。  

有種個案方式我自己稱為merge法:開新檔把已經error過的模型檔案merge進去(重點是TBL燈光不要merge進去), 不過這只是解決已經error的個別檔案問題,不能解決第一段所言的問題。

----------------------
除了以上,各位制模者,是否SC4渲染過程有整個成功過一次?先用最簡單的模型試驗整個過程能否成功那麼一次最好:)
您需要登录后才可以回帖 登录 | 入住

本版积分规则

小黑屋|手机版|模拟城市中文网

GMT+8, 2024-4-29 02:40 , Processed in 0.023260 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表