添加战术

注:只能添加battle.xml已经定义的战术,不然会没有图标。或者可以添加自定义按钮,这样不受battle.xml限制。

例:鹰炮添加站岗模式


1.打开你的AOE3ED,提取鹰炮的tactics文件。(一般在游戏data3.bar提取,data3.bar找不到就找data2.bar)
2.按照格式添加
(这个是复制了原有的炮轰模式修改过来的)
<tactic> Defend <speedmodifier>0.4</speedmodifier> <attacktype>LogicalTypeRangedUnitsAttack</attacktype> <autoattacktype>LogicalTypeRangedUnitsAutoAttack</autoattacktype> <attackresponsetype>LogicalTypeRangedUnitsAttack</attackresponsetype> <exclusive>1</exclusive> <action>CannonAttack</action> <transition> <tactic>Limber</tactic> <action>Limber</action> <anim>Bombard_limber</anim> <length>4</length> <exit>1</exit> </transition> <runaway>0</runaway> <autoretarget>1</autoretarget> <idleanim>Bombard_ranged_idle</idleanim> <boredanim>Bombard_bored</boredanim> <walkanim>Bombard_Walk</walkanim> <joganim>Bombard_Jog</joganim> <runanim>Bombard_Run</runanim> <deathanim>Bombard_Death</deathanim> </tactic>
3.因为鹰炮切换战术是有动作的,所以在Tactics-limber按照格式添加 (我复制了切换炮轰模式的动作,一句话原本有什么复制什么。至于炮轰模式就不用添加了切换动作,都是炮轰的样子,没必要切换)
<transition> <tactic>Defend</tactic> <action>Limber</action> <anim>Bombard_unlimber</anim> <length>2</length> <exit>1</exit> <automatic>1</automatic> <commandautomatic>1</commandautomatic> </transition>
4.保存文件,将修改好的文件放到游戏目录\data\tactics文件夹里面。别跟我说没有tactics文件夹,没有就自己创建。



  falconet.tactics - 记事本 ____ X
文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)
<!-- converted from XMB to XML -->

<tactics>
	<action>
		<name stringid="38119">CannonAttack</name>
		<reloadanim>Bombard_reload</reloadanim>
		<type>Attack</type>
		<attackaction>1</attackaction>
		<rangedlogic>1</rangedlogic>
		<anim>Bombard_ranged_attack</anim>
		<idleanim>Bombard_ranged_idle</idleanim>
		<boredanim>Bombard_bored</boredanim>
		<maxheight>0</maxheight>
		<accuracy>1.0</accuracy>
		<aimbonus>0</aimbonus>
		<maxspread>5</maxspread>
		<spreadfactor>0.25</spreadfactor>
		<trackrating>12</trackrating>
		<unintentionaldamagemultiplier>1.0</unintentionaldamagemultiplier>
		<projectile>Cannonball</projectile>
		<impacteffect>effects\impacts\cannon</impacteffect>
		<rate type="All">1.0 </rate>
		<throw>1</throw>
		<impactforcemin>500.0f</impactforcemin>
		<impactforcemax>800.0f</impactforcemax>
		<outerdamageareadistance>.25</outerdamageareadistance>
		<outerdamageareafactor>.20</outerdamageareafactor>
		<impactlaunchangle>10.0</impactlaunchangle>
		<areasortmode>Directional</areasortmode>
		<targetground>1</targetground>
		<numberbounces>1</numberbounces>
		<basedamagecap>1</basedamagecap>
		<perfectaccuracy>1</perfectaccuracy>
	</action>
	<tactic>
		Limber
		<speedmodifier>1.0</speedmodifier>
		<attacktype>LogicalTypeRangedUnitsAttack</attacktype>
		<attackresponsetype>LogicalTypeRangedUnitsAttack</attackresponsetype>
		<transition>
			<tactic>Bombard</tactic>
			<action>Limber</action>
			<anim>Bombard_unlimber</anim>
			<length>2</length>
			<exit>1</exit>
			<automatic>1</automatic>
			<commandautomatic>1</commandautomatic>
		</transition>
		<transition>
			<tactic>Defend</tactic>
			<action>Limber</action>
			<anim>Bombard_unlimber</anim>
			<length>2</length>
			<exit>1</exit>
			<automatic>1</automatic>
			<commandautomatic>1</commandautomatic>
		</transition>
		<deathanim>Death_by_melee</deathanim>
	</tactic>
	<tactic>
		Bombard
		<speedmodifier>0.4</speedmodifier>
		<attacktype>LogicalTypeRangedUnitsAttack</attacktype>
		<autoattacktype>LogicalTypeRangedUnitsAutoAttack</autoattacktype>
		<attackresponsetype>LogicalTypeRangedUnitsAttack</attackresponsetype>
		<exclusive>1</exclusive>
		<action>CannonAttack</action>
		<transition>
			<tactic>Limber</tactic>
			<action>Limber</action>
			<anim>Bombard_limber</anim>
			<length>4</length>
			<exit>1</exit>
		</transition>
		<throw>1</throw>
		<idleanim>Bombard_ranged_idle</idleanim>
		<boredanim>Bombard_bored</boredanim>
		<walkanim>Bombard_Walk</walkanim>
		<joganim>Bombard_Jog</joganim>
		<runanim>Bombard_Run</runanim>
		<deathanim>Bombard_Death</deathanim>
	</tactic>
	<tactic>
		Defend
		<speedmodifier>0.4</speedmodifier>
		<attacktype>LogicalTypeRangedUnitsAttack</attacktype>
		<autoattacktype>LogicalTypeRangedUnitsAutoAttack</autoattacktype>
		<attackresponsetype>LogicalTypeRangedUnitsAttack</attackresponsetype>
		<exclusive>1</exclusive>
		<action>CannonAttack</action>
		<transition>
			<tactic>Limber</tactic>
			<action>Limber</action>
			<anim>Bombard_limber</anim>
			<length>4</length>
			<exit>1</exit>
		</transition>
		<runaway>0</runaway>
		<autoretarget>1</autoretarget>
		<idleanim>Bombard_ranged_idle</idleanim>
		<boredanim>Bombard_bored</boredanim>
		<walkanim>Bombard_Walk</walkanim>
		<joganim>Bombard_Jog</joganim>
		<runanim>Bombard_Run</runanim>
		<deathanim>Bombard_Death</deathanim>
	</tactic>
</tactics>



Defend为什么不是防御模式而是站岗模式?
battle.xml把防御模式与站岗模式都定义成了Defend。

那为什么给鹰炮添加Defend只有站岗模式,却没有防御模式?
自己去battle.xml看看吧,battle.xml防御模式的对象范围没有设定炮兵,而站岗模式的对象是unit。