【修改教程】如何制造出正常的马耳他固定炮
众所周知战役和羽神的月之湖地图里有一个要塞炮,拿去轰人非常的快乐。最近我在把决定版内容移植到亚洲王朝,因为我真的很讨厌决定版的画风,所以在制造马耳他的固定炮。(实际上断断续续弄了好几年,阶段性回坑)但是问题来了,这个炮的炮身和基座实际上是两个单位,如果你非要它合理的组合在一起,就得用农民锤两次,搞得强迫症都快出来了。
但如果你用地基座<SocketUnitType>xxxxxx</SocketUnitType>去连接,下方的基座就会沉入地底消失,直到炮身被摧毁才会出现。而这个炮身实际上是悬浮在半空的,看起来也非常的奇葩。(图一:如图所示)
目前我的解决办法是————不用<SocketUnitType>xxxxxx</SocketUnitType>。
————————
①首先将SPCFixedGunBase复制一遍新建为要塞炮基座单位yaosaipaotai,再把SPCFixedGun新建为要塞炮(炮身)yaosaipao。
②然后给炮台定义tactics,开启它的建造能力。
<action>
<name stringid="69147">Build</name>
<type>Build</type>
<anim>Build</anim>
<active>1</active>
<maxrange>0.2</maxrange>
<rate type="Building">1.0</rate>
</action>
记住在<tactic></tactic>中间插入<action>Build</action>,插哪个无所谓。
③再让他可以制造炮身,也就是在protoy.xml加入了一个<Train row ='0' page ='0' column ='1'>yaosaipaotai</Train>(图二:开启建造)
④下来修改炮台和基座的原始<UnitType>以及<Flag>,否则你造出来无法点击,或者会被敌人转化,具体的建议自己去对照圣典1-1章。
⑤修改炮台的属性为建筑物,原本默认是单位,农民没法随心所欲的放置。
<BuildingWorkRate>1.0000</BuildingWorkRate>
<UnitType>BuildingClass</UnitType>
<UnitType>Building</UnitType>
<UnitType>BuildingClass</UnitType>
<UnitType>EconomicBuilding</UnitType>
⑥然后你就会神奇的发现,当你用农民造了基座以后,基座可以直接建造炮身,并且因为基座不会动,炮身你放太远它就不会制造,还必须放在炮台模型的基座处,就非常完美。(图三:远了不会建造)(图四:放在基座才会建造,因为基座就是单位的实际碰撞。)
⑦一定要记得添加 <Command page ='10' column ='0'>Delete</Command>否则你放错地方就没法删除了。而且Flag也要删掉相应禁止Delete的语句。
但实际上我是想用Spawn命令让农民盖好炮台时,令炮台自动生出来炮身,但搞了一阵没实现,之前没碰过这个实操,所以很遗憾。ORZ
不过这些对建模大佬而言没什么意义,单纯是讨论用游戏内资源实现一些有趣的东西。
至于单位属性怎么定义就看各人喜好了,也不要问我具体该怎么制造之类的,用思考代替发问,不要做拿来主义者。
以上。
另外~早安!米娜!
{:8_297:}{:8_292:}
dablive 发表于 2026-4-6 17:42
捉住一只猫猫大佬૮ ៸៸៸º ᗜ º៸៸៸ ა 列虚子 发表于 2026-4-6 18:28
捉住一只猫猫大佬૮ ៸៸៸º ᗜ º៸៸៸ ა
{:4_88:} 我以前尝试过修改anim xml,设定allowrotation="0"但是失败了{:7_238:},旋转炮台在无先例的情况下,很难研发出来
<?xml version="1.0" encoding="utf-8"?>
<animfile>
<definebone>bone_launchpoint</definebone>
<definebone>bone_muzzle</definebone>
<attachment>
base
<include>buildings\spc\fixed_gun\fixed_gun_base.xml</include>
</attachment>
<component>
fixed gun
<assetreference type="GrannyModel">
<file>buildings\spc\fixed_gun\fixed_gun</file>
</assetreference>
<attach a="base" allowrotation="0" frombone="bone_muzzle" tobone="attachpoints" syncanims="60"/>
</component>
<anim>
Idle
<assetreference type="GrannyAnim">
<file>buildings\spc\fixed_gun\fixed_gun_idle</file>
</assetreference>
<component>fixed gun</component>
</anim>
<anim>
RangedAttack
<assetreference type="GrannyAnim">
<file>buildings\spc\fixed_gun\fixed_gun_rangedAttack</file>
<tag type="CameraShake" force="0.09" duration="0.2">0.35</tag>
<tag type="Attack">0.35</tag>
<tag type="SpecificSoundSet" checkvisible="1" set="MortarShot">0.35</tag>
<tag type="Particles" particlename="fixedgunmuzzlefx">0.35</tag>
</assetreference>
<component>fixed gun</component>
</anim>
</animfile>
页:
[1]