Новая система лучников:
-Стрельба навесом на дальние дистанции.
-Стрельба в упор на более близкие дистанции.
-Не 100% попадание в цель.
-3D-стрелы (кому надо с шейдерами – в приложении модельки и ассет.дат).
-Звук стрелы при полете.
Для начала, изменим сами стрелы.
Переходим в data\ini\object\goodfaction\goodfactionsubobjects.ini
Ищем "GoodFactionArrow”.
Нам нужно изменить следующие параметры
Заменить бех модели на это:
Draw = W3DScriptedModelDraw ModuleTag_Draw
DefaultModelConditionState
Model = G_Arrow2
;ParticleSysBone None ArrowExplosionSmoke FollowBone:yes
End
IdleAnimationState
Animation = IDLE
AnimationName = G_Arrow2.G_Arrow2
AnimationMode = LOOP
End
End
End
(если с шейдерами, то меняем все «G_Arrow2» на «G_Arrow4»)
И еще полностью меняем блок «BezierProjectileBehavior» на этот:
Behavior = BezierProjectileBehavior ModuleTag_04
; To tweak a Bezier path
; DetonateCallsKill = Yes
FirstHeight = 35 ;20 ;9 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 65 ;30 ;9
FirstPercentIndent = 30% ;20% ; Percentage of shot distance control points are placed
SecondPercentIndent = 70% ;90%
FlightPathAdjustDistPerSecond = 50 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag. (45 is default human speed)
GroundHitFX = FX_GondorArrowDeath
CurveFlattenMinDist = 100.0
TumbleRandomly = No ;Yes ;No
End
Далее создаем стрелы для стрельбы в упор:
Копируем измененный иник «GoodFactionArrow», называем его «GoodFactionArrowClose».
Меняем в нём только это:
Behavior = BezierProjectileBehavior ModuleTag_04
; To tweak a Bezier path
; DetonateCallsKill = Yes
FirstHeight = 10 ;20 ;9 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 10 ;30 ;9
FirstPercentIndent = 70% ;20% ; Percentage of shot distance control points are placed
SecondPercentIndent = 90% ;90%
FlightPathAdjustDistPerSecond = 50 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag. (45 is default human speed)
GroundHitFX = FX_GondorArrowDeath
CurveFlattenMinDist = 100.0
TumbleRandomly = No ;Yes ;No
End
Названия моделей для стрел:
-Фракции добра:
--Обычная, в архивах ЕА: G_Arrow / G_Arrow2
--Моего производства, с шейдерами: G_Arrow4
--Огненная: G_Arrow3
--Серебряная: EXSilver_AROW
-Фракции зла:
--Обычная, в архивах ЕА: W_Arrow
--Огненная: G_Arrow3
--Моего производства, с шейдерами: W_Arrow2
--Ледяная, моего производства: W_Arrow3
Для озвучки полёта, добавляем в нужный объект эту строку:
; *** AUDIO Parameters ***
SoundAmbient = ArrowFlySound
И по пути data\ini\soundeffects.ini
Добавляем это:
AudioEvent ArrowFlySound
Sounds = WIArrow_barbBya WIArrow_barbByb WIArrow_barbByc
Volume = 60
VolumeShift = -20
PitchShift = -50 10
Delay = 40 150
Control = interrupt
PlayPercent = 50
;Limit = 1
Type = world shrouded everyone
SubmixSlider = SoundFX
End
Теперь описываю изменения у самих юнитов, на примере лучников Гондора
Находим «PREATTACK_A», и меняем от «New style firing» до «End New style firing» на это:
//---------------------------------------------------
//New style firing
;Bombard fire, far range;;
AnimationState = PREATTACK_A
StateName = STATE_PreFiring
Animation = ReadyToDrawn
AnimationName = GUArcher_BMBA1 ;GUArcher_ATKF1
AnimationMode = ONCE
// UseWeaponTiming = Yes // UseWeaponTiming plus random weapon field equals desync. Leaving as warning
AnimationBlendTime = 10
End
End
AnimationState = FIRING_OR_RELOADING_A
StateName = STATE_Firing
Animation = LooseReloadDraw
AnimationName = GUArcher_BMBA2 ;GUArcher_ATKF2
AnimationMode = ONCE
// UseWeaponTiming = Yes // UseWeaponTiming plus random weapon field equals desync. Leaving as warning
AnimationSpeedFactorRange = 1.2 1.3 // Therefore, this is all you get. A slight speed up so that the animation can always finish before any possible random value Design sets the range for
AnimationBlendTime = 0
End
Flags = START_FRAME_FIRST
End
;Default fire, near range;;
AnimationState = PREATTACK_B
StateName = STATE_PreFiring
Animation = ReadyToDrawn
AnimationName = GUArcher_ATKF1
AnimationMode = ONCE
// UseWeaponTiming = Yes // UseWeaponTiming plus random weapon field equals desync. Leaving as warning
AnimationBlendTime = 10
End
End
AnimationState = FIRING_OR_RELOADING_B
StateName = STATE_Firing
Animation = LooseReloadDraw
AnimationName = GUArcher_ATKF2
AnimationMode = ONCE
// UseWeaponTiming = Yes // UseWeaponTiming plus random weapon field equals desync. Leaving as warning
AnimationSpeedFactorRange = 1.2 1.3 // Therefore, this is all you get. A slight speed up so that the animation can always finish before any possible random value Design sets the range for
AnimationBlendTime = 0
End
Flags = START_FRAME_FIRST
End
//End New style firing
//---------------------------------------------------
(все анимации присутствуют в архивах ЕА).
Далее меняем всё оружие на это:
WeaponSet
Conditions = None
Weapon = PRIMARY GondorArcherBow
End
WeaponSet
Conditions = CLOSE_RANGE CONTESTING_BUILDING
Weapon = SECONDARY GondorArcherBowClose
End
И устанавливаем в бехе «DualWeaponBehavior» значение «240»:
Behavior = DualWeaponBehavior ModuleTag_09
SwitchWeaponOnCloseRangeDistance = 240
End
Далее делаем изменения в отряде:
data\ini\object\goodfaction\hordes\men\menhordes.ini
Ищем «GondorArcherHorde», меняем там оружие на это:
WeaponSet
Conditions = None
Weapon = PRIMARY GoodArcherMissileHordeRangefinder
End
WeaponSet
Conditions = CLOSE_RANGE CONTESTING_BUILDING
Weapon = SECONDARY GoodArcherMissileHordeRangefinder
End
Behavior = DualWeaponBehavior ModuleTag_DualWeapon
SwitchWeaponOnCloseRangeDistance = 240
End
Дальше изменяем дальность стрельбы лучников Гондора,
data\ini\gamedata.ini
Ищем «GONDOR_ARCHER_RANGE», меняем значение на 600:
#define GONDOR_ARCHER_RANGE 600 ;300
И, наконец, data\ini\weapon.ini
Находим "GondorArcherBow" и заменяем его на это:
;------------------------------------------------------------------------------
Weapon GondorArcherBow
AttackRange = GONDOR_ARCHER_RANGE
RangeBonusMinHeight = 10
RangeBonus = 1
RangeBonusPerFoot = #MULTIPLY( GONDOR_ARCHER_RANGE .01 )
LeechRangeWeapon = Yes
WeaponSpeed = 321 ; dist/sec
MinWeaponSpeed = 241
MaxWeaponSpeed = 481 ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
FireFX = FX_RohanArcherBowWeapon
ScaleWeaponSpeed = Yes ; Used for lob weapons, scales speed proportional to range
;HitPercentage = 100 ;When this weapon is used it will hit exactly 50% of the time.
ScatterRadius = 400 ;ARCHER_SCATTER_RADIUS ;16.0 ;When this weapon misses it can randomly miss by as much as this distance.
AcceptableAimDelta = 20 ; prevent twitchy reaiming in horde on horde
DelayBetweenShots = 0
PreAttackDelay = GONDOR_ARCHER_BOW_PREATTACKDELAY
PreAttackRandomAmount = 200
PreAttackType = PER_POSITION
FiringDuration = 0
ClipSize = 1
AutoReloadsClip = Yes
AutoReloadWhenIdle = 1
ClipReloadTime = Min:GONDOR_ARCHER_BOW_RELOADTIME_MIN Max:GONDOR_ARCHER_BOW_RELOADTIME_MAX
ContinuousFireOne = 0
ContinuousFireCoast = GONDOR_ARCHER_BOW_RELOADTIME_MAX
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes
;HitPassengerPercentage = 20%
CanBeDodged = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent
;NoVictimNeeded = Yes ; For use with Bombard
ProjectileNugget ; Default arrow
ProjectileTemplateName = GondorArcherArrow
WarheadTemplateName = GondorArcherBowWarhead
ForbiddenUpgradeNames = Upgrade_GondorFireArrows
End
ProjectileNugget ; Fire arrow available through fire upgrade
ProjectileTemplateName = GondorArcherFireArrow
WarheadTemplateName = GondorArcherBowFireWarhead
RequiredUpgradeNames = Upgrade_GondorFireArrows
End
End
;------------------------------------------------------------------------------
Weapon GondorArcherBowClose
AttackRange = GONDOR_ARCHER_RANGE
RangeBonusMinHeight = 10
RangeBonus = 1
RangeBonusPerFoot = #MULTIPLY( GONDOR_ARCHER_RANGE .01 )
LeechRangeWeapon = Yes
WeaponSpeed = 321 ; dist/sec
MinWeaponSpeed = 241
MaxWeaponSpeed = 481 ; dist/sec Upper limit on scaling, when attacking past nominal "max" range
FireFX = FX_RohanArcherBowWeapon
ScaleWeaponSpeed = Yes ; Used for lob weapons, scales speed proportional to range
;HitPercentage = 100 ;When this weapon is used it will hit exactly 50% of the time.
ScatterRadius = 100 ;ARCHER_SCATTER_RADIUS_CLOSE ;16.0 ;When this weapon misses it can randomly miss by as much as this distance.
AcceptableAimDelta = 20 ; prevent twitchy reaiming in horde on horde
DelayBetweenShots = 0
PreAttackDelay = GONDOR_ARCHER_BOW_PREATTACKDELAY
PreAttackRandomAmount = 200
PreAttackType = PER_POSITION
FiringDuration = 0
ClipSize = 1
AutoReloadsClip = Yes
AutoReloadWhenIdle = 1
ClipReloadTime = Min:GONDOR_ARCHER_BOW_RELOADTIME_MIN Max:GONDOR_ARCHER_BOW_RELOADTIME_MAX
ContinuousFireOne = 0
ContinuousFireCoast = GONDOR_ARCHER_BOW_RELOADTIME_MAX
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes
;HitPassengerPercentage = 20%
CanBeDodged = Yes ; Will check for a DodgePercent on the target to have a second chance at failing HitPercent
;NoVictimNeeded = Yes ; For use with Bombard
ProjectileNugget ; Default arrow
ProjectileTemplateName = GondorArcherArrowClose
WarheadTemplateName = GondorArcherBowWarhead
ForbiddenUpgradeNames = Upgrade_GondorFireArrows
End
ProjectileNugget ; Fire arrow available through fire upgrade
ProjectileTemplateName = GondorArcherFireArrowClose
WarheadTemplateName = GondorArcherBowFireWarhead
RequiredUpgradeNames = Upgrade_GondorFireArrows
End
End
В «GondorArcherBowWarhead» меняем строку
HitStoredTarget = Yes ; Always hits initial target.
На
;HitStoredTarget = Yes ; Always hits initial target.
Всё, должно работать=) Если ничего не забыл. Объяснение немного корявое, но ума не приложу, как можно это объяснить новичкам по-другому… Если и это поймут.
Приложение:
Модели стрел и Asset.dat