高级玩家

- 贡献度
- 15
- 金元
- 3746
- 积分
- 435
- 精华
- 0
- 注册时间
- 2013-11-8

|
兄弟们大家好,今天进入修改关于单位武器的修改部分
——————
4.2.如何修改单位武器
——————
在warno的单位修改中,我们提到了warno的单位武器在单位文件中是没有数据的,在单位文件中只会有单位使用什么武器的代码映射,比如:
WeaponManager is TModuleSelector
(
Default = $/GFX/Weapon/WeaponDescripto_T80UD_SOV
Condition = ~/IfNotCadavreCondition
),
这就代表着t80UD这个单位,使用的是WeaponDescripto_T80UD_SOV这个武器映射,而武器实际上的信息是在WeaponDescriptor.ndf武器描述文件里;
————————
在武器文件中,每一个武器映射是由一段代码组成,这里我们继续看T80UD这个单位,他的代码如下:
export WeaponDescriptor_T80UD_SOV is TWeaponManagerModuleDescriptor
(
Salves = [ 1, 4, 65, 65, 1, ]
AlwaysOrientArmorTowardsThreat = True
TurretDescriptorList = [
TTurretTwoAxisDescriptor
(
AngleRotationBase = 0.0
AngleRotationBasePitch = 0.0
AngleRotationMax = 6.283185307179586
AngleRotationMaxPitch = 0.4363323129985824
AngleRotationMinPitch = -0.17453292519943295
MountedWeaponDescriptorList = [
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_Canon_AP_125_mm_2A46M_late_T80UD
AnimateOnlyOneSoldier = False
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_Canon_AP_125_mm_2A46M_late_T80UD'
HandheldEquipmentKey = 'MeshAlternative_1'
NbWeapons = 1
SalvoStockIndex = 0
ShowDispersion = False
ShowInInterface = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_1'
WeaponIgnoredPropertyName = 'WeaponIgnored_1'
WeaponShootDataPropertyName = ['WeaponShootData_0_1']
),
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_Canon_HE_125_mm_2A46M_late_T80UD
AnimateOnlyOneSoldier = False
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_Canon_HE_125_mm_2A46M_late_T80UD'
HandheldEquipmentKey = 'MeshAlternative_2'
NbWeapons = 1
SalvoStockIndex = 0
ShowDispersion = False
ShowInInterface = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_2'
WeaponIgnoredPropertyName = 'WeaponIgnored_2'
WeaponShootDataPropertyName = ['WeaponShootData_0_2']
),
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_ATGM_9M119M_Refleks
AnimateOnlyOneSoldier = False
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_ATGM_9M119M_Refleks'
HandheldEquipmentKey = 'MeshAlternative_3'
NbWeapons = 1
SalvoStockIndex = 1
ShowDispersion = False
ShowInInterface = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_3'
WeaponIgnoredPropertyName = 'WeaponIgnored_3'
WeaponShootDataPropertyName = ['WeaponShootData_0_3']
)
]
OutOfRangeTrackingDuration = 3.5
Tag = 'tourelle1'
TurretIdleBehaviourDescriptor = ~/TurretIdle_WatchForwardNormal
VitesseRotation = 1.0471975511965976
YulBoneOrdinal = 1
),
TTurretTwoAxisDescriptor
(
AngleRotationBase = 0.0
AngleRotationBasePitch = 0.17453292519943275
AngleRotationMax = 6.283185307179586
AngleRotationMaxPitch = 0.7853981633974483
AngleRotationMinPitch = -0.17453292519943295
MountedWeaponDescriptorList = [
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_HMG_12_7_mm_NSVT
AnimateOnlyOneSoldier = True
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_HMG_12_7_mm_NSVT'
HandheldEquipmentKey = 'MeshAlternative_4'
NbWeapons = 1
SalvoStockIndex = 2
ShowDispersion = False
ShowInInterface = True
TirContinu = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_4'
WeaponIgnoredPropertyName = 'WeaponIgnored_4'
WeaponShootDataPropertyName = ['WeaponShootData_0_4']
)
]
OutOfRangeTrackingDuration = 3.5
Tag = 'tourelle2'
TurretIdleBehaviourDescriptor = ~/TurretIdle_WatchForwardMG
VitesseRotation = 1.0471975511965976
YulBoneOrdinal = 2
),
TTurretTwoAxisDescriptor
(
AimingPriority = 3
AngleRotationBase = 0.0
AngleRotationBasePitch = 0.0
AngleRotationMax = 0.017453292519943295
AngleRotationMaxPitch = 0.13962634015954636
AngleRotationMinPitch = -0.13962634015954636
MasterTurretYulBoneOrdinal = 1
MountedWeaponDescriptorList = [
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_MMG_PKT_7_62mm
AnimateOnlyOneSoldier = True
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_MMG_PKT_7_62mm'
HandheldEquipmentKey = 'MeshAlternative_5'
NbWeapons = 1
SalvoStockIndex = 3
ShowDispersion = False
ShowInInterface = True
TirContinu = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_5'
WeaponIgnoredPropertyName = 'WeaponIgnored_5'
WeaponShootDataPropertyName = ['WeaponShootData_0_5']
)
]
OutOfRangeTrackingDuration = 3.5
Tag = 'tourelle4'
VitesseRotation = 1.5707963267948966
YulBoneOrdinal = 4
),
TTurretUnitDescriptor
(
AngleRotationMax = 2.0943951023931953
AngleRotationMaxPitch = 1.5707963267948966
AngleRotationMinPitch = -1.5707963267948966
MountedWeaponDescriptorList = [
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_SMOKE_Vehicle_Grenadex8
AnimateOnlyOneSoldier = True
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_SMOKE_Vehicle_Grenadex8'
HandheldEquipmentKey = 'MeshAlternative_6'
NbWeapons = 1
SalvoStockIndex = 4
ShowDispersion = False
ShowInInterface = False
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_6'
WeaponIgnoredPropertyName = 'WeaponIgnored_6'
WeaponShootDataPropertyName = ['WeaponShootData_0_6', 'WeaponShootData_1_6', 'WeaponShootData_2_6', 'WeaponShootData_3_6']
)
]
Tag = 'tourelle5'
YulBoneOrdinal = 5
)
]
)
————————————————————
其中:
Salves = [ 1, 4, 65, 65, 1, ]
这个代表着单位有5种可开火的武器类型(数字代表的含义其实是和弹药共同作用的开火次数这个我后面解释)
TTurretTwoAxisDescriptor
(
AngleRotationBase = 0.0
AngleRotationBasePitch = 0.0
AngleRotationMax = 6.283185307179586
AngleRotationMaxPitch = 0.4363323129985824
AngleRotationMinPitch = -0.17453292519943295
MountedWeaponDescriptorList = [
这个代表的是t80使用的是双轴炮塔, 其中数字为炮塔的旋转角度
——————————
MountedWeaponDescriptorList = [
这个之后的代码,就代表着装载的武器信息了,每一个代码块和上面的Salves = [ 1, 4, 65, 65, 1, ]有关联关系
TMountedWeaponDescriptor(
Ammunition = $/GFX/Weapon/Ammo_Canon_AP_125_mm_2A46M_late_T80UD
AnimateOnlyOneSoldier = False
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_Canon_AP_125_mm_2A46M_late_T80UD'
HandheldEquipmentKey = 'MeshAlternative_1'
NbWeapons = 1
SalvoStockIndex = 0
ShowDispersion = False
ShowInInterface = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_1'
WeaponIgnoredPropertyName = 'WeaponIgnored_1'
WeaponShootDataPropertyName = ['WeaponShootData_0_1']),
TMountedWeaponDescriptor(
Ammunition = $/GFX/Weapon/Ammo_Canon_HE_125_mm_2A46M_late_T80UD
AnimateOnlyOneSoldier = False
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_Canon_HE_125_mm_2A46M_late_T80UD'
HandheldEquipmentKey = 'MeshAlternative_2'
NbWeapons = 1
SalvoStockIndex = 0
ShowDispersion = False
ShowInInterface = True
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_2'
WeaponIgnoredPropertyName = 'WeaponIgnored_2'
WeaponShootDataPropertyName = ['WeaponShootData_0_2']),
第一个装载的武器:是Ammo_Canon_AP_125_mm_2A46M_late_T80UD和Ammo_Canon_HE_125_mm_2A46M_late_T80UD
即为坦克的主炮,为什么他们两个是第一个武器呢,实际是:SalvoStockIndex = 0这里写的,这个代表着这两个武器是共用Salves = [ 1, 4, 65, 65, 1, ]这个齐射弹药属性的第0位信息也就是第一个数字1;
但是实际在武器界面我们可以看到,t80UD的主炮,弹药是38发而不是1发,是为什么呢?
这里我也没有搞得非常清楚,只能说按照我的浅薄的理解,这里的Salves = [ 1, 4, 65, 65, 1, ]会和弹药文件中的NbTirParSalves = 38与AffichageMunitionParSalve = 38共同作用,用来描述单位可以开火的次数,以及开火的数据;
————————————————
接下来我们可以看到,实际T80UD只有4个武器,但是为什么Salves = [ 1, 4, 65, 65, 1, ]会有5个数据呢?
其实最后的1描述的是烟雾弹:
TTurretUnitDescriptor
(
AngleRotationMax = 2.0943951023931953
AngleRotationMaxPitch = 1.5707963267948966
AngleRotationMinPitch = -1.5707963267948966
MountedWeaponDescriptorList = [
TMountedWeaponDescriptor
(
Ammunition = $/GFX/Weapon/Ammo_SMOKE_Vehicle_Grenadex8
AnimateOnlyOneSoldier = True
DispersionRadiusOffColor = RGBA[0,0,0,0]
DispersionRadiusOffThickness = -0.1
DispersionRadiusOnColor = RGBA[0,0,0,0]
DispersionRadiusOnThickness = -0.1
EffectTag = 'FireEffect_SMOKE_Vehicle_Grenadex8'
HandheldEquipmentKey = 'MeshAlternative_6'
NbWeapons = 1
SalvoStockIndex = 4
ShowDispersion = False
ShowInInterface = False
WeaponActiveAndCanShootPropertyName = 'WeaponActiveAndCanShoot_6'
WeaponIgnoredPropertyName = 'WeaponIgnored_6'
WeaponShootDataPropertyName = ['WeaponShootData_0_6', 'WeaponShootData_1_6', 'WeaponShootData_2_6', 'WeaponShootData_3_6']
)
]
Tag = 'tourelle5'
YulBoneOrdinal = 5
)
]
如果你把最后的1修改为10,那么这个单位就可以发射10枚烟雾弹了
——————————————
武器描述其实也不会实际修改单位的伤害,射速等信息,它只是用了描述单位使用武器有哪些,而具体的伤害数据属性,则是由弹药文件Ammunition.ndf和导弹弹药文件AmmunitionMissiles.ndf来描述的,
那么下一次我们会着重介绍弹药与导弹弹药文件的内容,如何修改伤害,装填时间,弹药散步,瞄准时间,准确度等信息;
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|