静中先生 发表于 2021-8-19 20:38:38

请问如何实现给亚洲稻田添加可以采集木头的选项

自己试了在protoy里仿照coin和food的语句加了一下wood,没卵用

こはね 发表于 2021-8-20 12:52:40

参照一下这里
https://www.aoebbs.net/thread-170-1-1.html

静中先生 发表于 2021-8-20 23:12:27

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

<tactics>
        <action>
                <name stringid="43294">ModifyGatherCoin</name>
                <type>ModifyGather</type>
                <active>1</active>
                <persistent>1</persistent>
        </action>
        <action>
                <name stringid="43295">ModifyGatherFood</name>
                <type>ModifyGather</type>
                <active>1</active>
                <persistent>1</persistent>
        </action>
        <action>
                <name stringid="43296">ModifyGatherWood</name>
                <type>ModifyGather</type>
                <active>1</active>
                <persistent>1</persistent>
        </action>
        <tactic>
                PaddyFood
                <action>ModifyGatherFood</action>
                <transition>
                        <tactic>PaddyCoin</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
        </tactic>
        <tactic>
                PaddyCoin
                <action>ModifyGatherCoin</action>
                <transition>
                        <tactic>PaddyFood</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
        </tactic>
        <tactic>
                PaddyWood
                <name>RicePaddyWood</name>
                <icon>art\ui\command\tactic_rice_paddy_food_off</icon>
                <activeicon>art\ui\command\tactic_rice_paddy_wood_on</activeicon>
                <disabledicon>art\ui\command\tactic_rice_paddy_wood_off</disabledicon>
                <rollovertextid>66055</rollovertextid>
                <activerollovertextid>66056</activerollovertextid>
                <command>unitSetTactic("PaddyWood")</command>
                        <tactic>PaddyFood</tactic>
                        <length>2</length>
                        <exit>1</exit>
        </tactic>
</tactics>
我理解是这个意思吗,没反应

こはね 发表于 2021-8-21 00:34:35

静中先生 发表于 2021-8-20 23:12
ModifyGatherCoin
                ModifyGather
                1


明天晚上给你整个具体的

不过被遗弃的按钮仅仅只有三个,用完就没了

こはね 发表于 2021-8-21 21:47:54

例如使用已经废弃掉的SquadUnlock按钮

