こはね 发表于 2023-9-9 22:30:51

使用骨骼缩放建筑方法,以及避免踩坑

我已经踩了多个坑了{:7_289:}
方法照旧:
3dsmax拉一个新骨骼,没什么难度,然后anim xml调用gr2模型,难度也不高,但出错率极高

1.准备骨骼
新建一个3dsmax文件,,点击最右边的两个齿轮

然后点击Bones,在0,0,0位置随便拉一个骨骼(不确定是否有影响,最好放到0,0,0)





保留Bone01,删掉Bone02



缩放为100,即为不变,修改成1000就代表放大10倍,修改成72就是缩小成0.72倍



我这边改成300,放大3倍(截图界面不一样了?因为是从其他帖搬过来的{:7_268:})



然后可以直接导出gr2文件(建议你先保存模型,因为win10电脑运行3dsmax有bug,点错了就会炸,只能重新画一遍)



双击Meshes,将Bone01的Included取消掉(原本为yes)。然后按Export导出就行。





骨骼准备完成。

2.提取anim xml(非小白请无视)
以碉堡为例子,首先在protoy.xml找到anim路径(此处只针对什么都不会的小白,就算是我写得那么详细,理论上来说小白仍然是看不懂的,写这么详细目的是,下次有人问,我可以直接丢一个链接过去{:4_88:})


