Page 1 of 3 123 LastLast
Results 1 to 20 of 49

Thread: Hero Abilities

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    ackrite26's Avatar Miles
    Join Date
    Oct 2009
    Location
    England - South West
    Posts
    330

    Default Hero Abilities

    Tutorial - Hero Abilities

    This Tutorial is for M2TW Kingdoms

    Files needed

    descr_hero_abilities.xml
    expanded.txt
    descr_strat.txt
    campaign_script.txt
    battlepage_04.tga

    First you need to open descr_hero_abilities.xml it should automatically open in Internet Explorer- this file contains the code for Hero abilities. The code looks like this (you can edit the code by going to File - Edit with XML Editor) - The red text is the explanation for the corresponding text below, the blue are the values that can be used.

    Code:
                    <hero_ability>
                            Hero Ability Name
                            <name>Sample_Ability</name>
         Duration in seconds, 0 means instant
                            <duration>30</duration>
                            Number of times the ability can be used, defaults to 1 if not specified
                            <activations>5</activations>
                            Cooldown in seconds for abilities with more than 1 activation
                            <cooldown>60</cooldown>
                            Tooltip labels from expanded.txt - These are the Hero ability title and description
                            <normal_tooltip_label>EMT_HERO_SPECIAL_ABILITY_DEFAULT_NORMAL</normal_tooltip_label>
                            <selected_tooltip_label>EMT_HERO_SPECIAL_ABILITY_DEFAULT_SELECTED</selected_tooltip_label>
                            <disabled_tooltip_label>EMT_HERO_SPECIAL_ABILITY_DEFAULT_DISABLED</disabled_tooltip_label>
                             Sprites from battle.sd - Hero Powers Button Image from the Generals 
                            <normal_sprite>SCHILTROM_BUTTON_IMAGE</normal_sprite>
                            <selected_sprite>SCHILTROM_BUTTON_IMAGE_SELECTED</selected_sprite>
                            <disabled_sprite>SCHILTROM_BUTTON_IMAGE_DISABLED</disabled_sprite>
                            Sound effect played when ability begins
                            <sound_effect>DEPLOY_STAKES</sound_effect>
                            Effects that can be used for the hero ability:
                            Possible Values: lock_morale, rally_units, army_morale, army_fatigue, soldier_combat_effectiveness, unit_infighting
                            <hero_ability_effects>
                                    <hero_ability_effect>
                                            lock_morale: target units' morale will not change (does not affect routing units, units with higher morale will lock at that level instead)
                                            <name>lock_morale</name>
                                            Armies that will be affected by the effect;
                                            Possible Values: enemy_armies, own_army, allied_armies
                                            <target>own_army</target>
                                            Level that the morale will be locked at;
                                            Possible Values: impetuous, high, firm, shaken, wavering
                                            <morale_level>high</morale_level>
                                    </hero_ability_effect>
                                    <hero_ability_effect>
                                            rally_units: rallies all routing units at the specified level of morale
                                            <name>rally_units</name>
                                            <target>own_army</target>
                                            Level to which the morale will be set after rallying
                                            Possible Values: impetuous, high, firm, shaken, wavering
                                            <morale_level>firm</morale_level>
                                            Minimum time before the unit will rout again
                                            <min_time_before_rout>20</min_time_before_rout>
                                    </hero_ability_effect>
                                    <hero_ability_effect>
                                            army_morale: increases/decreases the morale of target units
                                            <name>army_morale</name>
                                            <target>enemy_armies</target>
                                            positive values increase morale, negative decrease
                                            <morale_modifier>-5</morale_modifier>
                                    </hero_ability_effect>
                                    <hero_ability_effect>
                                            army_fatigue: increases/decreases the fatigue of target units
                                            <name>army_fatigue</name>
                                            <target>own_army</target>
                                            negative values decrease fatigue, positive increase
                                            <fatigue_modifier>-2000</fatigue_modifier>
                                            Whether the fatigue boost is permanent, or will revert to what it was once the effect finishes
                                            Possible Values: true, false
                                            <permanent>false</permanent>
                                    </hero_ability_effect>
                                    <hero_ability_effect>
                                            soldier_combat_effectiveness: increases/decreases the combat effectiveness of target units
                                            <name>soldier_combat_effectiveness</name>
                                            <target>own_army</target>
                                            kill_chance_modifier: whether target units attack is increased/decreased: 0 = no chance to kill, < 1 = decreased chance, 1 = normal chance, > 1 = increased chance
                                            <kill_chance_modifier>2</kill_chance_modifier>
                                    </hero_ability_effect>
                                    <hero_ability_effect>
                                            unit_infighting: has a percentage chance to cause the target units to become inactive for a time
                                            <name>unit_infighting</name>
                                            <target>enemy_armies</target>
                                            The percentage chance per unit
                                            <percentage_chance>50</percentage_chance>
                                            The minimum time effected units will remain inactive for
                                            <min_effect_time>10</min_effect_time>
                                            The maximum time effected units will remain inactive for
                                            <max_effect_time>20</max_effect_time>
                                    </hero_ability_effect>    
                            </hero_ability_effects>
                    </hero_ability>
    Following on from this we will have a look at Richards Lion Heart ability.

    Code:
                    <hero_ability>    
                            Name
                            <name>The_Heart_of_the_Lion</name>
                            Duration
                            <duration>0</duration>
                            Text descriptions
                            <normal_tooltip_label>EMT_THE_HEART_OF_THE_LION_NORMAL</normal_tooltip_label>
                            <disabled_tooltip_label>EMT_THE_HEART_OF_THE_LION_DISABLED</disabled_tooltip_label>
                            Ability Button Image
                            <normal_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE</normal_sprite>
                            <selected_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE_SELECTED</selected_sprite>
                            <disabled_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE</disabled_sprite>
                            Ability sound effect
                            <sound_effect>The_Heart_Of_The_Lion</sound_effect>
                            Ability effect
                            <hero_ability_effects>
                                    <hero_ability_effect>
                                            <name>rally_units</name>
                                            <target>own_army</target>
                                            <morale_level>firm</morale_level>
                                            <min_time_before_rout>15</min_time_before_rout>
                                    </hero_ability_effect>
                            </hero_ability_effects>
                    </hero_ability>
    It is quite easy to see that this ability is a morale boost for your own army.

    And so.......to make our own

    Code:
                    <hero_ability>    
                            <name>Ackrite_Almighty</name>
                            <duration>5</duration>
                            <normal_tooltip_label>EMT_ACKRITE_ALMIGHTY_NORMAL</normal_tooltip_label>
                            <normal_tooltip_label>EMT_ACKRITE_ALMIGHTY_SELECTED</normal_tooltip_label>
                            <disabled_tooltip_label>EMT_ACKRITE_ALMIGHTY_DISABLED</disabled_tooltip_label>
                            <normal_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE</normal_sprite>
                            <selected_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE_SELECTED</selected_sprite>
                            <disabled_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE</disabled_sprite>
                            <sound_effect>guglor_starlia</sound_effect>
                            <hero_ability_effects>
                                    <hero_ability_effect>
                                            <name>soldier_combat_effectiveness</name>
                                            <target>own_army</target>
                                            <kill_chance_modifier>firm</kill_chance_modifier>
                                            <min_time_before_rout>15</min_time_before_rout>
                                    </hero_ability_effect>
                            </hero_ability_effects>
                    </hero_ability>
    This ability will increase the combat effectiveness of your own troops.
    You can add more than one effect to a single ability.

    *

    The next file we need is expanded.txt - this file holds all the text and descriptions for your Hero ability.
    You will need to add the following text -

    Code:
    {EMT_HERO_SPECIAL_ABILITY_DEFAULT_NORMAL} Hero Ability Description
    {EMT_HERO_SPECIAL_ABILITY_DEFAULT_SELECTED} Hero Ability Title
    {EMT_HERO_SPECIAL_ABILITY_DEFAULT_DISABLED} Hero Ability Description
    So, for the ability above 'Ackrite_Almighty' you will need to add the text
    Code:
    {EMT_ACKRITE_ALMIGHTY_NORMAL}Ackrite Almighty (increases target units combat effectiveness)
    {EMT_ACKRITE_ALMIGHTY_SELECTED}Ackrite Almighty
    {EMT_ACKRITE_ALMIGHTY_DISABLED}Ackrite Almighty (increases target units combat effectiveness)
    *

    And finally to add the ability to a General you will need descr_strat.txt or campaign_script.txt - below is the code for a starting general in descr_strat.txt (Saladin) the part in red is the code needed for the Hero ability

    Code:
                    character Saladin, named character, male, leader, age 36, x 59, y 7, portrait saladin, battle_model Sultan_Saladin, hero_ability Righteousness_of_Faith   ;Cairo
                            traits Factionleader 1 , StrategyChivalry 2 , BattleChivalry 2 , Intelligent 2 , ReligionStarter 1 , AssassinMaster 2 , SpyMaster 2 , JihadHistory 2 , IslamHero 1 , GoodDiplomacy 2 , PoliticsSkill 3 , GoodCommander 4 , GoodAmbusher 2
                            army
                            unit  Sultan_Saladin    exp 3 armour 0 weapon_lvl 0
    and here is the code for a spawned general (Richard) in campaign_script.txt the part in red is the code needed for the Hero ability

    Code:
                    spawn_army 
                            faction jerusalem
                            character Richard, named character, age 33, x 91, y 49, portrait richard, battle_model Norman_King, hero_ability The_Heart_of_the_Lion, direction E
                            traits GoodCommander 2 , BattleChivalry 3 , StrategyChivalry 2 , PublicFaith 1 , Loyal 2 , ContentGeneral 3, Lionheart 1 , ChristianHero 1 , ReligionStarter 1 , LoyaltyStarter 1 , CrusaderHistory 2
                            unit  Richard the Lionheart   exp 9 armour 0 weapon_lvl 0
                    end
    and so....to add the 'Ackrite Almighty' ability to a general it would look like this
    Code:
                    character Saladin, named character, male, leader, age 36, x 59, y 7, portrait saladin, battle_model Sultan_Saladin, hero_ability Ackrite_Almighty   ;Cairo
                            traits Factionleader 1 , StrategyChivalry 2 , BattleChivalry 2 , Intelligent 2 , ReligionStarter 1 , AssassinMaster 2 , SpyMaster 2 , JihadHistory 2 , IslamHero 1 , GoodDiplomacy 2 , PoliticsSkill 3 , GoodCommander 4 , GoodAmbusher 2
                            army
                            unit  Sultan_Saladin    exp 3 armour 0 weapon_lvl 0

    Last of all if you are using a mod you will have to add the Hero Ability Button icons into the Culture file locations. The file needed is battlepage_04.tga
    example: SEGA\Medieval II Total War\mods\*Your Mod*\data\ui\southern_european\interface

    That all folks
    Last edited by ackrite26; March 21, 2010 at 03:54 PM.
    ......................................................................................
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

  2. #2

    Default Re: Hero Abilities

    Nice one. +rep
    But u also might want to tell the newbies that how they would incorporate the hero ab-icons in the battlepage_04.tga battle.sd.xml file.

  3. #3
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Hero Abilities

    +rep


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  4. #4
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Hero Abilities

    To get the sounds effects to play when the hero ability button is pushed in battle, do the following steps. Please make a back up of any files changed before editing. You will need the released sound files from CA in your mod folder for this to work and have all the sound files recreated. You can find them here - http://www.twcenter.net/forums/showthread.php?t=74106

    Take a look at this thread to learn how to extract the sound files from the Crusades Campaign.

    http://www.twcenter.net/forums/showthread.php?t=365755 by Ishan

    1) Follow the steps about the SFX extractor. But you will look in data\sounds\SFX\interface\battlemap for the hero ability sound files, they are -
    Hero_Byzantine_Politics.wav
    Hero_Flower_Of_Chivalry.wav
    Hero_Light_Of_The_Faith.wav
    Hero_Righteousness_Of_Faith.wav
    Hero_The_Heart_Of_The_Lion.wav

    2) Now paste these 5 files in your mods\your_mod\data\sounds\SFX\interface\battlemap folder.

    3) Open descr_sounds_generic.txt and look for the "INTERFACE" entry, do a search for it.

    Spoiler Alert, click show to read: 
    Code:
    ;;;;;;;;;;;; INTERFACE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
    
    DEFAULT: 1d volume -10 priority 250 fadein 0 fadeout 0
    DEFAULT: randomdelay 0 rndvolume 0 pan .5
    DEFAULT: dry_level 1 wet_level 1 delay 0 minpitch 1.0 maxpitch 1.0
    DEFAULT: pref INTERFACE
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;   PRISONER EXECUTIONS
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    Under "DEFAULT: pref INTERFACE" add the following for Hero Abilities, It should look like this now -


    Spoiler Alert, click show to read: 
    Code:
    ;;;;;;;;;;;; INTERFACE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
    
    DEFAULT: 1d volume -10 priority 250 fadein 0 fadeout 0
    DEFAULT: randomdelay 0 rndvolume 0 pan .5
    DEFAULT: dry_level 1 wet_level 1 delay 0 minpitch 1.0 maxpitch 1.0
    DEFAULT: pref INTERFACE
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; HERO ABILITIES
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    event The_Heart_of_the_Lion volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_The_Heart_Of_The_Lion
    	
    end
    
    event Righteousness_of_Faith volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Righteousness_Of_Faith
    	
    end
    
    event Light_of_the_Faith volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Light_Of_The_Faith
    	
    end
    
    event The_Flower_of_Chivalry volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Flower_Of_Chivalry
    	
    end
    
    event Byzantine_Politics volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Byzantine_Politics
    	
    end
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;   PRISONER EXECUTIONS
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    The descr_sounds_generic.txt file might be read-only. Right click on the file, under properties - un-check read-only and Apply and save. Now you will be able to edit/save the text file.

    4) Now is delete the events.dat, events.idx, SFX.dat, SFX.idx, voice.dat, and voice.idx files from the sounds folder of your mod. Launch your mod so that the files will be re-generated, saving your changes you have made.

    Hope you find this useful, If you need help w/ the Hero Ability Buttons showing-up in the battle UI, let me know.

    Vegas_Bear

  5. #5

    Default Re: Hero Abilities

    Hm, it doesn't work. =/

    My entries:

    descr_hero_abilities.xml:

    Code:
    <hero_ability>    
    			<name>The_Heart_of_the_Lion</name>
    			<duration>0</duration>
    			<normal_tooltip_label>EMT_THE_HEART_OF_THE_LION_NORMAL<normal_tooltip_label>
    			<disabled_tooltip_label>EMT_THE_HEART_OF_THE_LION_DISABLED<disabled_tooltip_label>
    			<normal_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE<normal_sprite>
    			<selected_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE_SELECTED<selected_sprite>
    			<disabled_sprite>HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE<disabled_sprite>
    			<sound_effect>The_Heart_Of_The_Lion</sound_effect>
    			<hero_ability_effects>
    				<hero_ability_effect>
    					<name>rally_units</name>
    					<target>own_army</target>
    					<morale_level>firm</morale_level>
    					<min_time_before_rout>15</min_time_before_rout>
    				</hero_ability_effect>
    			</hero_ability_effects>
    		</hero_ability>
    descr_sounds_generic:

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;; INTERFACE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
    
    DEFAULT: 1d volume -10 priority 250 fadein 0 fadeout 0
    DEFAULT: randomdelay 0 rndvolume 0 pan .5
    DEFAULT: dry_level 1 wet_level 1 delay 0 minpitch 1.0 maxpitch 1.0
    DEFAULT: pref INTERFACE
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; HERO ABILITIES
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    event The_Heart_of_the_Lion volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_The_Heart_Of_The_Lion
    	
    end
    
    event Righteousness_of_Faith volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Righteousness_Of_Faith
    	
    end
    
    event Light_of_the_Faith volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Light_Of_The_Faith
    	
    end
    
    event The_Flower_of_Chivalry volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Flower_Of_Chivalry
    	
    end
    
    event Byzantine_Politics volume -20 priority 200 
    	folder data/sounds/SFX/interface/battlemap
    	Hero_Byzantine_Politics
    	
    end


    All soundfiles are at SFX/interface/battlemap and I deleted the.idx and .dat files.



    I use Third Age, but I think that doesn't matter.

  6. #6
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Hero Abilities

    For the UI to properly show up, you need to have the battle.sd.xml and battle.sd files. You can get the battle.sd file by unpacking it from the Crusades Campaign. You will need to find a battle.sd.xml file from the forums, several mods have them. I took mine from Bare Kingdoms.

    Please make a back-up before editing any files.

    First step is to open the battle.sd.xml w/ notepad, right click on the file and select Open with. Then navigate to notepad so we can edit the file.

    Okay once we have the file open, at the top you should see something like this -

    Spoiler Alert, click show to read: 
    Code:
    		<texture_pages count="5">
    			<page file="battlepage_01.tga" width="512" height="512" force32bit="0"/>
    			<page file="battlepage_02.tga" width="256" height="256" force32bit="0"/>
    			<page file="battlepage_03.tga" width="141" height="143" force32bit="0"/>
    			<page file="editor_battle01.tga" width="256" height="256" force32bit="0"/>
    			<page file="battlepage_04.tga" width="141" height="143" force32bit="0"/>
    		</texture_pages>


    This section refers to the pages it will be getting the information from. The first page is counted as zero. The hero abilities are on battlepage_04.tga, page #4.

    Next you will see this line of code -

    Spoiler Alert, click show to read: 
    Code:
    		<sprites count="148">


    This refers to the number of entries below. We are going to add all the entries for the Hero Abilities, there are 15 in total. So we need to change the 148 to 163.

    Now go to the bottom of the page. Below the entry for "SUPPORT_ARMY_SHOOTOUT_ICON" and above the entry for </sprites> we are going to insert the code for the Hero Abilities. Add the following text.

    Spoiler Alert, click show to read: 
    Code:
    			<sprite index="149" name="HERO_ABILITY_BANANA_BUTTON_IMAGE" page="4" left="0" right="34" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="150" name="HERO_ABILITY_BANANA_BUTTON_IMAGE_DISABLED" page="4" left="35" right="69" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="151" name="HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE" page="4" left="105" right="139" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="152" name="HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE_DISABLED" page="4" left="105" right="139" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="153" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE" page="4" left="70" right="104" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="154" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE_SELECTED" page="4" left="105" right="139" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="155" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE_DISABLED" page="4" left="70" right="104" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="156" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE" page="4" left="35" right="69" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="157" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE_SELECTED" page="4" left="105" right="139" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="158" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE_DISABLED" page="4" left="35" right="69" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="159" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE" page="4" left="70" right="104" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="160" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE_SELECTED" page="4" left="35" right="69" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="161" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE_DISABLED" page="4" left="70" right="104" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="162" name="HERO_ABILITY_BYZANTINE_POLITICS_BUTTON_IMAGE" page="4" left="0" right="34" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="163" name="HERO_ABILITY_BYZANTINE_POLITICS_BUTTON_IMAGE_DISABLED" page="4" left="0" right="34" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>


    It should now look like this -

    Spoiler Alert, click show to read: 
    Code:
    			<sprite index="147" name="SUPPORT_ARMY_SHOOTOUT_ICON" page="0" left="463" right="473" top="483" bottom="493" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="149" name="HERO_ABILITY_BANANA_BUTTON_IMAGE" page="4" left="0" right="34" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="150" name="HERO_ABILITY_BANANA_BUTTON_IMAGE_DISABLED" page="4" left="35" right="69" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="151" name="HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE" page="4" left="105" right="139" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="152" name="HERO_ABILITY_THE_HEART_OF_THE_LION_BUTTON_IMAGE_DISABLED" page="4" left="105" right="139" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="153" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE" page="4" left="70" right="104" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="154" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE_SELECTED" page="4" left="105" right="139" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="155" name="HERO_ABILITY_RIGHTEOUSNESS_OF_FAITH_BUTTON_IMAGE_DISABLED" page="4" left="70" right="104" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="156" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE" page="4" left="35" right="69" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="157" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE_SELECTED" page="4" left="105" right="139" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="158" name="HERO_ABILITY_LIGHT_OF_THE_FAITH_BUTTON_IMAGE_DISABLED" page="4" left="35" right="69" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="159" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE" page="4" left="70" right="104" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="160" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE_SELECTED" page="4" left="35" right="69" top="0" bottom="34" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="161" name="HERO_ABILITY_THE_FLOWER_OF_CHIVALRY_BUTTON_IMAGE_DISABLED" page="4" left="70" right="104" top="36" bottom="70" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="162" name="HERO_ABILITY_BYZANTINE_POLITICS_BUTTON_IMAGE" page="4" left="0" right="34" top="72" bottom="106" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    			<sprite index="163" name="HERO_ABILITY_BYZANTINE_POLITICS_BUTTON_IMAGE_DISABLED" page="4" left="0" right="34" top="108" bottom="142" x_offset="0" y_offset="0" alpha="1" cursor="0"/>
    		</sprites>
    	</root>


    Save the file and you are done. Have fun w/ your new Hero Abilities.

    Vegas_Bear

  7. #7

    Default Re: Hero Abilities

    Pretty cool, finally got around to doing this. It only works for starting Generals right? Theres no way to script it to someone later in the game? (without spawning)

  8. #8

    Default Re: Hero Abilities

    That's right starting ones or generals that you have scripted for mid-game that is spawned.

  9. #9
    Polycarpe's Avatar Back into action!
    Join Date
    Feb 2010
    Location
    Quebec, Canada
    Posts
    3,338

    Default Re: Hero Abilities

    So for example, you do two special abilities, one is an increase of attack for your units and one is to increase defense. So you could script that, when a new FM is become an adult, you could generate random special abilities by using these examples?

  10. #10

    Default Re: Hero Abilities

    I think the only way to give hero powers is for starting characters in descr_strat or spawned generals in campaign_script. It would be awesome if you could do it with traits.

    I made a custom ability that reduces enemies morale by 60 just for fun, my FL single handedly took over all of Europe.

  11. #11

    Default Re: Hero Abilities

    Quote Originally Posted by Tyre View Post
    I think the only way to give hero powers is for starting characters in descr_strat or spawned generals in campaign_script.
    Aye.

  12. #12

    Default Re: Hero Abilities

    some questions...

    1.
    a.
    does the order in which multiple effects are typed,also change the order in which these effects are applied ???
    b. is there a certain latency between diffirent effects or do they all kick in silmutaneously ? i mean..are they contemporaneous or one after another ? their relative duration ?
    c. and if so can the target also be different?
    d. what would the effects "range" be ? i mean..do all effects have the same distance-range ? and if yes what is it ? the general's unit ? the whole regiment ?

    for example..could it be possible to make a "taunting" ability that first rallies enemy units onto own unit and then increases own soldier-effectiveness ? kinna like luring them into getting their a.. kicked ? (just an example..in order to understand the a/b/c/d questions )

    2.
    a. can custom sounds and pictures be used as fx and button ?
    b. if yes..could you please specify what formats and sizes are "acceptable" ?
    (for example..mp3 for fx ? jpeg for images ? ok i found the tut for sfx but not for the button's image..how do you make a custom image fit the round button ? it does on its own or do you have to make it yourself ?)

    always on the previous example..lets say i want to implement a frase from a movie or a foto for button,,,can it be done? formats and max sizes permitted ???

    3. unit_infighting ability..
    a.
    could someone please explain how does that apply ??? opening the descr_hero_abilities.xml i saw that it stands for a certain % of unit going inactive..
    -how can this be applied on enemy units ?
    does it pick a random one ? or does it apply on the mostly near etc...or the whole army ?

    so beeing it a % chance it could ,anyway vary ,from 0 to 100 ? cuase the generic text in the beginning of the file just assigns a 50 value..

    4. could someone please list the min to max values for all effects ? and specify the max number of total abilities in game? (with one or more effects..)

    thank you in advance...
    Last edited by Noobio; April 23, 2011 at 08:51 AM.

  13. #13

    Default Re: Hero Abilities

    excuse the double posting..but noone seems to reply..could you please take a look at the post directly above this one ?

    and nother thing..

    ..after reading carefully the descr_hero_abilities.xml for the 3d age mod... another question..

    if lock_morale values vary from

    impetuous > high > firm > shaken > wavering (beeing 5 in total..so i suppose the +/- 5 value in army_morale would be those..
    the witchking having a -6 against enemy_armies would be routing ? or is it just a random value?? could it be -10 too? and the other way around.. what would giving him a + 10 for own_army would do ?)

    what i'm trying to ask ,is what would the max-min values for every effect be ??


    i
    n the descr_heroes_abilities file,in the begining ,lets say at the generic descriptions, there are some given values..are they prefixed ?
    how do they vary ?

    for example, regardin soldier_combat_effectiveness and its kill chance modifier
    the generic text says that 0= none <1 =decreased and >1 increased ..so i guess that a possible value could be 0.5 or 0.8..
    in 3d age i saw a -3 kill chance modifier..what's the sense in that if 0 is already none ???
    and what would the max + be ? 2 ? 3 ? 100000 ??? ) ..

    ps..in this tutorial's opening post,in the example as kill-chance_modifier is used the <firm> value ..what's that supposed to be ?
    i believ he mistaked it for "lock_morale" effect..

    army_fatigue ? what numeric values corrispond to the terms..fresh-eager-warmed up-tired-exhausted etc if i skipped any ?
    Last edited by Noobio; April 23, 2011 at 09:20 AM.

  14. #14
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Hero Abilities

    1) There is no order that they are applied. As soon as you hit the Hero button the effects take place and last for the specified time length. The ability is applied to the whole army, regardless of distance from the General.

    2) The sound files are Wave Sounds in the audio format of PCM. I don't think there is to big of a difference of size. Stock sounds range from 506KB to 1.17MB.
    You can add custom pictures to the battlepage_04.tga. You have to change the image yourself. The size has to be that of the circle.

    3)
    Spoiler Alert, click show to read: 
    Code:
    <hero_ability_effect>
    <!-- unit_infighting: has a percentage chance to cause the target units to become inactive for a time -->
              <name>unit_infighting</name>
    	<target>enemy_armies</target> Specifies for ability to act upon the enemy.
    	<!-- Percentage chance per unit -->
    	<percentage_chance>50</percentage_chance>This means each unit has a 50% chance of being effected
    	<!-- Minimum time effected units will remain inactive for -->
    	<min_effect_time>10</min_effect_time>Not sure if this is seconds, or doubled.
    	<!-- Maximum time effected units will remain inactive for -->
    	<max_effect_time>20</max_effect_time>
    </hero_ability_effect>


    4) If you create your own interface page, there probably is no limit to the different hero abilities you can have. The game has six listed, I saw another mod that had two more abilities added. The super banana pictures were replaced by a cross and banner.

    Reference your second post, I don't have TATW installed. So I can't answer that question. For the max/min values, I would change them a bit and do some testing in custom battles. Use the same units in every test so you have a known factor there.

    Hope this helps a little,

    Vegas_Bear

  15. #15

    Default Re: Hero Abilities

    this does help a bit...one thing at a time maybe i'll finally get a hold of this... so

    1....should i convert all my custom sfx samples from mp3 to wav then ??? (and also hz / bits / mono or stereo ??? as converters have various values..)
    a....cause in various tutorials (and files i managed to open) were all in mp3..
    b....an idx extractor that goes around in these tutorials doesn't seem to work for me (vercincedorix's or something like that) the bat. just opens the sfx file(s) and the exe. doesn't re-"close" em (while others mostly complained that it opened the voice and music ones but not the sfx..(??) anyway, i found a relative thread on "idx extarctor not working" but since it's anyway old,do you know if there's another ,newer freeware around ?

    2....image files in what format ? jpeg ,png etc ???

    3....what does "create my own interface page" mean ?

    ps..(4....regarding the 3d_age example..it was just an example..the descr_heroes_file was like the one in the topic's opening post's ..

    a...i just used it as an example for my "doubts" on the values ..in particular the army_morale one..if in lock_morale the values are impetuous >...>wavering
    (5 total values) then maybe the values of the morale-modifier in army_morale could span from (+)5 to -6 (6 being , routing , excluded by default in the lock_morale effect

    b....the kill-chance-modifier ,in soldier_combat_effectiveness sounds wierd though..as i wrote in my previous post..the file gives some "generic instructions"
    0_none ... under 1_decrease ... over 1_increase ... so maybe it should span from 0_none to 1_normal to infinite?_increasing (?)

    c....regarding the army_fatigue..units ingame manifest certain values..fresh - eager -warmed up -tired -exhausted ,even though i can't remember them all and in the exact order..if the files "generic instructions" give a -2000 value for "boosting" how does this translate on "ingame terms" ? would it be ,the necessary value ,in order to boost a lets say wasted unit to completely rested-capable ?

    and the permanent true/false entry ? the "generic instructions" talk about keepin the boost after the effect's end.. so
    - if "false" they will regress to the pre-effecte fatigue ?
    -if "true" they will stay like that all the way till the end ? or will they start "re-fatiguing" from the new level ?)

    are there any released refference files on all of these ? kinna like in docudemons for example ?
    Last edited by Noobio; April 24, 2011 at 05:40 AM.

  16. #16
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: Hero Abilities

    1) In post #4 I believe is the link to the tutorial about extracting the sounds files, by Ishan. I used this to get my sound files. They are in .WAV format.

    2) .tga

    3) Look at these

    http://www.twcenter.net/forums/showt...ight=interface

    http://www.twcenter.net/forums/downl...o=file&id=1248 <<<Alpaca's Editor

    For the rest of the entries, try playing the Crusader Campaign and give the hero abilities to starting generals of your faction. See how the stock abilities play out. Then if you change them, you will already have a baseline from the original one.

    army_fatigue - <permanent>false</permanent> - will revert to what it was once the effect finishes, never tried true. I wouldn't want it to last till the end of the battle, not realistic.

  17. #17

    Default Re: Hero Abilities

    could someone please upload the descr_hero_abilites.xml from crusades (if someone has allready unpacked it) ??? i guess linking the url would be ok too!

  18. #18
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Hero Abilities

    Unpack Crusades, again, and you will have it. Uploading unmodded files is a no-no. Be sure to back up before editing the next one.

  19. #19
    Moon's Avatar Centenarius
    Join Date
    Oct 2008
    Location
    The dark side
    Posts
    878

    Default Re: Hero Abilities

    @Noobas
    No need to do that, copy the lines below into notepad and save it as xml.bat, put it with the other ones and it will extract all the xmls into a folder named unpack in the main Medieval II Total War folder.
    Code:
    unpacker.exe --source=..\..\mods\crusades\packs\*.pack --destination=..\..\unpack 
    --filter=*.xml --base_pack_path=mods/crusades/data/
    Last edited by Moon; April 27, 2011 at 12:21 PM.

  20. #20

    Default Re: Hero Abilities

    Last edited by Noobio; April 28, 2011 at 09:07 AM.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •