Здравствуйте! Авторизуйтесь или зарегистрируйтесь, чтобы использовать полный функционал сайта
Быстрая авторизация через соцсети:

Главная » Статьи » Моддинг » Коддинг
Добавление Элронда в БФМЕ 1
Если вы фанат первой части, то этот туториал для вас. Недавно я копался в WorldBuilder'е первой части и наткнулся там на Элронда с уникальной моделью и текстурой! Это было для меня сюрпризом, ведь в игре его нет, а появился лишь во 2 части. Сразу после этого я решил его добавить в игру Гондору, ну а потом решил написать про это туториал, чтобы и другие смогли.
Короче, нам понадобятся следующие адреса в INI.Big:
1.data/ini/playertemplate.ini.
2.data/ini/gamedata.ini.
3.data/ini/experiencelevels.ini.
4.data/ini/weapon.ini.
5.data/ini/object/goodfaction/units/lven/elrond.ini.


Начнём с того, что добавим его в игру.
Для этого заходим в data/ini/playertemplate.ini, находим вот это:

BuildableHeroesMP = GondorGandalf GondorBoromir GondorFaramir RohanPippin

И вписываем в строку ElvenElrond.
Получится вот так:

BuildableHeroesMP = GondorGandalf GondorBoromir GondorFaramir RohanPippin ElvenElrond

В принципе герой уже добавлен, но в игре он туповат: нанимается за 0, с 10 уровня, способность переключка на лук тоже не очень: урон от лука, как у обычного гондорского мечника. Что бы это исправить, идём по следующим адресам:
data/ini/gamedata.ini.

Там мы находим вот что:

;-----------------------Elrond------------------
#define ELROND_HEALTH 2000

#define ELROND_PREATTACKDELAY 600
#define ELROND_DELAYBETWEENSHOTS 1200
#define ELROND_FIRINGDURATION 1200
#define ELROND_DAMAGE 150


Да, не густо. Поэтому вставляем вместо сего недоразумения вот что:

;-----------------------Elrond------------------
#define ELROND_BUILDCOST 3000
#define ELROND_BUILDTIME 35
#define ELROND_HEALTH 2000

#define ELROND_LVL1_EXP_AWARD 50
#define ELROND_LVL2_EXP_AWARD 60
#define ELROND_LVL3_EXP_AWARD 70
#define ELROND_LVL4_EXP_AWARD 80
#define ELROND_LVL5_EXP_AWARD 90
#define ELROND_LVL6_EXP_AWARD 100
#define ELROND_LVL7_EXP_AWARD 120
#define ELROND_LVL8_EXP_AWARD 150
#define ELROND_LVL9_EXP_AWARD 200
#define ELROND_LVL10_EXP_AWARD 300

#define ELROND_LVL2_EXP_NEEDED 60 ;100
#define ELROND_LVL3_EXP_NEEDED 150 ;400
#define ELROND_LVL4_EXP_NEEDED 250 ;600
#define ELROND_LVL5_EXP_NEEDED 350 ;800
#define ELROND_LVL6_EXP_NEEDED 550 ;1000
#define ELROND_LVL7_EXP_NEEDED 750 ;1200
#define ELROND_LVL8_EXP_NEEDED 950 ;1400
#define ELROND_LVL9_EXP_NEEDED 1150 ;1600
#define ELROND_LVL10_EXP_NEEDED 1600 ;2000

#define ELROND_BOW_DAMAGE 55
#define ELROND_PREATTACKDELAY 600
#define ELROND_DELAYBETWEENSHOTS 1200
#define ELROND_FIRINGDURATION 1200
#define ELROND_DAMAGE 150


Потом в data/ini/experiencelevels.ini. Прописываем уровни. Я сделал ему собственную прокачку.
Для этого надо заменить Это:

ExperienceLevel ElrondLevel1
TargetNames = ElvenElrond
RequiredExperience = 1
ExperienceAward = 0
Rank = 10
AttributeModifiers = ElrondResistKnockback
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 40
End
End


На это:

;----------- ELROND ------------------
ExperienceLevel ElrondLevel1
TargetNames = ElvenElrond
RequiredExperience = 1
ExperienceAward = ELROND_LVL1_EXP_AWARD
Rank = 1
AttributeModifiers = ElrondResistKnockback
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel2
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL2_EXP_NEEDED
ExperienceAward = ELROND_LVL2_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage1
Upgrades = Upgrade_BladeOfPurity
Rank = 2
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel3
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL3_EXP_NEEDED
ExperienceAward = ELROND_LVL3_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage2
Rank = 3
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
;Upgrades = Upgrade_BoromirLastStand
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel4
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL4_EXP_NEEDED
ExperienceAward = ELROND_LVL4_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage3
Rank = 4
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
; Upgrades = Upgrade_HeroRadiateFear
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel5
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL5_EXP_NEEDED
ExperienceAward = ELROND_LVL5_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage4
Rank = 5
;Upgrades = Upgrade_BoromirForGondorSpeech
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel6
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL6_EXP_NEEDED
ExperienceAward = ELROND_LVL6_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage5
Rank = 6
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel7
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL7_EXP_NEEDED
ExperienceAward = ELROND_LVL7_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage6
Rank = 7
;Upgrades = Upgrade_FaramirCaptainOfGondor
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel8
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL8_EXP_NEEDED
ExperienceAward = ELROND_LVL8_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage7
Rank = 8
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel9
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL9_EXP_NEEDED
ExperienceAward = ELROND_LVL9_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage8
Rank = 9
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END

