mrf 发表于 2021-8-3 11:45:26

制作类似畜牧增长的上限问题

根据圣典和我的理解,畜牧自身资源上限在carrycapacity定义。我新添加了一个可以自动增长木材的树林,加了自动增长、初始资源和上限,在游戏中确实显示木材:300/3000,也会自动增长,一切正常,但是资源增长到3000/3000之后不停,继续增长超过上限,就好像这个上限只是个摆设一样……我复制的芒果园,标签和单位类型都直接用的,是需要加特殊的标签或类型(比如herd)吗?谢谢

こはね 发表于 2021-8-3 12:41:07

请附上protoy与tactics语句

こはね 发表于 2021-8-15 13:37:14

这是楼主所提供的语句,还要我催他才给我发过来{:4_91:}

<unit id="1351" name="Woods">
    <dbid>2001</dbid>
    <displaynameid>99878</displaynameid>
    <obstructionradiusx>3.0000</obstructionradiusx>
    <obstructionradiusz>3.0000</obstructionradiusz>
    <maxvelocity>0.0000</maxvelocity>
    <movementtype>land</movementtype>
    <animfile>buildings\asian_civs\grove\grove.xml</animfile>
    <impacttype>Wood</impacttype>
    <placementfile>grove.xml</placementfile>
    <icon>resources\art\buildings\asian_civs\grove\grove_icon_64.png</icon>
    <portraiticon>resources\art\buildings\asian_civs\grove\grove_icon_portrait.png</portraiticon>
    <rollovertextid>99877</rollovertextid>
    <shortrollovertextid>99877</shortrollovertextid>
    <los>0.1000</los>
    <buildpoints>10.0000</buildpoints>
    <carrycapacity resourcetype="Wood">3000.0000</carrycapacity>
    <initialresource resourcetype="Wood">100.0000</initialresource>
    <cost resourcetype="Wood">500.0000</cost>
    <resourcesubtype>Wood</resourcesubtype>
    <allowedage>4</allowedage>
    <resourcesubtype>Wood</resourcesubtype>
    <buildingworkrate>1.0000</buildingworkrate>
    <minimapcolor red="0.1900" blue="0.1800" green="0.2500">
    </minimapcolor>
    <unittype>LogicalTypeValidSabotage</unittype>
    <unittype>LogicalTypeMinimapFilterEconomic</unittype>
    <unittype>LogicalTypeBuildingsNotWalls</unittype>
    <unittype>LogicalTypeVillagersAttack</unittype>
    <unittype>LogicalTypeShipsAndBuildings</unittype>
    <unittype>LogicalTypeVillagersRespondToAttack</unittype>
    <unittype>CountsTowardEconomicScore</unittype>
    <unittype>AbstractFruit</unittype>
    <unittype>Building</unittype>
    <unittype>Resource</unittype>
    <unittype>ColonyBuilding</unittype>
    <unittype>BuildingClass</unittype>
    <unittype>Wood</unittype>
    <unittype>Tree</unittype>
    <unittype>Nature</unittype>
    <unittype>AbstractFindOtherEconomicBuilding</unittype>
    <flag>StartsAtFullEfficiency</flag>
    <flag>Immoveable</flag>
    <flag>NoBloodOnDeath</flag>
    <flag>ObscuresUnits</flag>
    <flag>NoIdleActions</flag>
    <flag>NonAutoFormedUnit</flag>
    <flag>Doppled</flag>
    <flag>SelectWithObstruction</flag>
    <flag>PaintTextureWhenPlacing</flag>
    <flag>FlattenGround</flag>
    <flag>NotDeleteable</flag>
    <flag>DieAtZeroResources</flag>
    <flag>Invulnerable</flag>
    <flag>DoNotValidateResourceInventory</flag>
    <flag>ObscuredByUnits</flag>
    <flag>NeverCountDeathAsLoss</flag>
    <flag>Tracked</flag>
    <tactics>woods.tactics</tactics>
    <command page="10" column="7">Delete</command>
    <protoaction>
      <name>AutoGatherWood</name>
      <rate type="Wood">2.000000</rate>
    </protoaction>
</unit>



tactics

<tactics>
<action>
    <name stringid="43295">AutoGatherWood</name>
    <type>AutoGather</type>
    <persistent>1</persistent>
    <addresourcestoinventory>1</addresourcestoinventory>
</action>
<tactic>Normal<action>AutoGatherWood</action></tactic>
</tactics>


こはね 发表于 2021-8-15 13:44:19

根据上一楼层的语句以及以前的修改经验,有什么不正常的地方基本上都是flag出了问题,第一眼看上去可疑的就是<flag>DoNotValidateResourceInventory</flag>


后面经过实际测试,添加了<flag>DoNotValidateResourceInventory</flag>,畜牧类增长可以突破上限;删掉后不能超过上限


添加<flag>DoNotValidateResourceInventory</flag>后如下图所示


没有添加<flag>DoNotValidateResourceInventory</flag>的情况下如下图所示

页: [1]
查看完整版本: 制作类似畜牧增长的上限问题