こはね 发表于 2020-5-19 19:14:18

帝国时代3剧情编辑器切换贸易站资源选项触发程序

用下面的触发程序可以将已经在编辑器放置好的贸易站切换运送资源选项,而不是默认使用运送经验选项。注:只能切换已经在编辑器放置的贸易站,玩家手动建造的贸易站无法切换。
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>该触发程序有6个选项,分别是Set Level?、"Trade Route"、"Level"、"Target TradingPost"、"1-Food;2-Wood;3-Coin;4-XP;else protoname"、"else-custom protoname"
<br/>
<br/>"Set Level?"的作用是是否开启改变贸易路线等级,默认为OFF;如果"Set Level?"的状态为ON,那么后两个选项"Trade Route"与"Level"就会生效,如果为OFF,那么"Trade <br/>Route"与"Level"无论设定什么值都会失效。
<br/>"Trade Route"为选取一条贸易路线,第一条贸易路线为0,第二条贸易路线为1,依此类推。
<br/>"Level"为设定贸易路线等级,0为马拉雪橇(或人力车),1为驿马车,2为火车
<br/>"Target TradingPost"为设定哪个贸易站切换按钮,你在剧情编辑器选择一个贸易站,然后按"Target TradingPost"按钮即可。
<br/>"1-Food;2-Wood;3-Coin;4-XP;else protoname"设定贸易路线按钮类型。1为运送食物按钮;2为运送木材按钮;3为运送黄金按钮;4为运送经验按钮;其他数值为自定义单位调用名,调用名在"else-custom protoname"输入。
<br/>"else-custom protoname"为自定义贸易路线按钮,该选项值输入单位调用名,(为什么是单位调用名?因为贸易站的内部设定就是运送单位,就算是那些资源按钮,本质上也是在运送资源箱,所以是单位调用名);设定这个设定主要是为了兼容MOD,因为MOD可以设定贸易路线运送单位。
<br/>
<br/>触发程序:
<br/><pre>
        &lt;Effect name=&quot;*Advanced TP Set Command&quot;&gt;
                &lt;Param name=&quot;SetLevel&quot; dispName=&quot;Set Level?&quot; VarType=&quot;bool&quot;&gt;false&lt;/Param&gt;
                &lt;Param name=&quot;TradeRoute&quot; dispName=&quot;$$33881$$Trade Route&quot; VarType=&quot;traderoute&quot;&gt;1&lt;/Param&gt;
                &lt;Param name=&quot;Level&quot; dispName=&quot;Level&quot; VarType=&quot;long&quot;&gt;1&lt;/Param&gt;
                &lt;Param name=&quot;TradingPost&quot; dispName=&quot;Target TradingPost&quot; varType=&quot;unit&quot;&gt;default&lt;/Param&gt;
                &lt;Param name=&quot;Command&quot; dispName=&quot;1-Food;2-Wood;3-Coin;4-XP;else protoname&quot; VarType=&quot;player&quot;&gt;5&lt;/Param&gt;
                &lt;Param name=&quot;Protoname&quot; dispName=&quot;else-custom protoname&quot; VarType=&quot;string&quot;&gt;CrateofFood&lt;/Param&gt;
                &lt;command&gt;if(%SetLevel%==true)&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;Command&gt;trTradeRouteSetLevel(%TradeRoute%, %Level%);&lt;/Command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;Command&gt;trUnitSelectClear();&lt;/Command&gt;
                &lt;Command&gt;trUnitSelect(&quot;%TradingPost%&quot;);&lt;/Command&gt;
                &lt;Command&gt;if(trUnitIsOwnedBy(trCurrentPlayer()))&lt;/Command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;Command&gt;xsSetContextPlayer(trCurrentPlayer());&lt;/Command&gt;
                &lt;command&gt;if(%Command%==1)&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;command&gt;tradeRouteTrain(-1,kbGetBlockID(&quot;%TradingPost%&quot;),kbGetProtoUnitID(&quot;CrateofFood&quot;));&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;command&gt;else if(%Command%==2)&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;command&gt;tradeRouteTrain(-1,kbGetBlockID(&quot;%TradingPost%&quot;),kbGetProtoUnitID(&quot;CrateofWood&quot;));&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;command&gt;else if(%Command%==3)&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;command&gt;tradeRouteTrain(-1,kbGetBlockID(&quot;%TradingPost%&quot;),kbGetProtoUnitID(&quot;CrateofCoin&quot;));&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;command&gt;else if(%Command%==4)&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;command&gt;tradeRouteTrain(-1,kbGetBlockID(&quot;%TradingPost%&quot;),kbGetProtoUnitID(&quot;CrateofXP&quot;));&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;command&gt;else&lt;/command&gt;
                &lt;command&gt;{&lt;/command&gt;
                &lt;command&gt;tradeRouteTrain(-1,kbGetBlockID(&quot;%TradingPost%&quot;),kbGetProtoUnitID(&quot;%Protoname%&quot;));&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
                &lt;command&gt;}&lt;/command&gt;
        &lt;/Effect&gt;</pre>
<br/>
<br/>下载本触发程序:
<br/>
<br/>安装方法:将tpcommand.xml复制到你的帝国3目录中的trigger3文件夹里面。
页: [1]
查看完整版本: 帝国时代3剧情编辑器切换贸易站资源选项触发程序