protoy.xml找到稻田,新增内容已用红色字体标出
      <Unit id ='919' name ='ypRicePaddy'>
                <DBID>1346</DBID>
                <DisplayNameID>60204</DisplayNameID>
                <ObstructionRadiusX>2.0000</ObstructionRadiusX>
                <ObstructionRadiusZ>2.0000</ObstructionRadiusZ>
                <MaxVelocity>0.0000</MaxVelocity>
                <MovementType>land</MovementType>
                <AnimFile>buildings\asian_civs\rice_paddy\rice_paddy.xml</AnimFile>
                <DeadReplacement>BuildingRubble3x3</DeadReplacement>
                <DeadReplacementLifespan>15</DeadReplacementLifespan>
                <ImpactType>Wood</ImpactType>
                <PhysicsInfo>mill</PhysicsInfo>
                <PlacementFile>mill.xml</PlacementFile>
                <Icon>buildings\asian_civs\rice_paddy\china\china_rice_paddy_icon</Icon>
                <PortraitIcon>buildings\asian_civs\rice_paddy\china\china_rice_paddy_icon_portrait</PortraitIcon>
                <RolloverTextID>60203</RolloverTextID>
                <ShortRolloverTextID>60202</ShortRolloverTextID>
                <InitialHitpoints>2500.0000</InitialHitpoints>
                <MaxHitpoints>2500.0000</MaxHitpoints>
                <LOS>12.0000</LOS>
                <BuildPoints>20.0000</BuildPoints>
                <Bounty>160.0000</Bounty>
                <BuildBounty>80.0000</BuildBounty>
                <Cost resourcetype ='Wood'>400.0000</Cost>
                <CarryCapacity resourcetype ='Food'>100.0000</CarryCapacity>
                <CarryCapacity resourcetype ='Gold'>100.0000</CarryCapacity>
                <InitialResource resourcetype ='Food'>999.0000</InitialResource>
                <InitialResource resourcetype ='Gold'>0.0000</InitialResource>
                <ResourceSubType>grain</ResourceSubType>
                <BuildingWorkRate>1.0000</BuildingWorkRate>
                <AllowedAge>0</AllowedAge>
                <Armor type ='Siege' value ='0.0000'></Armor>
                <GathererLimit>10</GathererLimit>
                <BuilderLimit>10</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>ConvertsHerds</UnitType>
                <UnitType>HasBountyValue</UnitType>
                <UnitType>CountsTowardEconomicScore</UnitType>
                <UnitType>Resource</UnitType>
                <UnitType>Building</UnitType>
                <UnitType>AbstractFarm</UnitType>
                <UnitType>ColonyBuilding</UnitType>
                <UnitType>Food</UnitType>
                <UnitType>BuildingClass</UnitType>
                <UnitType>Economic</UnitType>
                <Tech row ='0' page ='1' column ='0'>ypWaterConservancy</Tech>
                <Tech row ='0' page ='1' column ='0'>ypIrrigationSystems</Tech>
                <Tech row ='0' page ='1' column ='0'>ypImpLargeScaleAgricultureAsian</Tech>
                <Tech row ='0' page ='1' column ='1'>ypLandRedistribution</Tech>
                <Tech row ='0' page ='1' column ='0'>ypCultivateWasteland</Tech>
                <Tech row ='0' page ='1' column ='1'>ypSharecropping</Tech>
                <Tech row ='0' page ='1' column ='1'>ypCooperative</Tech>
                <Tech row ='0' page ='1' column ='1'>ypImpExcessiveTributeAsian</Tech>
                <Tech row ='1' page ='1' column ='0'>SeedDrill</Tech>
                <Tech row ='1' page ='1' column ='0'>ArtificialFertilizer</Tech>
                <Tech row ='0' page ='1' column ='1'>ypCropMarket</Tech>
                <Flag>EnterHotkeyContext</Flag>
                <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>UnlimitedSupply</Flag>
                <Flag>ColonyBuilding</Flag>
                <Flag>Tracked</Flag>
                <Flag>ShowTactics</Flag><!--理论上不添加也行,稻田本身能显示按钮,但其他没有按钮的建筑需要添加ShowTactics这个flag-->
                <Command page ='10' column ='1'>Delete</Command>
                <Command page ='9' column ='1'>RicePaddyCoin</Command>
                <Command page ='9' column ='0'>RicePaddyFood</Command>
                <Command page ='9' column ='2'>SquadUnlock</Command><!--显示按钮SquadUnlock-->
                <Tactics>ricepaddy.tactics</Tactics>
                <ProtoAction>
                        <Name>ModifyGatherCoin</Name>
                        <Rate type ='Gold'>1.000000</Rate>
                </ProtoAction>
                <ProtoAction>
                        <Name>ModifyGatherFood</Name>
                        <Rate type ='Food'>1.000000</Rate>
                </ProtoAction>
      </Unit>



然后找到你要修改的村民,有n个村民全部都添加一遍吧
在Gather添加采集效率
                <ProtoAction>
                        <Name>Gather</Name>
                        <Rate type ='Tree'>0.500000</Rate>
                        <Rate type ='Farm'>0.500000</Rate>
                        <Rate type ='Plantation'>0.500000</Rate>
                        <Rate type ='Herdable'>2.000000</Rate>
                        <Rate type ='Huntable'>0.840000</Rate>
                        <Rate type ='AbstractMine'>0.600000</Rate>
                        <Rate type ='BerryBush'>0.670000</Rate>
                        <Rate type ='FirePit'>0.100000</Rate>
                        <Rate type ='Mill'>0.670000</Rate>
                        <Rate type ='ypRicePaddy' resource ='Food'>0.500000</Rate>
                        <Rate type ='ypRicePaddy' resource ='Wood'>0.500000</Rate>
                        <Rate type ='ypRicePaddy' resource ='Gold'>0.340000</Rate>
                        <Rate type ='ypBerryBuilding'>0.670000</Rate>
                        <Rate type ='ypGroveBuilding'>0.500000</Rate>
                </ProtoAction>








提取稻田的tactics,新增内容已用红色字体标出
<?xml version="1.0" encoding="utf-8"?>

