3DMGAME 3DM首页 新闻中心 前瞻 | 评测 游戏库 热门 | 最新 攻略中心 攻略 | 秘籍 下载中心 游戏 | 汉化 购买正版 论坛

注册 登录

QQ登录

只需一步,快速开始

查看: 15916|回复: 32
打印 上一主题 下一主题

[MOD专区] 【MOD】关于如何添加武器-弩

  [复制链接]

31

主题

1101

帖子

1260

积分

游戏狂人

小小飞行员

Rank: 6Rank: 6

贡献度
34
金元
11241
积分
1260
精华
0
注册时间
2009-7-15
跳转到指定楼层
主题
发表于 2013-10-11 14:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 heiyukaitou 于 2013-11-13 12:30 编辑






在游戏中弩是使用不了的,笔者找了半天也没找到武器的随机刷新文件,以下方法实属无奈之举【还望大家前来探讨】
利用替换文件路径及修改某些代码的方法得以实现
但缺点就是要舍弃一把别的枪,即保留修改前枪支背包内显示图片并达成替换的目的

我们拿Rifle 750森林人这把举例
打开State of Decay\Game\scripts\entities\items\xml\weapons 里的Rifle_750_Forester.xml文件

开始进行文件内容替换:注意红字部分
<item name="Rifle_750_Forester" class="Weapon" category="Launcher" priority="4">
        <ai_descriptor handler="instant" burstBulletCountMin="1" burstBulletCountMax="2" draw_time="0.35"
            sweep_width="-1" sweep_frequency="-1"  burstPauseTimeMin="0.5" burstPauseTimeMax="1.5" singleFireTriggerTime="0.5" />


    <params>
        <param name="giveable"      value="1" />
        <param name="selectable"    value="1" />
        <param name="pose"              value="assault" />
        <param name="mass"              value="0" />
        <param name="canHaveSilencer"     value="0" />
        <param name="disturbanceValue"    value=".1" />
        <param name="soundRange"          value="0.0" />
        <param name="soundRangeSilenced"  value="0.0" />
        <param name="display_name" value="750 Forester"/>
        <param name="ammoMax"       value="150" />
    </params>

    <geometry>
        <firstperson name="objects/weapons/crossbow/crossbow_01/crossbow_01.cgf"/>
        <thirdperson name="objects/weapons/crossbow/crossbow_01/crossbow_01.cgf"/>  这两条最重要 直接替换模型路径
        <boneAttachments>以下内容直接复制就好 为原Crossbow 配置文件
            <attachment target="thirdperson" name="muzzle_flash_effect" bone="weapon_term"/>
            <attachment target="thirdperson" name="muzzle_flash_light" bone="weapon_term"/>
            <attachment target="thirdperson" name="muzzle_flash_smoke" bone="weapon_term"/>
        </boneAttachments>
    </geometry>

    <actions>
        <action name="select">
            <animation target="owner" name="select"/>
        </action>
        <action name="deselect">
            <animation target="owner" name="deselect"/>
        </action>

        <action name="fire_jammed">
            <sound target="player" name="Sounds/weapons:wpn_common:jammed" radius="20"/>
            <sound target="npc" name="Sounds/weapons:wpn_common:jammed" radius="20"/>      
        </action>
        <action name="fire_silenced">
            <sound target="player" name="sounds/weapons:wpn_launcher:GL_fire" radius="200" static="0"  />
            <sound target="player_reverb" name="sounds/weapons:wpn_launcher:GL_fire_rvrb" radius="200" static="0"  />
            <sound target="npc" name="sounds/weapons:wpn_NPC_launcher:GL_NPC_Fire" radius="200" static="0"/>
        </action>
        <action name="fire">
            <sound target="player" name="sounds/weapons:wpn_launcher:GL_fire" radius="200" static="0"  />
            <sound target="player_reverb" name="sounds/weapons:wpn_launcher:GL_fire_rvrb" radius="200" static="0"  />
            <sound target="npc" name="sounds/weapons:wpn_NPC_launcher:GL_NPC_Fire" radius="200" static="0"/>
        </action>

        <action name="reload">
          <animation target="owner" name="reload"/>
        </action>
        <action name="reload_start">
            <animation target="owner" name="reload_start"/>
        </action>
        <action name="reload_load">
            <animation target="owner" name="reload_load"/>
        </action>
        <action name="reload_end">
            <animation target="owner" name="reload_end"/>
        </action>
        <action name="empty_clip">
            <sound target="player" name="Sounds/weapons:wpn_common:dryfire" radius="20"/>
            <sound target="npc" name="Sounds/weapons:wpn_common:dryfire" radius="20"/>
        </action>
        <action name="change_firemode">
            <sound target="player" name="sounds/weapons:wpn_common:firemode" radius="20"/>
        </action>
    </actions>

  <audio>
    <player>
      <param name="precacheAudioFile" value="wpn_gl_06"/>
      <events>
        <event name="aim" output="Sounds/weapons:wpn_smg:fol_aim"/>
        <event name="relax" output="Sounds/weapons:wpn_smg:fol_relax"/>
        <event name="run" output="Sounds/weapons:wpn_smg:fol_run"/>
        <event name="run_quiet" output="Sounds/weapons:wpn_smg:fol_run_quiet"/>
        <event name="jump" output="Sounds/weapons:wpn_smg:fol_jump"/>
        <event name="stow" output="Sounds/weapons:wpn_smg:fol_stow"/>
        <event name="clipin" output="Sounds/weapons:wpn_smg:rld_clipin"/>
        <event name="clipout" output="Sounds/weapons:wpn_smg:rld_clipout"/>
        <event name="clipdrop" output="Sounds/weapons:wpn_smg:rld_clipdrop"/>
        <event name="slidepull" output="Sounds/weapons:wpn_smg:rld_slidepull"/>
      </events>
    </player>
    <npc>
      <param name="precacheAudioFile" value="wpn_gl_06_npc"/>
      <events>
        <event name="clipin" output="Sounds/weapons:wpn_smg:rld_clipin"/>
        <event name="clipout" output="Sounds/weapons:wpn_smg:rld_clipout"/>
        <event name="clipdrop" output="Sounds/weapons:wpn_smg:rld_clipdrop"/>
        <event name="slidepull" output="Sounds/weapons:wpn_smg:rld_slidepull"/>
      </events>
    </npc>
  </audio>

    <firemodes>
        <firemode type="default">
            <fire>
                <param name="ammo_type" value="bullet_22cal"/> 由于游戏内无弓箭弹药ul_arrow 我们拿.22替换
                <param name="rate" value="900"/>
                <param name="damage" value="400"/>
                <param name="reload_time" value="5.0"/>
                <param name="bullet_chamber" value="0"/>
                <param name="clip_size" value="100"/>
                <param name="helper_tp" value="weapon_term"/>
                <param name="nearmiss_signal" value="OnNearMiss"/>
            </fire>

            <recoil>
            <!-- each shot moves this amount along the x and y axes, measured from 5m -->
            <attack_base>
                <param name="x" value="0.0001"/>
                <param name="y" value="0.0025"/>
            </attack_base>

            <!-- randomness -->
            <attack_rand>
                <param name="nx" value="-0.01"/>
                <param name="x" value="0.01"/>
                <param name="ny" value="-0.003"/>
                <param name="y" value="0.005"/>
            </attack_rand>

            <!-- additional randomness for high rate -->
            <attack_rand_high>
                <param name="threshold_timeslice" value="0.45"/>
                <param name="threshold_shots" value="4"/> <!-- if shots fired in the last timeslice crosses the threshold use high recoil randomness. -->
                <param name="nx" value="-0.05"/>
                <param name="x" value="0.05"/>
                <param name="ny" value="-0.0"/>
                <param name="y" value="0.01"/>
            </attack_rand_high>

            <!-- times -->
            <param name="time_fadein"  value="0.001" />
            <param name="time_hold"    value="0.11" />
            <param name="time_fadeout" value="0.11"/>

            <!-- multipliers -->
            <param name="recoil_jump_m"      value="1.5" />
            <param name="recoil_crouch_m"    value="0.5" />
            <param name="recoil_sprint_m"    value="1.2" />
            <param name="recoil_runandgun_m" value="0.33"/>
            </recoil>

            <!-- If you don't want your gun to be super-accurate this adds some spread -->
            <spread>
                <param name="min" value="0.0"/>
                <param name="max" value="0.16"/>    <!-- max radius at 5m -->
                <param name="attack" value="0.06"/> <!-- spread per shot -->
                <param name="decay" value="0.3"/>   <!-- time from max to min -->

                <!-- movement modifier -->
                <param name="speed_threshold" value="1.0"/> <!-- movement speed over this adds spread -->
                <param name="speed_m" value="0.027"/>        <!-- movement times this is added to spread -->

                <param name="rotation_threshold" value="1.0"/> <!-- rotation over this add spread -->
                <param name="rotation_m" value="0.027"/>        <!-- rotation times this is added to spread -->

                <!-- multipliers -->
                <param name="spread_jump_m"      value="1.5" />
                <param name="spread_crouch_m"    value="0.85" />
                <param name="spread_sprint_m"    value="1.2" />
                <param name="spread_runandgun_m" value="1.0"/>
            </spread>

            <muzzleflash>
                <thirdperson effect="Class3_WeaponFX.muzzleflashes.grenade" helper="weapon_term" light_helper="weapon_term" light_radius="2" light_time="0.010" light_color="1,1,0.8" light_diffuse_mult="8"/>
            </muzzleflash>
            <reject>
                <firstperson effect="Class3_WeaponFX.shells.grenade" helper="shells"/>
                <thirdperson effect="Class3_WeaponFX.shells.grenade" helper="shells"/>
            </reject>
        </firemode>

        <firemode name="Single" type="Single">
        </firemode>
    </firemodes>

    <accessories>
        <accessory name="Silencer">
            <attach helper="silencer_attach" layer="silencer"/>
            <detach/>
            <params>
                <firemodes>
                    <firemode type="default">
                        <muzzleflash>
                            <firstperson effect="muzzleflash.AssaultRifle.silenced_smoke" helper="muzzle_flash_effect" time="0.1"/>
                            <thirdperson effect="muzzleflash.AssaultRifle.silenced_smoke_tp" helper="weapon_term" time="0.1"/>
                        </muzzleflash>
                        <actions>
                            <param name="fire" value="fire_silenced"/>
                            <param name="fire_cock" value="fire_silenced"/>
                        </actions>
                    </firemode>
                </firemodes>
            </params>
        </accessory>
    </accessories>
</item>
懒人的直接下载覆盖即可!
改好的,请进行同文件覆盖   BUG修复 rifle_750_forester.rar (1.98 KB, 下载次数: 1155)
弹药修改版(箭支)详见9楼




评分

5

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|3DMGAME ( 京ICP备14006952号-1  沪公网安备 31011202006753号

GMT+8, 2026-3-31 06:59 , Processed in 0.029031 second(s), 20 queries , Memcached On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表