收起左侧

[求助] 帝国时代3如何复制英国建造农舍出农民的设定

[复制链接]
dfbc发表于 2020-3-22 13:43:34
如题,想给日本神社增加在建造完成后获得一头圣牛的设定,防止ai农民像个nt一样站在神社附近的动物边发呆。我把英国的那个代码复制到神社上没效果。求大神解答。
こはね发表于 2020-3-22 14:08:25
tactics,类型spawn
  • dfbc : 谢谢大神回复,我就是把这个直接复制过。建造神社后还是没有
こはね发表于 2020-3-22 15:54:52
如果你就一句话也不知道你哪里出来问题,最好是带上图
こはね发表于 2020-3-22 20:13:23
完整的教程

1.单位手册查找神社调用名,得出调用名为ypShrineJapanese

86715e771ac28738c.png

2.在protoy查找神社的tactics,得到tactics文件为shrine.tactics

<Unit id='971' name='ypShrineJapanese'>
<DBID>1444</DBID>
<DisplayNameID>61446</DisplayNameID>
<EditorNameID>61447</EditorNameID>
<PopulationCapAddition>10</PopulationCapAddition>
<ObstructionRadiusX>2.0000</ObstructionRadiusX>
<ObstructionRadiusZ>2.0000</ObstructionRadiusZ>
<MaxVelocity>0.0000</MaxVelocity>
<MovementType>land</MovementType>
<AnimFile>buildings\asian_civs\shrine\shrine.xml</AnimFile>
<DeadReplacement>BuildingRubble2x2</DeadReplacement>
<DeadReplacementLifespan>15</DeadReplacementLifespan>
<ImpactType>Wood</ImpactType>
<PhysicsInfo>house</PhysicsInfo>
<PlacementFile>buildingsmall.xml</PlacementFile>
<Icon>buildings\asian_civs\shrine\shrine_icon_64</Icon>
<PortraitIcon>buildings\asian_civs\shrine\shrine_icon_portrait</PortraitIcon>
<RolloverTextID>61445</RolloverTextID>
<ShortRolloverTextID>61444</ShortRolloverTextID>
<InitialHitpoints>1600.0000</InitialHitpoints>
<MaxHitpoints>1600.0000</MaxHitpoints>
<LOS>12.0000</LOS>
<BuildPoints>15.0000</BuildPoints>
<BuildLimit>20</BuildLimit>
<Bounty>50.0000</Bounty>
<BuildBounty>25.0000</BuildBounty>
<Cost resourcetype='Wood'>125.0000</Cost>
<CarryCapacity resourcetype='Food'>999.0000</CarryCapacity>
<InitialResource resourcetype='Food'>100.0000</InitialResource>
<BuildingWorkRate>1.0000</BuildingWorkRate>
<AllowedAge>0</AllowedAge>
<Armor type='Siege' value='0.0000'/>
<GathererLimit>4</GathererLimit>
<BuilderLimit>8</BuilderLimit>
<UnitType>LogicalTypeValidSabotage</UnitType>
<UnitType>LogicalTypeMinimapFilterEconomic</UnitType>
<UnitType>LogicalTypeHandUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeBuildingsNotWalls</UnitType>
<UnitType>LogicalTypeRangedUnitsAutoAttack</UnitType>
<UnitType>LogicalTypeVillagersAttack</UnitType>
<UnitType>LogicalTypeHandUnitsAttack</UnitType>
<UnitType>LogicalTypeShipsAndBuildings</UnitType>
<UnitType>LogicalTypeRangedUnitsAttack</UnitType>
<UnitType>LogicalTypeBuildingsNotWallsOrGroves</UnitType>
<UnitType>AbstractTypeHerdableMagnet</UnitType>
<UnitType>AbstractShrine</UnitType>
<UnitType>AbstractTypeHuntableMagnet</UnitType>
<UnitType>ConvertsHerds</UnitType>
<UnitType>CountsTowardEconomicScore</UnitType>
<UnitType>HasBountyValue</UnitType>
<UnitType>Building</UnitType>
<UnitType>Resource</UnitType>
<UnitType>ColonyBuilding</UnitType>
<UnitType>BuildingClass</UnitType>
<UnitType>Economic</UnitType>
<Tech row='0' page='1' column='0'>ypShrineFortressUpgrade</Tech>
<Flag>CollidesWithProjectiles</Flag>
<Flag>StartsAtFullEfficiency</Flag>
<Flag>Immoveable</Flag>
<Flag>NoBloodOnDeath</Flag>
<Flag>ObscuresUnits</Flag>
<Flag>NonAutoFormedUnit</Flag>
<Flag>Doppled</Flag>
<Flag>SelectWithObstruction</Flag>
<Flag>PaintTextureWhenPlacing</Flag>
<Flag>FlattenGround</Flag>
<Flag>ColonyBuilding</Flag>
<Flag>HasGatherPoint</Flag>
<Flag>UnlimitedSupply</Flag>
<Flag>EnterHotkeyContext</Flag>
<Flag>Tracked</Flag>
<Command page='10' column='1'>Delete</Command>
<Command page='10' column='0'>SetGatherPointMilitary</Command>
<Command page='9' column='3'>TacticXPShrine</Command>
<Command page='9' column='0'>TacticFood</Command>
<Command page='9' column='1'>TacticWood</Command>
<Command page='9' column='2'>TacticCoin</Command>
<Tactics>shrine.tactics</Tactics>
<ProtoAction>
<Name>AutoGatherCoin</Name>
<Rate type='Gold'>0.100000</Rate>
</ProtoAction>
<ProtoAction>
<Name>AutoGatherFood</Name>
<Rate type='Food'>0.140000</Rate>
</ProtoAction>
<ProtoAction>
<Name>AutoGatherWood</Name>
<Rate type='Wood'>0.100000</Rate>
</ProtoAction>
<ProtoAction>
<Name>AutoGatherXP</Name>
<Rate type='XP'>0.340000</Rate>
</ProtoAction>
</Unit>


