打造世界吧 关注:38,817贴子:240,572
  • 21回复贴,共1

我大炮没弹药了,矮人不去填充,怎么办,拆了重放也不去填充

只看楼主收藏回复



IP属地:福建来自Android客户端1楼2023-09-19 23:45回复
    弹药还有一百多个,就是不去填充


    IP属地:福建来自Android客户端2楼2023-09-19 23:51
    回复
      干脆改成不用填炮弹的,删掉下面这几行就行了:

      看我的大炮打得多爽


      IP属地:广东3楼2023-09-20 08:33
      收起回复
        补充一点:
        craft_resources_1.xml文件中,下面这段代码属性里还要加一句add_res=cannon_ammo,这样大炮就自带弹药了。
        如下图所示:


        IP属地:广东4楼2023-09-23 21:18
        回复
          再分享个更好的大炮,就是双塔奇兵地图里山头上的大炮,攻击效果带火花,改一改就可以拿来打怪了。
          先上效果图:

          修改方法如下:
          为了不影响原来的大炮使用,我们新建一个炮塔。
          1.先在craft_resources.xml加入下面这段代码:
          <resource name="shooter_tower_gnomes555" title="%防卫炮塔 " desc="%小巧灵活,火力不减 " application="block" build="shooter_tower_gnomes555" properties="exclusive,add_res=cannon_ammo" shop_count="1" shop_cost="9" file="gfx/Two_fortressDLC/item_icons/shooter_tower_gnomes_icon.png" dlc="" pak="" order="" />
          这样商店里就可以买到这个炮塔了。
          2.再在blocks.xml文件中加入下面这段代码:
          <block name="shooter_tower_gnomes555" type="entity" properties="editor=mining" spine="shooter_tower_gnomes555" resource="shooter_tower_gnomes555" item="shooter_tower_gnomes555" build="1" extract="999" pak="" />
          这里规定了炮塔建造图和动画等信息。
          3.再在items.xml文件中加入下面这段代码:
          <item name="shooter_tower_gnomes555" gameobject="CannonEntity" properties="pirate_cannon,removable,static,dead_radius_x=1,dead_radius_y=2,nodig_under=1,item_part_lighting" spine="shooter_tower_gnomes555" size="1.00,1.00" spine_ani="idle" pak="">
          <behaviours>
          <behaviour value="AnimationBehaviour">
          <states>
          <state name="idle" loop="true" ani="idle" next="" />
          <state name="reload" loop="false" ani="charge" next="aim" />
          <state name="aim" loop="true" ani="aim" next="" />
          <state name="attack" loop="false" ani="attack" next="idle" />
          </states>
          </behaviour>
          <behaviour value="CannonBehaviour" config="CannonBall555.xml" />
          </behaviours>
          <params>
          <param name="interval" value="1" />
          <param name="max_angle" value="80" />
          <param name="min_enemy_count" value="1" />
          <param name="ammunition_refil_item" value="cannon_ammo" />
          <param name="light_bone" value="root" />
          <param name="light_on_event" value="light_on" />
          <param name="light_off_event" value="light_off" />
          </params>
          </item>
          这里按照海盗炮的逻辑设定炮塔和炮弹。
          4.修改动画,在游戏安装目录下运行Editor.exe文件,如图点击tools,再点Animation菜单

          然后新建一个动画,点击new,滚动条拉倒底下就看到新文件了,粘贴文件名shooter_tower_gnomes555
          再按回车键。在右边填入动画路径:gfx/Two_fortressDLC/spine/buildings/shooter_tower_gnomes/shooter_tower_gnomes.json
          显示比例调为0.09然后保存。

          5.在data\Components路径下,打开CannonBall.xml文件,在同一位置将它另存为CannonBall555.xml
          (下一楼贴代码)


          IP属地:广东5楼2023-09-23 22:32
          回复
            CannonBall555.xml文件代码如下:
            <root>
            <!-- CannonBehaviour -->
            <max_distance value="100" />
            <muzzle_bone value="aim" />
            <rotate_bone value="cannon" />
            <attack_event value="attack" />
            <ball_config value="CannonBall555.xml"/>
            <shot_light_on_event value="explosion_light_on" />
            <shot_light_off_event value="explosion_light_off" />
            <shot_sound value="cannon_shot" />
            <max_ammunition value="999" />
            <projectile_behaviours>
            <behaviour value="RigidBodySimplyfied" config="PirateShipCannonBall555.xml" />
            <behaviour value="CannonBall" config="CannonBall555.xml"/>
            <behaviour value="EffectPlayBehaviour">
            <effect value="spell_fireball_tail" />
            <loop value="true" />
            </behaviour>
            <behaviour value="DynamicLightBehaviour">
            <radius value="5" />
            <color value="#f0a50e" />
            <explore value="false" />
            </behaviour>
            <behaviour value="MiniMapItemBehaviour">
            <color value="#f0a50e"/>
            </behaviour>
            </projectile_behaviours>
            <!-- RigidBodySimplyfied -->
            <dampingByWater value="true"/>
            <bounceRatio value="0.1,0.5"/>
            <bounceVelocityClamp value="100"/>
            <velocityDamping value="1500"/>
            <!-- <gravity value="0,400"/> -->
            <gravity value="0,100"/>
            <!-- CannonBall -->
            <ball_image value="gfx/MonstersDLC/spine/builds/cannon/core"/>
            <hit_effect value="cannon_strike"/>
            <ball_size value="20"/>
            <ball_damage value="30"/>
            <ball_push_velocity value="150"/>
            <ball_enemy_dampig value="0.2"/>
            <start_velocity value="1200"/>
            <push_decrease_healt value="10"/>
            <push_decrease_ratio value="1"/>
            <targets value="workers_enemies" />
            <on_collide_instantiate>
            <behaviour value="DestroyHasNoChildrenBehaviour"/>
            <behaviour value="ExplodeMobsBehaviour">
            <radius value="4" />
            <damage value="2,20" />
            <push value="150,250" />
            <environment_damage value="false" />
            <targets value="workers_enemies" />
            </behaviour>
            <gameobject count="15,20" check_unique="false">
            <transform parent_depended="true"/>
            <behaviour value="RigidBodySimplyfied" config="TwoFortress/DwarfCannonShard.xml" />
            <behaviour value="CannonBall" config="TwoFortress/DwarfCannonShard.xml"/>
            <behaviour value="EffectPlayBehaviour">
            <effect value="cannon_projectile_shard" />
            <loop value="false" />
            <time value="1,1.5" />
            </behaviour>
            <behaviour value="DynamicLightBehaviour">
            <radius value="3" />
            <color value="#f0a50e" />
            <explore value="false" />
            </behaviour>
            </gameobject>
            </on_collide_instantiate>
            </root>
            这样就大功告成了。(代码格式在贴吧自动变了,原样如下图)



            IP属地:广东6楼2023-09-23 22:42
            收起回复