想在攻击敌人的时候获得金钱
<name stringid="69149">AutoGatherTrade</name>定义tactics的Action名及其名称
<type>AutoGather</type>类型,自动采集
<donotautogatherunlessgathering>1</donotautogatherunlessgathering>没有在工作(采集)就停止自动采集
<active>0</active>1为启用,0为未启用(需要借助科技激活),没有则默认启用
<persistent>1</persistent>
有一句句式像拿茶叶这样但是是在攻击的事候发动的吗?
有一个办法,就是添加在发射物里面,让发射物自动生产资源(近战攻击也是可以添加发射物的) 我改了tactics和arrow的protoy 但是没有反应,是哪里做错了吗
<Unit id="5" name="Arrow">
<DBID>63</DBID>
<DisplayNameID>23513</DisplayNameID>
<ObstructionRadiusX>0.1000</ObstructionRadiusX>
<ObstructionRadiusZ>0.1000</ObstructionRadiusZ>
<MaxVelocity>30.0000</MaxVelocity>
<MovementType>air</MovementType>
<AnimFile>effects\projectiles\arrow.xml</AnimFile>
<Lifespan>2.0000</Lifespan>
<LOS>0.0000</LOS>
<UnitType>Projectile</UnitType>
<UnitType>EmbellishmentClass</UnitType>
<Flag>Invulnerable</Flag>
<Flag>NoUnitAI</Flag>
<Flag>NoIdleActions</Flag>
<Flag>NonCollideable</Flag>
<Flag>DestroyProjectile</Flag>
<Flag>DoNotCreateUnitGroupAutomatically</Flag>
<Flag>NoBloodOnDeath</Flag>
<Flag>NotSearchable</Flag>
<Flag>Projectile</Flag>
<Flag>NoTieToGround</Flag>
<Flag>DoNotShowOnMiniMap</Flag>
<Flag>NotSelectable</Flag>
<Flag>DoNotDieAtZeroHitpoints</Flag>
<Flag>NoHPBar</Flag>
<Flag>NonAutoFormedUnit</Flag>
<Flag>DontRotateObstruction</Flag>
<Flag>AdjustPositionOnTerrainCollision</Flag>
<Flag>NotPlayerPlaceable</Flag>
<Tactics>arrow1.tactics</Tactics>
<ProtoAction>
<Name>AutoGatherFood</Name>
<Rate type="Food">5111.500000</Rate>
</ProtoAction>
</Unit>
<?xml version="1.0" encoding="utf-8"?>
<tactics>
<action>
<name stringid="69149">AutoGatherFood</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
</tactics>
shing989 发表于 2021-3-24 17:19
我改了tactics和arrow的protoy 但是没有反应,是哪里做错了吗
tactics在action下面添加
<tactic>
Normal
<action>AutoGatherFood</action>
</tactic> <?xml version="1.0" encoding="utf-8"?>
<tactics>
<action>
<name stringid="69149">AutoGatherFood</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
<tactic>
Normal
<action>AutoGatherFood</action>
</tactic>
</tactics>
不知道为什么还是没有反应QQ 一般人还是发现不了这个的,flag会影响到单位;把<Flag>NoUnitAI</Flag>与<Flag>NoIdleActions</Flag>删掉,然后适当延长生命周期<Lifespan>X.0000</Lifespan>,默认是2,要延长多久你自己测试。
<br/>
<br/>
<br/>
<br/>
<table border=1 cellspacing=0 cellpadding=0 class='txtbox'>
<tr class='txtTop'>
<td class='txtTopLeft'/>
<td class='txtTopText'>
<span class='TextColor'> protoy.xml - 记事本</span></td>
<td class='Text__'>
<span class='Color__'><b>__</b></td>
<td class='Textsquare'>
<span class='SquareColor'>□</td>
<td class='TextX'>
<span class='ColorX'>X</td>
<td class='txtTopRight'/>
</tr>
<tr class='SecondHeight'>
<td class='SecondLeft'/>
<td class='SecondText' colspan="4">
<span class='SecondTextColor'>文件(F) 编辑(E) 格式(O) 查看(V) 帮助(H)</td>
<td class='SecondRight'/>
</tr>
<tr class='ThirdHeight'>
<td class='ThirdLeft'/>
<td class='ThirdCenter' colspan="4"></td>
<td class='ThirdRight'/>
</tr>
<tr class='Left' style='height:400.1pt'>
<td class='EditorLeft' rowspan="3"/>
<td class='Editorbackground' colspan="4">
<div contentEditable='true' class='EditorDiv' style='height:400.1pt;overflow-y:auto;'><pre> <Unit id ='5' name ='Arrow'>
<DBID>63</DBID>
<DisplayNameID>23513</DisplayNameID>
<ObstructionRadiusX>0.1000</ObstructionRadiusX>
<ObstructionRadiusZ>0.1000</ObstructionRadiusZ>
<MaxVelocity>30.0000</MaxVelocity>
<MovementType>air</MovementType>
<AnimFile>effects\projectiles\arrow.xml</AnimFile>
<Lifespan><span class="red">10.0000</span></Lifespan>
<LOS>0.0000</LOS>
<UnitType>Projectile</UnitType>
<UnitType>EmbellishmentClass</UnitType>
<Flag>Invulnerable</Flag>
<span class="red"><!--</span>
<span style="color:red"><Flag>NoUnitAI</Flag>
<Flag>NoIdleActions</Flag></span>
<span class="red">--></span>
<Flag>NonCollideable</Flag>
<Flag>DestroyProjectile</Flag>
<Flag>DoNotCreateUnitGroupAutomatically</Flag>
<Flag>NoBloodOnDeath</Flag>
<Flag>Projectile</Flag>
<Flag>NoTieToGround</Flag>
<Flag>NotSearchable</Flag>
<Flag>DoNotShowOnMiniMap</Flag>
<Flag>NotSelectable</Flag>
<Flag>DoNotDieAtZeroHitpoints</Flag>
<Flag>NoHPBar</Flag>
<Flag>NonAutoFormedUnit</Flag>
<Flag>DontRotateObstruction</Flag>
<Flag>AdjustPositionOnTerrainCollision</Flag>
<Flag>NotPlayerPlaceable</Flag>
<Tactics><span class="red">arrow.tactics</span></Tactics>
</Unit></pre></div></td>
<td class='EditorRight' rowspan="3"/>
</tr>
<tr class='ButtonHeight'>
<td class='ButtonWidth' colspan="4"></td>
</tr>
</table>
<br/>
<table border=1 cellspacing=0 cellpadding=0 class='txtbox'>
<tr class='txtTop'>
<td class='txtTopLeft'/>
<td class='txtTopText'>
<span class='TextColor'> arrow.tactics - 记事本</span></td>
<td class='Text__'>
<span class='Color__'><b>__</b></td>
<td class='Textsquare'>
<span class='SquareColor'>□</td>
<td class='TextX'>
<span class='ColorX'>X</td>
<td class='txtTopRight'/>
</tr>
<tr class='SecondHeight'>
<td class='SecondLeft'/>
<td class='SecondText' colspan="4">
<span class='SecondTextColor'>文件(F) 编辑(E) 格式(O) 查看(V) 帮助(H)</td>
<td class='SecondRight'/>
</tr>
<tr class='ThirdHeight'>
<td class='ThirdLeft'/>
<td class='ThirdCenter' colspan="4"></td>
<td class='ThirdRight'/>
</tr>
<tr class='Left' style='height:400.1pt'>
<td class='EditorLeft' rowspan="3"/>
<td class='Editorbackground' colspan="4">
<div contentEditable='true' class='EditorDiv' style='height:400.1pt;overflow-y:auto;'><pre><?xml version="1.0" encoding="utf-8"?>
<tactics>
<action>
<name stringid="43019">AutoGather</name>
<type>AutoGather</type>
<persistent>1</persistent>
<active>1</active>
<rate type="Food">100.250000</rate>
</action>
<tactic>
Normal
<action>AutoGather</action>
</tactic>
</tactics></pre></div></td>
<td class='EditorRight' rowspan="3"/>
</tr>
<tr class='ButtonHeight'>
<td class='ButtonWidth' colspan="4"></td>
</tr>
</table> 做到了谢谢大神{:4_100:}
页:
[1]