shing989 发表于 2021-3-23 13:31:43

想在攻击敌人的时候获得金钱


<name stringid="69149">AutoGatherTrade</name>定义tactics的Action名及其名称
                <type>AutoGather</type>类型,自动采集
                <donotautogatherunlessgathering>1</donotautogatherunlessgathering>没有在工作(采集)就停止自动采集
                <active>0</active>1为启用,0为未启用(需要借助科技激活),没有则默认启用
                <persistent>1</persistent>


有一句句式像拿茶叶这样但是是在攻击的事候发动的吗?

こはね 发表于 2021-3-24 12:50:39

有一个办法,就是添加在发射物里面,让发射物自动生产资源(近战攻击也是可以添加发射物的)

shing989 发表于 2021-3-24 17:19:50

        我改了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>


こはね 发表于 2021-3-24 19:48:55

shing989 发表于 2021-3-24 17:19
我改了tactics和arrow的protoy 但是没有反应,是哪里做错了吗




tactics在action下面添加

        <tactic>
                Normal
                <action>AutoGatherFood</action>
        </tactic>

shing989 发表于 2021-3-24 20:26:43

<?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

こはね 发表于 2021-3-25 15:29:23

一般人还是发现不了这个的,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'>&nbsp;&nbsp;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)&nbsp;&nbsp;编辑(E)&nbsp;&nbsp;格式(O)&nbsp;&nbsp;查看(V)&nbsp;&nbsp;帮助(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>        &lt;Unit id ='5' name ='Arrow'&gt;
                &lt;DBID&gt;63&lt;/DBID&gt;
                &lt;DisplayNameID&gt;23513&lt;/DisplayNameID&gt;
                &lt;ObstructionRadiusX&gt;0.1000&lt;/ObstructionRadiusX&gt;
                &lt;ObstructionRadiusZ&gt;0.1000&lt;/ObstructionRadiusZ&gt;
                &lt;MaxVelocity&gt;30.0000&lt;/MaxVelocity&gt;
                &lt;MovementType&gt;air&lt;/MovementType&gt;
                &lt;AnimFile&gt;effects\projectiles\arrow.xml&lt;/AnimFile&gt;
                &lt;Lifespan&gt;<span class="red">10.0000</span>&lt;/Lifespan&gt;
                &lt;LOS&gt;0.0000&lt;/LOS&gt;
                &lt;UnitType&gt;Projectile&lt;/UnitType&gt;
                &lt;UnitType&gt;EmbellishmentClass&lt;/UnitType&gt;
                &lt;Flag&gt;Invulnerable&lt;/Flag&gt;
<span class="red">&lt;!--</span>
                <span style="color:red">&lt;Flag&gt;NoUnitAI&lt;/Flag&gt;
                &lt;Flag&gt;NoIdleActions&lt;/Flag&gt;</span>
<span class="red">--&gt;</span>
                &lt;Flag&gt;NonCollideable&lt;/Flag&gt;
                &lt;Flag&gt;DestroyProjectile&lt;/Flag&gt;
                &lt;Flag&gt;DoNotCreateUnitGroupAutomatically&lt;/Flag&gt;
                &lt;Flag&gt;NoBloodOnDeath&lt;/Flag&gt;
                &lt;Flag&gt;Projectile&lt;/Flag&gt;
                &lt;Flag&gt;NoTieToGround&lt;/Flag&gt;
                &lt;Flag&gt;NotSearchable&lt;/Flag&gt;
                &lt;Flag&gt;DoNotShowOnMiniMap&lt;/Flag&gt;
                &lt;Flag&gt;NotSelectable&lt;/Flag&gt;
                &lt;Flag&gt;DoNotDieAtZeroHitpoints&lt;/Flag&gt;
                &lt;Flag&gt;NoHPBar&lt;/Flag&gt;
                &lt;Flag&gt;NonAutoFormedUnit&lt;/Flag&gt;
                &lt;Flag&gt;DontRotateObstruction&lt;/Flag&gt;
                &lt;Flag&gt;AdjustPositionOnTerrainCollision&lt;/Flag&gt;
                &lt;Flag&gt;NotPlayerPlaceable&lt;/Flag&gt;
                &lt;Tactics&gt;<span class="red">arrow.tactics</span>&lt;/Tactics&gt;
        &lt;/Unit&gt;</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'>&nbsp;&nbsp;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)&nbsp;&nbsp;编辑(E)&nbsp;&nbsp;格式(O)&nbsp;&nbsp;查看(V)&nbsp;&nbsp;帮助(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>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;tactics&gt;
        &lt;action&gt;
                &lt;name stringid="43019"&gt;AutoGather&lt;/name&gt;
                &lt;type&gt;AutoGather&lt;/type&gt;
                &lt;persistent&gt;1&lt;/persistent&gt;
                &lt;active&gt;1&lt;/active&gt;
                &lt;rate type="Food"&gt;100.250000&lt;/rate&gt;
        &lt;/action&gt;
        &lt;tactic&gt;
                Normal
                &lt;action&gt;AutoGather&lt;/action&gt;
        &lt;/tactic&gt;
&lt;/tactics&gt;</pre></div></td>
<td class='EditorRight' rowspan="3"/>
</tr>
<tr class='ButtonHeight'>
<td class='ButtonWidth' colspan="4"></td>
</tr>
</table>

shing989 发表于 2021-3-25 21:08:15

做到了谢谢大神{:4_100:}
页: [1]
查看完整版本: 想在攻击敌人的时候获得金钱