收起左侧

求教大佬,我的代码错在哪儿了

[复制链接]
纳索的莫里斯发表于 2024-9-21 13:10:56
想给马耳他增加马炮,在techtreemods.xml里增加了这段代码,结果不起效
<Tech name ='DEAge0Maltese'>
<Effects>
<Effect mergeMode='add' type='Data' amount ='1.00' subtype ='Enable' relativity ='Absolute'>
<Target type ='ProtoUnit'>xpHorseArtillery</Target>
</Effect>
</Effects>
</Tech>

我还想给马耳他多加一张工厂卡牌,结果也不行,是在homecitymaltese.mods.xml里加了如下代码
<homecitymods>
<cards>
<card mergeMode='add'>
<name>HCXPIndustrialRevolution</name>
<maxcount>1</maxcount>
<level>25</level>
<prereqtech>-1</prereqtech>
<age>3</age>
<displayunitcount>1</displayunitcount>
</card>
</cards>
<building>
<name>Cathedral</name>
<obtainabletechs>
<tech mergeMode='add' x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
<tech x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
</obtainabletechs>
<activetechs>
<tech mergeMode='add' x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
<tech x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
</activetechs>
</homecitymods>

有两年没做mod了,以前的电脑坏了,现在不知道代码的问题出在哪儿了……
如果有关于mergeMode代码的教程也想请大佬发一下,我想系统学习一下
こはね发表于 2024-9-22 14:29:51
只能说自己检查原因了

因为没有DLC,之前的文件有天朝的语句,所以直接所以拿天朝来测试
屏幕截图 2024-09-22 142748.jpg
<techtreemods>
<tech name="YPAge0Chinese" type="Normal">
<Effect mergeMode='add' type='Data' amount ='1.00' subtype ='Enable' relativity ='Absolute'>
<Target type ='ProtoUnit'>xpHorseArtillery</Target>
</Effect>
<Effect mergeMode='add' type='Data' amount ='1.00' subtype ='Enable' relativity ='Absolute'>
<Target type ='ProtoUnit'>ArtilleryDepot</Target>
</Effect>

</techtreemods>
屏幕截图 2024-09-22 143806.jpg

<?xml version="1.0" encoding="utf-8"?>

<homecitymods>
<maxcardsperdeck>30</maxcardsperdeck>
<cards>

<card>
<name>HCUnlockFactory</name>
<maxcount>1</maxcount>
<level>10</level>
<age>1</age>
</card>

<card>
<name>HCUnlockFortVauban</name>
<maxcount>1</maxcount>
<level>10</level>
<age>1</age>
</card>
<card mergeMode='add'>
<name>HCXPIndustrialRevolution</name>
<maxcount>1</maxcount>
<level>25</level>
<prereqtech>-1</prereqtech>
<age>3</age>
<displayunitcount>1</displayunitcount>
</card>
</cards>

<building>
<name>Imperial Court</name>
<obtainabletechs>
<tech x="7.2" y="5">HCUnlockFactory</tech>
<tech mergeMode='add' x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
</obtainabletechs>
<activetechs>
<tech x="7.2" y="5">HCUnlockFactory</tech>
<tech mergeMode='add' x="7.4" y="3.0">HCXPIndustrialRevolution</tech>
</activetechs>
</building>
<building>
<name>Fortress</name><!-- ArtilleryFoundry -->
</building>

</homecitymods>

纳索的莫里斯发表于 2024-9-22 19:43:05
こはね 发表于 2024-9-22 14:29
只能说自己检查原因了

对照了一下,发现第一个语句里DEAge0Maltese加的是单引号……
第二个语句里没加 </building>
我也是服了我自己了,居然是这种低级错误
顺便问下大佬,Resource Manager打不开怎么办?显示To run this application, you must install missing frameworks for .NET.,我安装了frameworks for .NET还是打不开,去了github上Resource Manager的主页,结果主页已经404了……现在Resource Manager还能用吗?或者大家是用什么解包软件的?
跳转到