收起左侧

[求助] 想在攻击敌人的时候获得金钱

[复制链接]
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会影响到单位;把NoUnitAINoIdleActions删掉,然后适当延长生命周期X.0000,默认是2,要延长多久你自己测试。

(71[O5PGC_{O}]X)XS_SDR0.jpg

PCT%1QD2(O]SF(9`0Q3{C{B.jpg






















  protoy.xml - 记事本

__


X



文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)





	<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>10.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>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>arrow.tactics</Tactics>
</Unit>
























  arrow.tactics - 记事本

__


X



文件(F)  编辑(E)  格式(O)  查看(V)  帮助(H)





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

shing989发表于 2021-3-25 21:08:15
做到了谢谢大神
跳转到