*********************************************************************************************************************************************************************
注:请根据你的游戏版本选择对应的方法
亚洲王朝老版本,请打开AOE3ED的ArchiveViewer.exe(不知道在哪里下载的,请直接在顶部搜索框搜索AOE3ED,AOE3ED教程https://www.aoebbs.net/tutorial.html?tutorial-3-1.html),然后点击File,再点Open,打开帝国时代3目录/art文件夹/art1.bar,对于打开哪个art.bar,优先打开数字大的,找不到再打开数字小的,art1-3.bar原版,art4.bar酋长,art5.bar亚洲王朝;,把刚才找到的anim路径复制进去,然后选中xml文件并提取


用FileConverter.exe将xmb文件转xml文件
------------------------------------------------------------------
对于决定版版本,请直接先参照sjh大佬的教程https://www.aoebbs.net/tutorial-20-1.htm,创建mod文件夹(此处也是针对小白,我觉得用决定版修改的,没有人会不知道)


打开Resource Manager(不知道在哪里下载的,请直接在顶部搜索框搜索Resource Manager)
然后点击File,再点Open,打开帝国时代3决定版目录/ArtBuildings.bar,具体打开哪个文件,看你的英文能力


把刚才找到的anim路径复制进去,然后选中xml文件并提取



可勾选自动转xml格式



然后请使用xml格式化工具,将转换后的xml进行格式化,随便在搜索引擎找个xml格式化即可,或者我们站内链接https://www.aoebbs.net/tool_xml.html
*********************************************************************************************************************************************************************

把提取的xml改名,不改也行,放到art文件夹里面(如果是决定版,则放到MOD文件夹\art文件夹里面),路径自定义

把protoy.xml的调用路径修改成你的文件路径





3.对提取的anim xml进行修改在每一个<submodel>下面添加以下语句,<include>...<include>填写你在protoy找到的anim xml路径
      <attachment>
                Building
                <include>buildings\blockhouse\blockhouse.xml</include><!--你在protoy找到的anim xml路径-->
      </attachment>
为什么是这样修改?因为我们要将原来的模型作为attachment附件,然后用attach语句附加到新gr2里面,新的gr2是一个空白的模型,只有骨骼设定,所以原模型+骨骼=不变{:4_88:}。如果在骨骼做手脚可以实现模型放大、缩小、偏移中心点。



然后只要父标签不是<attachment>或<anim>的<component>...</component>,将其所有调用的gr2模型调用修改成以下语句,此处极容易出错,或者漏掉,请认真检查
                              <assetreference type="GrannyModel">
                                        <file>bone\test</file><!--你导出的gr2文件路径,不带.gr2后缀名;备注:gr2文件要放到art文件夹里面-->
                              </assetreference>
                              <attach a="Building" frombone="ATTACHPOINT" tobone="Bone01" syncanims="1"/>


重复一般:如果<component>...</component>是被包含在<attachment>...</attachment>或者<anim>...</anim>里面则无需修改;其他的component全部都要修改







4.如果是建筑物则需要对底部贴图(Decal:贴花?)进行修改:搜索<decal>,会见到类似下面的语句
                        <decal>
                              <effecttype>bump</effecttype>
                              <texture>buildings\blockhouse\blockhouse_ground</texture>
                              <selectedtexture>shadows_selections\selection_square_64x64</selectedtexture>
                              <bumptexture>shadows_selections\flat_normal_black_spec</bumptexture>
                              <width>8.00</width>
                              <height>8.00</height>
                        </decal>
你需要将看到的<texture>...</texture>提取出来进行修改{:4_88:}
因为<width>与<height>会把贴图缩放,所以直接把width,height修改成你缩放模型的倍数就行,直接按Ctrl+H一次性替换掉所有语句,但不排除有多个不同的width与height,你需要将其全部替换一遍

原本是<width>8.00</width>与<height>8.00</height>


修改成<width>28.00</width>与<height>28.00</height>后




5.最后对单位体积进行修改
在protoy.xml将<ObstructionRadiusX>X.0000</ObstructionRadiusX><ObstructionRadiusZ>X.0000</ObstructionRadiusZ>继续修改成你缩放的倍数,应该不会有什么问题,理论上不需要微调


全部完成后,建筑物就完成缩放了

已经改好的文件:





BigFile2/video/blockhouse05.mp4







こはね 发表于 2023-9-10 20:05:37

踩坑1:
直接使用精简xml调用骨骼

<!-- converted from XMB to XML -->
<animfile>
      <definebone>bone01</definebone>
      <attachment>
                Building
                <include>buildings\blockhouse\blockhouse.xml</include>
      </attachment>
      <component>
                ModelComp
                        <assetreference type="GrannyModel">
                              <file>bone\test</file>
                        </assetreference>
                        <attach a="Building" frombone="ATTACHPOINT" tobone="Bone01" syncanims="1"/>
                </component>
                <anim>
                        Idle
                        <component>ModelComp</component>
                </anim>
</animfile>



结果:模型缩放成功,但是无法攻击,被摧毁没有动画

video/blockhouse011.mp4

踩坑2:只修改了其中一个component,碉堡有模型、被摧毁,总共2个component,下图只修改了lvl1,却没有修改death


结果:缩放后的模型可以攻击了,但是delete后,变回原模型video/BLOCKHOUSE2.mp4





踩坑3:因为习惯性认为添加一次<attachment>即可,结果绝大部分建筑物都存在多个<submodel>;然后你的模型消失了。
      <submodel>
                blockhouse lvl2
                <attachment>
                        base smoke
                        <component>
                              smoke base
                              <assetreference type="ParticleSystem">
                                        <file>effects\smoke\collapsesmoke01.particle</file>
                              </assetreference>
                        </component>
                        <anim>
                              Idle
                              <component>smoke base</component>
                        </anim>
                </attachment>
                <attachment>
                        base smoke2
                        <component>
                              smoke wave
                              <assetreference type="ParticleSystem">
                                        <file>effects\smoke\collapse_smoke_wave.particle</file>
                              </assetreference>
                        </component>
                        <anim>
                              Idle
                              <component>smoke wave</component>
                        </anim>
                </attachment>
                <attachment>
                        base smoke3
                        <component>
                              smoke wave center
                              <assetreference type="ParticleSystem">
                                        <file>effects\smoke\collapse_smoke_wave02.particle</file>
                              </assetreference>
                        </component>
                        <anim>
                              Idle
                              <component>smoke wave center</component>
                        </anim>
                </attachment>
                <attachment>
                        collapse_smoke
                        <component>
                              collapse_smoke
                              <assetreference type="ParticleSystem">
                                        <file>effects\smoke\collapse_smoke_a.particle</file>
                              </assetreference>
                        </component>
                        <anim>
                              Idle
                              <component>collapse_smoke</component>
                        </anim>
                </attachment>
                <component>
                        lvl2
                        <assetreference type="GrannyModel">
                              <file>bone\test</file>
                        </assetreference>
                        <attach a="Building" frombone="ATTACHPOINT" tobone="Bone01" syncanims="1"/>
                        <decal>
                              <effecttype>bump</effecttype>
                              <texture>buildings\blockhouse\blockhouse_ground</texture>
                              <selectedtexture>shadows_selections\selection_square_64x64</selectedtexture>
                              <bumptexture>shadows_selections\flat_normal_black_spec</bumptexture>
                              <width>8.00</width>
                              <height>8.00</height>
                        </decal>
                </component>
                <component>
                        lvl2 death model
                        <assetreference type="GrannyModel">
                              <file>bone\test</file>
                        </assetreference>
                        <attach a="Building" frombone="ATTACHPOINT" tobone="Bone01" syncanims="1"/>
                        <decal>
                              <effecttype>bump</effecttype>
                              <texture>buildings\blockhouse\blockhouse_ground</texture>
                              <selectedtexture>shadows_selections\selection_square_64x64</selectedtexture>
                              <bumptexture>shadows_selections\flat_normal_black_spec</bumptexture>
                              <width>8.00</width>
                              <height>8.00</height>
                        </decal>
                </component>
                <anim>
                        Idle
                        <component>lvl2</component>
                        <simskeleton>
                              <model>buildings\blockhouse\blockhouse_age2_damaged</model>
                              <damagetemplate>buildings\blockhouse\blockhouse_age2.dmg</damagetemplate>
                        </simskeleton>
                </anim>
                <anim>
                        RangedAttack
                        <assetreference type="GrannyAnim">
                              <file>animation_library\building\ranged_attack</file>
                              <tag type="Attack">0.45</tag>
                              <tag type="SpecificSoundSet" checkvisible="1" set="RifleShot">0.45</tag>
                        </assetreference>
                        <component>lvl2</component>
                        <simskeleton>
                              <model>buildings\blockhouse\blockhouse_age2_damaged</model>
                              <damagetemplate>buildings\blockhouse\blockhouse_age2.dmg</damagetemplate>
                        </simskeleton>
                </anim>
                <anim>
                        Death
                        <assetreference type="GrannyAnim">
                              <file>buildings\blockhouse\blockhouse_age2_deathAnim</file>
                        </assetreference>
                        <component>lvl2 death model</component>
                        <attach a="base smoke" frombone="ATTACHPOINT" tobone="ATTACHPOINT" syncanims="0"/>
                        <attach a="base smoke2" frombone="ATTACHPOINT" tobone="ATTACHPOINT" syncanims="0"/>
                        <attach a="base smoke3" frombone="ATTACHPOINT" tobone="ATTACHPOINT" syncanims="0"/>
                        <attach a="collapse_smoke" frombone="ATTACHPOINT" tobone="ATTACHPOINT" syncanims="0"/>
                </anim>
                <anim>
                        RangedAttackShip
                        <assetreference type="GrannyAnim">
                              <file>animation_library\building\ranged_attack</file>
                              <tag type="Attack">0.45</tag>
                              <tag type="SpecificSoundSet" checkvisible="1" set="FalconetShoot">0.45</tag>
                        </assetreference>
                        <component>lvl2</component>
                        <simskeleton>
                              <model>buildings\blockhouse\blockhouse_age2_damaged</model>
                              <damagetemplate>buildings\blockhouse\blockhouse_age2.dmg</damagetemplate>
                        </simskeleton>
                </anim>
      </submodel>


video/blockhouse03.mp4


最后只有剩下漏掉 <component> ...</component>,没有将其模型修改成骨骼的gr2;比如下面建造动画就故意漏掉了。
video/blockhouse04.mp4













沉默的lsp 发表于 2023-9-10 22:06:59

{:7_237:}{:7_262:}{:7_268:}

こはね 发表于 2023-9-11 23:43:45

沉默的lsp 发表于 2023-9-10 22:06





こはね 发表于 2023-9-12 20:37:48

只有苏族的改变了


(放到art文件夹里面)


こはね 发表于 2023-9-13 00:54:32

青天小羽 发表于 2023-9-11 23:43


德國騎兵我覺得你要找PS大佬過來幫你{:7_265:}{:7_242:}





沉默的lsp 发表于 2023-9-13 07:18:50

青天小羽 发表于 2023-9-13 00:54
德國騎兵我覺得你要找PS大佬過來幫你

这个是你做的吗?我觉得已经很好啦!那些黑纹不就是缰绳嘛,虽然粗了点但能接受。可以的话发布一下

沉默的lsp 发表于 2023-9-13 07:21:20

青天小羽 发表于 2023-9-12 20:37
只有苏族的改变了()

好快啊一个月过去了{:7_268:}

沉默的lsp 发表于 2023-9-13 07:24:16

青天小羽 发表于 2023-9-13 00:54
德國騎兵我覺得你要找PS大佬過來幫你

话说可不可能直接把德国骑兵的马换成苏族步枪骑兵的白马,就是直接模型调用,那样也行

こはね 发表于 2023-9-13 19:15:45

沉默的lsp 发表于 2023-9-13 07:24
话说可不可能直接把德国骑兵的马换成苏族步枪骑兵的白马,就是直接模型调用,那样也行 ...
直接調用白馬

沉默的lsp 发表于 2023-9-13 20:26:43

怎么成了叠叠乐,是我打开方式不对{:4_100:}?直接复制粘贴的。。。

沉默的lsp 发表于 2023-9-14 17:46:31

非常好的工作,爱来自瓷器。感谢大佬,对老版帝国3的遗憾差不多都完成了。白马德国骑兵是真的帅!原本是立绘帅,现在模型也很帅了。
页: [1]
查看完整版本: 使用骨骼缩放建筑方法,以及避免踩坑