这个没什么好说原不原创的,那某些人就不要说别的了[哈欠] 下面还有附上的转载紫USMCv5吧的AI修改教程武器AI修改(转自百度_USMC_V5吧).txt
首先我们拿RURIF_AK47的文件来做例子!(一定要备份啊) 打开X盘(我的战地2存放地点)的bf2(某些版本是Battlefield2
)
/mods/bf2/Object
server.zip/weapons/Handheld/RURIF_AK47/rurif_ak47.tweak 这里是枪支的属性以及代码,主要修改这些地方!
rem *** Generated with Bf2Editor.exe [created: 2005/1/13 10:30]
http://www..com/doc/b817181482.html,pressVertexData 1 GeometryTemplate.maxTextureRepeat 8
ObjectTemplate.activeSafe GenericFireArm rurif_ak47 这里是枪支的代码,在Object server.zip的Kits的国家的兵种的tweak可以找到
ObjectTemplate.creator MBA-1:mba ObjectTemplate.modifiedByUser tda ObjectTemplate.saveInSeparateFile 1 rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud ObjectTemplate.weaponHud.weaponIcon Ingame\\Weapons\\Icons\\Hud\\RURIF_AK47.tga
ObjectTemplate.weaponHud.altWeaponIcon Ingame\\Weapons\\Icons\\Hud\\RURIF_AK47_mini.tga
ObjectTemplate.weaponHud.selectIcon
Ingame\\Weapons\\Icons\\Hud\\Selection\\RURIF_AK47.tga 武器图片(以上都是,新手修改不用管,移植才需要)
ObjectTemplate.weaponHud.hudName
KILLMESSAGE_WEAPON_ak47 这是武器的击杀代码,就是杀人后显示在左上角的武器名称
ObjectTemplate.weaponHud.guiIndex 4 武器没开镜的准心Gui代码
ObjectTemplate.weaponHud.altGuiIndex 52 这是开镜的Gui代码
ObjectTemplate.weaponHud.deviationFactor 5 ObjectTemplate.weaponHud.maxVisualDeviation 28 ObjectTemplate.weaponHud.minVisualDeviation 7 ObjectTemplate.weaponHud.disableOnSprint 1 rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp ObjectTemplate.fire.addFireRate 2 武器的发射模式(连发) ObjectTemplate.fire.addFireRate 0 武器的发射模式(单发),此外还有1(三连发可选)
ObjectTemplate.fire.fireInCameraDof 1 rem ---EndComp ---
rem ---BeginComp:DefaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp ObjectTemplate.ammo.reloadTime 4(武器装弹时间:4秒) 在装弹时间下面还可以添加:
ObjectTemplate.ammo.nrOfMags 7(携带弹夹数) ObjectTemplate.ammo.magSize 35(每个弹夹的子弹数)
rem ---EndComp ---
rem ---BeginComp:SoldierBasedRecoilComp ---
ObjectTemplate.createComponent SoldierBasedRecoilComp ObjectTemplate.recoil.hasRecoilForce 1 ObjectTemplate.recoil.recoilForceUp CRD_UNIFORM/0.4/0.6/0
ObjectTemplate.recoil.recoilForceLeftRight CRD_UNIFORM/-0.45/0.45/0
ObjectTemplate.recoil.zoomModifier 0.8 ObjectTemplate.recoil.recoilGraphFrameCount 4 ObjectTemplate.recoil.recoilGraphExponent 4 ObjectTemplate.recoil.recoilGraphTotalMovement 0.6 rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp --- ObjectTemplate.createComponent So ldierDeviationComp
ObjectTemplate.deviation.setFireDev 2.3 0.2 0.05(以下是准确度代码,建议新手直接复制比较准的武器的代码,因为这很容易错误)
ObjectTemplate.deviation.minDev 0.45 ObjectTemplate.deviation.setTurnDev 0 0 0 0 ObjectTemplate.deviation.setSpeedDev 1 0.2 0.2 0.1 ObjectTemplate.deviation.setMiscDev 3 1.5 0.05 ObjectTemplate.deviation.devModStand 1.3 ObjectTemplate.deviation.devModCrouch 1.2 ObjectTemplate.deviation.devModZoom 0.8 rem ---EndComp ---
rem ---BeginComp:DefaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp:DefaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp rem ---EndComp ---
rem ---BeginComp:DefaultZoomComp ---
ObjectTemplate.createComponent DefaultZoomComp ObjectTemplate.zoom.zoomDelay 0.08 ObjectTemplate.zoom.zoomLod 1
ObjectTemplate.zoom.addZoomFactor 0 不开镜的放大倍数:0
ObjectTemplate.zoom.addZoomFactor 0.6 开镜的放大倍数:0.6 这数字越小越精准(还可以不停的往下加,但狙击枪使用如果弄不好会有BUG
rem ---EndComp ---
ObjectTemplate.geometry rurif_ak47 ObjectTemplate.setCollisionMesh rurif_ak47 ObjectTemplate.mapMaterial 0 Collision_Material 0 ObjectTemplate.hasMobilePhysics 0 ObjectTemplate.hasCollisionPhysics 1 ObjectTemplate.physicsType Mesh
ObjectTemplate.aiTemplate RuRif_AK47 武器的AI代码,换上M24的这行就会让bot趴着打比较多,参见武器文件夹的AI文件
rem -------------------------------------
ObjectTemplate.addTemplate S_rurif_ak47_Fire1P 声音代码,新手不用管他,下面我将它省略
ObjectTemplate.addTemplate S_rurif_ak47_Fire1P_Outdoor ObjectTemplate.addTemplate S_rurif_ak47_Fire3P ObjectTemplate.setPosition 0/0.013551/0.501526 ObjectTemplate.addTemplate S_rurif_ak47_BoltClick ObjectTemplate.addTemplate S_rurif_ak47_TriggerClick
ObjectTemplate.addTemplate S_rurif_ak47_SwitchFireRate ObjectTemplate.addTemplate S_rurif_ak47_Reload1P ObjectTemplate.addTemplate S_rurif_ak47_Reload3P ObjectTemplate.setPosition 0/-0.0279925/0.043941 ObjectTemplate.addTemplate S_rurif_ak47_Deploy1P ObjectTemplate.addTemplate S_rurif_ak47_Deploy3P ObjectTemplate.addTemplate S_rurif_ak47_Zoom ObjectTemplate.addTemplate e_muzz_ak101 开火特效 ObjectTemplate.setPosition
0.000722243/0.0135507/0.496039 特效的位置
ObjectTemplate.addTemplate e_shellejection_556 抛射弹壳特效
ObjectTemplate.setPosition
0.0140295/0.0168836/0.0694686 特效的位置
rem ------------------------------------- ObjectTemplate.animationSystem1P
Objects/Weapons/Handheld/rurif_ak47/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P
Objects/Weapons/Handheld/rurif_ak47/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate rurif_ak47_Projectile(发射的弹药代码,配合下面的
以替换其他武器的)
ObjectTemplate.velocity 1000 武器子弹发射出膛的速度,越大越快
ObjectTemplate.itemIndex 3 武器的键位3,就是按3可以切换到这个武器(修改时需要注意键位,记得备份)
ObjectTemplate.delayToUse 1.2
ObjectTemplate.create
GenericProjectile ObjectTemplate.create
GenericProjectile rurif_ak47_Projectile使用,也可
rurif_ak47_Projectile 配合上面的弹药代码
ObjectTemplate.modifiedByUser tda ObjectTemplate.createNotInGrid 1 ObjectTemplate.createdInEditor 1
rem ---BeginComp:DefaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp rem ---EndComp ---
rem ---BeginComp:DefaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp rem ---EndComp ---
rem ---BeginComp:DefaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp rem ---EndComp ---
rem ---BeginComp:DefaultRicochetComp ---
ObjectTemplate.createComponent DefaultRicochetComp rem ---EndComp ---
rem ---BeginComp:DefaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp rem ---EndComp ---
ObjectTemplate.floaterMod 0 ObjectTemplate.hasMobilePhysics 1 ObjectTemplate.hasCollisionPhysics 1 ObjectTemplate.physicsType Point
ObjectTemplate.material 38 子弹材质(38为步枪39为手枪42为狙击枪44为火炮56为炸弹等等)
rem ------------------------------------- ObjectTemplate.addTemplate S_rurif_ak47_Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/0.5/0/0
ObjectTemplate.material 38
ObjectTemplate.minDamage 0.2最小威力 ObjectTemplate.damage 38最大威力
因篇幅问题不能全部显示,请点此查看更多更全内容