3.用AOE3ED的ArchiveViewer打开data文件夹的Data3.bar,提取shrine.tactics

105235e771c0789658.png

4.用AOE3ED的FileConverter将shrine.tactics.xmb转换成shrine.tactics

5.用记事本打开shrine.tactics

6.打开圣典,07-Tactics,找到"强制生产单位",复制右边的语句

374235e771ccd62001.png

7.在shrine.tactics粘贴action语句,并且在tactic的战术定义使用刚才增加的action,因为默认使用第一个按钮,所以在ShrineFood添加1句就可以了。


<?xml version="1.0" encoding="utf-8"?>

<tactics>
<action>
<name stringid="43294">AutoGatherCoin</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
<action>
<name stringid="43295">AutoGatherFood</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
<action>
<name stringid="43296">AutoGatherWood</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
<action>
<name stringid="61766">AutoGatherXP</name>
<type>AutoGather</type>
<active>1</active>
<persistent>1</persistent>
</action>
<action>
<name>SpawnCow</name>
<type>Spawn</type>
<rate type="cow">1.0</rate>
<active>1</active>
<singleuse>1</singleuse>
<persistent>1</persistent>
</action>

<tactic>
ShrineFood
<action>SpawnCow</action>
<action>AutoGatherFood</action>
<protounitcommand>TacticFood</protounitcommand>
<transition>
<tactic>ShrineXP</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineCoin</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineWood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
<tactic>
ShrineCoin
<action>AutoGatherCoin</action>
<protounitcommand>TacticCoin</protounitcommand>
<transition>
<tactic>ShrineXP</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineFood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineWood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
<tactic>
ShrineWood
<action>AutoGatherWood</action>
<protounitcommand>TacticWood</protounitcommand>
<transition>
<tactic>ShrineXP</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineCoin</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineFood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
<tactic>
ShrineXP
<action>AutoGatherXP</action>
<active>0</active>
<protounitcommand>TacticXP</protounitcommand>
<transition>
<tactic>ShrineCoin</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineWood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
<transition>
<tactic>ShrineFood</tactic>
<length>2</length>
<exit>1</exit>
</transition>
</tactic>
</tactics>


8.最后测试,牛在神社建好后会自动spawn出来,但是切换按钮后再切换回食物又会spawn另一头牛

shrinespawnunits.gif

这个暂时没办法解决......也许你可以用battle创建单位战术代替建筑按钮,参考https://www.aoebbs.net/thread-599-1-1.html


  • 末晴天o6 : 太專業了
跳转到