ExperienceLevel ElrondLevel10
TargetNames = ElvenElrond
RequiredExperience = ELROND_LVL10_EXP_NEEDED
ExperienceAward = ELROND_LVL10_EXP_AWARD
AttributeModifiers = HeroLevelUpDamage9
Rank = 10
LevelUpFx = FX:GandalfLevelUp1FX
;LevelUpOCL = OCL_GandalfLevelUp1OCL
SelectionDecal
Texture = decal_hero_good
Style = SHADOW_ALPHA_DECAL
OpacityMin = 50%
OpacityMax = 100%
MinRadius = 40
MaxRadius = 200
MaxSelectedUnits = 1
End
END


Потом поправим его лук. Вdata/ini/weapon.ini заменяем это:

;------------------------------------------------------------------------------
Weapon ElrondBow ; BALANCE Elven Archer Weapon
AttackRange = 320.0
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 100% of the time.
ScatterRadius = 16.0 ;When this weapon misses it can randomly miss by as much as this distance.
DelayBetweenShots = 0 ; time between shots, msec
PreAttackDelay = 833 ; 1467 is the prep time for archer.
PreAttackRandomAmount = 0 ; amount of additional preattack variance for archer type attacks only
PreAttackType = PER_POSITION ; Do the delay each time we attack a new target
FiringDuration = 0 ; Duration of the archer firing shot is 500ms.

ClipSize = 1
AutoReloadsClip = Yes
AutoReloadWhenIdle = 1
ClipReloadTime = Min:1800 Max:1800
ContinuousFireOne = 0
ContinuousFireCoast = 1800

IsAimingWeapon = Yes
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes

ProjectileNugget ; Default arrow
ProjectileTemplateName = GoodFactionArrow
WarheadTemplateName = ElvenArcherBowWarhead
ForbiddenUpgradeNames = Upgrade_RohanFireArrows
End

ProjectileNugget ; Fire arrow available through fire upgrade
ProjectileTemplateName = GoodFactionFireArrow
WarheadTemplateName = GondorArcherBowWarhead
RequiredUpgradeNames = Upgrade_RohanFireArrows
End
End


На это:

;------------------------------------------------------------------------------
Weapon ElrondBow ; BALANCE Elven Archer Weapon
AttackRange = 320.0
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 100% of the time.
ScatterRadius = 16.0 ;When this weapon misses it can randomly miss by as much as this distance.
DelayBetweenShots = 0 ; time between shots, msec
PreAttackDelay = 833 ; 1467 is the prep time for archer.
PreAttackRandomAmount = 0 ; amount of additional preattack variance for archer type attacks only
PreAttackType = PER_POSITION ; Do the delay each time we attack a new target
FiringDuration = 0 ; Duration of the archer firing shot is 500ms.

ClipSize = 1
AutoReloadsClip = Yes
AutoReloadWhenIdle = 1
ClipReloadTime = Min:1800 Max:1800
ContinuousFireOne = 0
ContinuousFireCoast = 1800

IsAimingWeapon = Yes
AntiAirborneVehicle = Yes
AntiAirborneMonster = Yes

ProjectileNugget ; Default arrow
ProjectileTemplateName = GoodFactionArrow
WarheadTemplateName = ElrondBowWarhead
End
End

;----------------------------
Weapon ElrondBowWarhead
ProjectileCollidesWith = ALLIES ENEMIES NEUTRAL STRUCTURES WALLS
RadiusDamageAffects = ENEMIES NEUTRALS NOT_SIMILAR
HitStoredTarget = Yes ; Always hits initial target.
DamageNugget ; A basic Nugget that just does damage
Damage = ELROND_BOW_DAMAGE
Radius = 0.0 ; HitStoredTarget means we hurt the person we launched at. And nobody else. So a miss hurts nobody.
DelayTime = 0
DamageType = HERO_RANGED
DamageFXType = GOOD_ARROW_PIERCE
DeathType = NORMAL
End
End


И самое последнее: идём к Элронду в data/ini/object/goodfaction/units/lven/elrond.ini.
Там находим DESIGN parameters и заменяем всё до этих строк: VisionRange = VISION_HERO_RANGED вот на что:

; ***DESIGN parameters ***
Side = Gondor
EditorSorting = UNIT
ThreatLevel = 4.0
BuildCost = ELROND_BUILDCOST
BuildTime = ELROND_BUILDTIME
ThingClass = CHARACTER_UNIT

TransportSlotCount = 1
WeaponSet
Conditions = None
Weapon = PRIMARY ElrondBow
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
End
WeaponSet
Conditions = WEAPONSET_TOGGLE_1
Weapon = PRIMARY ElrondSword
AutoChooseSources = PRIMARY FROM_PLAYER FROM_SCRIPT FROM_AI
End

