The 3rd Age

Immersive Middle-earth (v. 1.4)

Immersive Middle-earth (v. 1.4)

An attempt to make the original BFME1 more personable

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Modboy451's Article of Code-Snippets

Tutorial for Battle for Middle-earth II: Rise of the Witch-king ROTWK

Avatar of modboy451

modboy451

Category: Code
Level: Beginner
Created: Monday February 14, 2011 - 8:52
Updated: Monday November 14, 2011 - 17:40
Views: 4810
Summary: a bunch of little code behaviors and lines that come in handy once and a while

Rating

Staff says

-

Members say

4.0

Average

4.0/5.0

1 vote

Page 1 2 3 4
have you every tried to make a hero out of a normal unit
ex: black orc, noldor warrior, gondor soldier.

Jump down to the quote tag to see how to fix two audio respawn voice's at the same time! (it's not 2 far down!)
-
i was trying to out of some of them but when i created the hero i found that when i tried him out he the dialog box wouldn't come up that said: " 'your hero' has arrived" ('your hero' being the name of your hero)
when anylising legolas.ini and seeing what my hero file didnt have that legolas did and i found this:

              
Code

Behavior = RespawnUpdate ModuleTag_RespawnUpdate
        DeathAnim = DYING                ;Model condition to play when killed-to-respawn
        DeathFX            = FX_LegolasDieToRespawn    ;FXList to play when killed-to-respawn
        DeathAnimationTime        = 3000                ;How long DeathAnim will take.
        InitialSpawnFX    = FX_LegolasInitialSpawn
        RespawnAnim        = LEVELED                ;Animation to play when respawning.
        RespawnFX        = FX_LegolasRespawn        ;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                = HILegolas_res
        
        ;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:2250        Time:60000        Health:100%        ;DEFAULT VALUES
    End



it was the respawn update for legolas!

I added that to my hero made changes accordingly (to the cost and time at the bottom and the button image [the button image is the image when he dies, the respawn button {usually blue}])

i tested him in game and the dialog box came when he spawned!
but......
when he spawned I heard Legolas saying his respawn voice... so this is what you can do
              
Quote

this is where we find out on how to fix two audio respawn voices!


              
Code

DeathFX        = FX_LegolasDieToRespawn ;FXList to play when killed-to-respawn
    InitialSpawnFX    = FX_LegolasInitialSpawn
    RespawnFX    = FX_LegolasRespawn        ;FXList to play when respawning.


you can either do:
              
Code

;DeathFX    = FX_LegolasDieToRespawn ;FXList to play when killed-to-respawn
    ;InitialSpawnFX    = FX_LegolasInitialSpawn
    ;RespawnFX    = FX_LegolasRespawn        ;FXList to play when respawning.

see further down for why this works
Or you can change the FXs to something else you can find it in the audio parameters of the hero...
BUT!

this is why the 1st option works
every unit has a FX when it's horde gets created so if you do the second option it will play both at almost the same, but one will play a litle after the one starts to fix that you can find this code:(im using the rivendell lacer as a example

              
Code

; *** AUDIO Parameters ***;

    VoiceAttack                    = ElfLancerVoiceAttack
    VoiceAttackCharge                = ElfLancerVoiceAttackCharge
    VoiceAttackStructure                 = ElfLancerVoiceAttackBuilding
    VoiceAttackMachine             = ElfLancerVoiceAttack
    VoiceCreated                    = ElfLancerVoiceSalute
    VoiceFullyCreated                = ElfLancerVoiceSalute
    VoiceGuard                    = ElfLancerVoiceMove
    VoiceMove                    = ElfLancerVoiceMove
    VoiceMoveToCamp              = ElfLancerVoiceMoveCamp
    VoiceMoveWhileAttacking                = ElfLancerVoiceDisengage
    VoicePriority                 = 19
    VoiceRetreatToCastle                 = ElfLancerVoiceMoveRetreat
    VoiceSelect                    = ElfLancerVoiceSelectMS
    VoiceSelectBattle                = ElfLancerVoiceSelectBattle



And change the code to:

              
Code

; *** AUDIO Parameters ***;

    VoiceAttack                    = ElfLancerVoiceAttack
    VoiceAttackCharge                = ElfLancerVoiceAttackCharge
    VoiceAttackStructure                 = ElfLancerVoiceAttackBuilding
    VoiceAttackMachine             = ElfLancerVoiceAttack
    ;VoiceCreated                    = ElfLancerVoiceSalute
    ;VoiceFullyCreated                = ElfLancerVoiceSalute
    VoiceGuard                    = ElfLancerVoiceMove
    VoiceMove                    = ElfLancerVoiceMove
    VoiceMoveToCamp              = ElfLancerVoiceMoveCamp
    VoiceMoveWhileAttacking                = ElfLancerVoiceDisengage
    VoicePriority                 = 19
    VoiceRetreatToCastle                 = ElfLancerVoiceMoveRetreat
    VoiceSelect                    = ElfLancerVoiceSelectMS
    VoiceSelectBattle                = ElfLancerVoiceSelectBattle


But then when i was playing with him when he died his character just stood there and th death dialog box didnt come up! and i couldent respawn him! TERRIBLE!
but then i discovered this code:
              
Code

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


it was his respawn body (adjust where needed...)
and he died properly!(sounds weird doesn't it
There is also 2 more things you will want to change:

Change:
              
Code

CrowdResponseKey = Elf //this will be whatever the faction it is in(gondor soldier = Men)
    

change it to:
(here are some examples of what you can use(and who you find them with)
              
Code

CrowdResponseKey = ElfHero //Elves
CrowdResponseKey = Uruk //Lurtz, Sharku, Azog
CrowdResponseKey = Goblin //Mouth Of Sauron, Gorkil The Goblin King
CrowdResponseKey = Orc //Gothmog
CrowdResponseKey = EvilMen1 //Saruman
CrowdResponseKey = DwarfHero // Dwarves
CrowdResponseKey = GoodMen // Men
    

this will make it so when he passes by other units will cher for him
this is not necessary but i reccommend it if your making a professional mod

this next step is necessary though:
this will be under engineering parameters
              
Code

    RadarPriority = UNIT
    KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT GRAB_AND_DROP ATTACK_NEEDS_LINE_OF_SIGHT



add
              
Code

HERO


to KinfOf
it will look something like this
              
Code

RadarPriority = UNIT
KindOf = HERO PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT GRAB_AND_DROP ATTACK_NEEDS_LINE_OF_SIGHT


it may not look the same depending on the unit you are using
you will need to add proper string references in the lotr.str file

ex:

              
Code

DisplayName = OBJECT:ElvenMithlondSentry


if this is not changed the dialog box will say "Mithlond Sentry has arrived"
which is pretty lame

Credits

a bunch of people that have told me to add all of my usless little tutorials into one tutorial...

Comments

Display order: Newest first

modboy451 - Monday November 14, 2011 - 17:41

^_^ removed.

Prolong - Sunday May 1, 2011 - 5:56

Nice tips for intermediate coders. :-) You should remove the empty last page of the guide!

Radspakr Wolfbane (Team Chamber Member) - Monday February 14, 2011 - 18:49

The majority of all this is only for BFME2/ROTWK.

modboy451 - Monday February 14, 2011 - 9:21

an article on spell books may be coming soon!

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
2:18:19