<tactics>
      <action>
                <name stringid="43294">ModifyGatherCoin</name>
                <type>ModifyGather</type>
                <active>1</active>
                <persistent>1</persistent>
      </action>
      <action>
                <name stringid="43295">ModifyGatherFood</name>
                <type>ModifyGather</type>
                <active>1</active>
                <persistent>1</persistent>
      </action>
      <action>
                <name>ModifyGatherWood</name>
                <type>ModifyGather</type>
                <Rate type ='Wood'>1.000000</Rate>
                <active>1</active>
                <persistent>1</persistent>
      </action>
      <tactic>
                PaddyFood
                <action>ModifyGatherFood</action>
                <transition>
                        <tactic>PaddyCoin</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
                <transition>
                        <tactic>PaddyWood</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
      </tactic>
      <tactic>
                PaddyCoin
                <action>ModifyGatherCoin</action>
                <transition>
                        <tactic>PaddyFood</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
                <transition>
                        <tactic>PaddyWood</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
      </tactic>
      <tactic>
                PaddyWood
                <action>ModifyGatherWood</action>
                <transition>
                        <tactic>PaddyFood</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
                <transition>
                        <tactic>PaddyCoin</tactic>
                        <length>2</length>
                        <exit>1</exit>
                </transition>
      </tactic>
</tactics>




protounitcommands.xml找到SquadUnlock,然后将SquadUnlock的command修改掉,图标什么的自己修改
      <protounitcommand>
                <name>SquadUnlock</name>
                <icon>art\ui\command\formation_unlocked</icon>
                <activeicon>art\ui\command\formation_unlocked_on</activeicon>
                <disabledicon>art\ui\command\formation_unlocked_off</disabledicon>
                <rollovertextid>30152</rollovertextid>
                <disabledrollovertextid/>
                <command>unitSetTactic("PaddyWood")</command><!--对应tactics-->
      </protounitcommand>

雪千代 发表于 2026-9-18 08:59:20

本帖最后由 列虚子 于 2026-9-18 09:01 编辑

{:4_88:}虽然不是修改稻田,想着羽神可能会写过就搜索到这了。即便解决了问题,也被自己蠢哭了——忘了加<Flag>ShowTactics</Flag>,弄了半天就说怎么没按钮,一直狂怼Tactics

Graziani 发表于 2026-11-3 17:42:28

こはね 发表于 2021-8-21 00:34
明天晚上给你整个具体的

不过被遗弃的按钮仅仅只有三个,用完就没了


插个眼羽佬,我最近做新单位的时候也遇到这个问题了,请问一下
这个被遗弃的按钮如果复用,能否更改它下面的字段内容,比如说如下的例子
        <protounitcommand>
                <name>SquadUnlock</name>
                <icon>art\ui\command\formation_unlocked</icon>
                <activeicon>art\ui\command\formation_unlocked_on</activeicon>
                <disabledicon>art\ui\command\formation_unlocked_off</disabledicon>
                <rollovertextid>30152</rollovertextid>
                <disabledrollovertextid/>
                <command>SquadLock(false)</command>
        </protounitcommand>
改成
        <protounitcommand>
                <name>SquadUnlock</name>
                <icon>art\ui\command\build_colony_wall</icon>
                <activeicon>art\ui\command\repair_colony_wall</activeicon>
                <disabledicon>art\ui\command\build_colony_wall</disabledicon>
                <rollovertextid>X</rollovertextid>
                <activerollovertextid>X2</activerollovertextid>
                <command>unitSetTactic("BlackPowder")</command>
        </protounitcommand>
而且似乎遗弃的按钮还不止三个,有不少来着{:7_330:}

Graziani 发表于 2026-11-3 17:42:53

本帖最后由 Graziani 于 2026-11-4 00:56 编辑

铸币了,应该先测试一下再回复羽佬的。经测试,某些神秘废弃按钮command指令图标可用,以Flash UI Category列表里提及但是protounitcommands里没有的Empower为例
单位下方加入
                <Command page ='9' column ='0'>Empower</Command>
对应的tactic里
      <tactic>
                Joke
                <action>Y</action>
                <protounitcommand>Empower</protounitcommand>
      </tactic>
protounitcommands加入一条,补写缺失的Empower
      <protounitcommand>
                <name>Empower</name>
                <icon>art\ui\command\?</icon>
                <activeicon>art\ui\command\!</activeicon>
                <disabledicon>art\ui\command\%</disabledicon>
                <rollovertextid>XXXXX</rollovertextid>
                <activerollovertextid>YYYYY</activerollovertextid>
                <command>unitSetTactic("Joke")</command>
      </protounitcommand>

实测,这样可行。大致筛了一下,Flash UI Category定义且protounitcommands已写好且无单位使用的废弃按钮,好像确实不止三个{:7_274:}
页: [1]
查看完整版本: 请问如何实现给亚洲稻田添加可以采集木头的选项