ArmorSet
Conditions = None
Armor = ToughHeroArmor
DamageFX = NormalDamageFX
End

Чтобы герой воскрешался, добавляем это:

Body = RespawnBody ModuleTag_RespawnBody
CheerRadius = EMOTION_CHEER_RADIUS
MaxHealth = ELROND_HEALTH ;BALANCE Eomer Health
PermanentlyKilledByFilter = NONE ;Who kills me permanently?
DodgePercent = HERO_DODGE_PERCENT
End

Behavior = RespawnUpdate ModuleTag_RespawnUpdate
; DeathAnim = STUNNED ;Model condition to play when killed-to-respawn
DeathAnim = DYING ;Model condition to play when killed-to-respawn
DeathFX = FX_BoromirDieToRespawn ;FXList to play when killed-to-respawn
DeathAnimationTime = 4966 ;1133 ;How long DeathAnim will take.
InitialSpawnFX = FX_BoromirInitialSpawn
RespawnAnim = LEVELED ;Animation to play when respawning.
RespawnFX = FX_BoromirRespawn ;FXList to play when respawning.
RespawnAnimationTime = 2000 ;Time it takes for respawn to play.
AutoRespawnAtObjectFilter = NONE +CASTLE_KEEP ;Respawn at this location -- and at it's exit production point if possible.
ButtonImage = HIElrond

;RespawnEntries determine the ruleset for how a character can be revived. Some units may automatically respawn, others
;may require a specific revive action performed on him. You can specify different values for each level... or use Level:Any
RespawnRules = AutoSpawn:No Cost:500 Time:90000 Health:100% ;DEFAULT VALUES
RespawnEntry = Level:2 Cost:600 Time:90000 ;For other levels, only override what is different.
RespawnEntry = Level:3 Cost:700 Time:90000
RespawnEntry = Level:4 Cost:800 Time:90000
RespawnEntry = Level:5 Cost:900 Time:120000
RespawnEntry = Level:6 Cost:1000 Time:120000
RespawnEntry = Level:7 Cost:1100 Time:120000
RespawnEntry = Level:8 Cost:1200 Time:120000
RespawnEntry = Level:9 Cost:1300 Time:120000
RespawnEntry = Level:10 Cost:1600 Time:120000
End

Behavior = AutoHealBehavior ModuleTag_BoromirHealing
StartsActive = Yes
HealingAmount = HERO_HEAL_AMOUNT
HealingDelay = 1000
StartHealingDelay = HERO_HEAL_DELAY
HealOnlyIfNotInCombat = Yes
End


Внимание!
Вставляем между строками:

; *** ENGINEERING Parameters ***
RadarPriority = UNIT
KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE ARMY_SUMMARY HERO
PathfindDiameter = 40.0

Body = ActiveBody ModuleTag_02
MaxHealth = ELROND_HEALTH ;BALANCE Man at Arms Health
MaxHealthDamaged = 5
RecoveryTime = 5000
End


и

Behavior = AIUpdateInterface ModuleTag_03
AutoAcquireEnemiesWhenIdle = Yes ATTACK_BUILDINGS
MoodAttackCheckRate = 500
End

Behavior = EmotionTrackerUpdate Module_EmotionTracker
TauntAndPointDistance = 250 ; max distance to taunted/pointed objet
TauntAndPointUpdateDelay = 1000 ; how often scan (milliseconds)

AddEmotion = Alert_Base
End

Вот и всё! Элронд готов. Нанимается в цитадели Гондора. Стоит он 3000.
Tutorial by Akrahil. Копировать запрещено!



Оценить:
Просмотров: 2915 | Комментарии: 7 | Рейтинг: 4.2/10
Категория: Коддинг | Добавил: Akrahil (06.08.2012)
ПОХОЖИЕ МАТЕРИАЛЫ

Всего комментариев: 7
avatar
0
7 SauronGreat • 20:37, 06.08.2014
Странно, не сталкивался с таким видом ошибок. Можете бросить иник Элронда, модифицированный, конечно?
avatar
6 klushtane • 00:56, 05.08.2014
radikal.ru/fp/1b9b067bfb80422ca6f4e2012a8ee18a

посмотрите скрин у меня вот такое выскакивает(((
avatar
5 321Nazgul123 • 19:20, 28.11.2013
А куда между строками вставлять?
avatar
4 Akrahil • 12:54, 27.07.2013
Тутор отредактирован (давно, ага), всё пашет теперь.
avatar
3 abrupt • 23:18, 19.02.2013
Такая же проблема как у Marklaren. Из лука не стреляет, часть кода про воскрешение пришлось убрать ибо ошибка вылетала "unknown param body" вроде того.
И еще вопрос есть как добавить его или другого героя в кампанию??
avatar
2 Akrahil • 17:46, 20.12.2012
Не может быть. Я тут всё прописал: и лук и воскрешалку.
avatar
1 Marklaren • 18:22, 09.11.2012
В целом получилось, но не стреляет с лука. И не получается воскрешать его. А так не плохо. 
avatar