Results 1 to 8 of 8

Thread: add AP trait?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default add AP trait?

    Can some1 give me instructions on how to add AP traits to every unit carrying 2 handed swords? thnx

  2. #2

    Default Re: add AP trait?

    Quote Originally Posted by max_minimod View Post
    A little tut how to add units to the mod, step by step.

    Adding units have two aspects that need to be done.
    - First you need to add the unit to the own battle section.
    - Second, to have the unit later in campaign, you also need to add the unit to one building, so it can be recruited in game.
    For now this tut I will only talk about the first.

    A pitfall on adding new units is also, that the number of units a mod can have, is limited: If you go over that number , it will result in a crash and (if you have enabled '-show_err' to your games shortcut) an error message.

    Ok, let's start!
    There are two text files that need to be edited to get new units in game, both are in \data in your mod folder.
    The files are:
    descr_model_battle.txt and export_descr_unit.txt

    The easiest way is you copy and duplicate an unit entry and rename it:

    Let's take the RTW barb. standard bearer and put it into our mod.
    Open the descr_model_battle.txt (in RTW!) and search the barb_standard:
    '
    type barb_standard
    skeleton fs_standard_bearer
    indiv_range 40
    texture gauls, data/models_unit/textures/officer_barb_standard_gaul.tga
    texture britons, data/models_unit/textures/officer_barb_standard_briton.tga
    texture germans, data/models_unit/textures/officer_barb_standard_german.tga
    texture dacia, data/models_unit/textures/officer_barb_standard_dacia.tga
    texture scythia, data/models_unit/textures/officer_barb_standard_scythia.tga
    model_flexi data/models_unit/officer_barb_standard_400.cas, 8
    model_flexi data/models_unit/officer_barb_standard_300.cas, 15
    model_flexi data/models_unit/officer_barb_standard_200.cas, 30
    model_flexi data/models_unit/officer_barb_standard_100.cas, 40
    model_flexi data/models_unit/officer_barb_standard_70.cas, max
    model_sprite 60.0, data/sprites/warband_woad_sprite.spr
    model_sprite britons, 60.0, data/sprites/parthia_east_heavy_cataphract_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5
    '

    We now put this into our mod (which is BI yet, so we have to rename factions and we use our own textures)and rename it:
    '
    type vik_standard
    skeleton fs_standard_bearer
    indiv_range 40
    texture vandals, data/models_unit/textures/unit_vik_standard_carls.tga
    texture romano_british, data/models_unit/textures/unit_vik_standard_mercia.tga
    texture ostrogoths, data/models_unit/textures/unit_vik_standard_mercia.tga
    texture slave, data/models_unit/textures/unit_vik_standard_mercia.tga
    model_flexi data/models_unit/officer_barb_standard_400.cas, 8
    model_flexi data/models_unit/officer_barb_standard_300.cas, 15
    model_flexi data/models_unit/officer_barb_standard_200.cas, 30
    model_flexi data/models_unit/officer_barb_standard_100.cas, 40
    model_flexi data/models_unit/officer_barb_standard_70.cas, max
    model_sprite 60.0, data/sprites/warband_woad_sprite.spr
    model_sprite vandals, 60.0, data/sprites/parthia_east_heavy_cataphract_sprite.spr
    model_tri 400, 0.5f, 0.5f, 0.5
    '

    Make sure you really have already those textures and the faction- and filenames are correct, or it might result in a crash again.

    This should be enought to get our unit into game via the 'officer' slot in export_descr_unit.txt.
    To see that unit in battles you go to one of our units and add that standard bearer to a unit, let's say we add the standard-bearer to the 'costal levys':
    '
    type coastal levies
    dictionary coastal_levies ; Coastal Levies
    category infantry
    class spearmen
    voice_type Light_1
    soldier coastal_levies, 55, 0, 1.3
    officer vik_standard
    attributes sea_faring, hide_forest, can_sap, very_hardy
    formation 1.2, 1.2, 2, 2, 7, square, shield_wall ;
    stat_health 4, 0
    stat_pri 42, 9, no, 0, 0, melee, simple, piercing, spear, 1 ,1
    stat_pri_attr light_spear, spear_bonus_12, ap
    stat_sec 0, 0, no, 0, 0, no, no, no, none, 1 ,1
    stat_sec_attr no
    stat_pri_armour 20, 20, 23, leather
    stat_sec_armour 0, 0, flesh
    stat_heat 5
    stat_ground 1, -2, 3, 2
    stat_mental 15, normal, trained
    stat_charge_dist 60
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 2, 437, 184, 40, 60, 350
    ownership slave, romano_british
    '

    That should do it.
    If you check your costal levys unit in romano-british faction in battle now (not in campaign! only in own battle) there should be a standard bearer in the unit now.

    If this works, you could try to create a unit with our standard bearers (sure its nonsense to have such, but it can demonstrate how to do it).
    Go in export_descr_unit.txt now, copy one unit there and rename it.
    Lets say we copy our costal levys unit and change some parts:
    '
    type coastal levies2
    dictionary coastal_levies ; Coastal Levies
    category infantry
    class spearmen
    voice_type Light_1
    soldier vik_standard, 55, 0, 1.3
    attributes sea_faring, hide_forest, can_sap, very_hardy
    formation 1.2, 1.2, 2, 2, 7, square, shield_wall ;
    stat_health 4, 0
    stat_pri 42, 9, no, 0, 0, melee, simple, piercing, spear, 1 ,1
    stat_pri_attr light_spear, spear_bonus_12, ap
    stat_sec 0, 0, no, 0, 0, no, no, no, none, 1 ,1
    stat_sec_attr no
    stat_pri_armour 20, 20, 23, leather
    stat_sec_armour 0, 0, flesh
    stat_heat 5
    stat_ground 1, -2, 3, 2
    stat_mental 15, normal, trained
    stat_charge_dist 60
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 2, 437, 184, 40, 60, 350
    ownership slave, romano_british
    '

    If you (and I) made no errors you should have a unit with standard bearers now in your own battle when you choose your Romano-british faction.
    Here is more tuts, including how to create a new skin for a unit: http://www.twcenter.net/forums/showt...units+tutorial
    Create a Multiplayer Army Online at: www.shogun2armycreator.netne.net
    Your Unofficial Shogun 2 Tech Support Genius
    Visit my Youtube Channel
    Shogun 2 and Star Wars: The Old Republic Gameplay

    http://www.youtube.com/itsmymillertime

  3. #3

    Default Re: add AP trait?

    i have no idea what that guy's talking about.:hmmm: Not a computer genius.

  4. #4

    Default Re: add AP trait?

    Well, I guess I can translate that to a shorter and probably easier form...

    The first thing that you need is an unpacked \data-folder so you can access the necessary files.
    I can't tell you how to do that, you would have to ask in the modding forums where I think someone will be able to answer that question.

    It is a lot easier though if you are using any mods because these usually come with extracted files from the get-go.
    Let's have a look at it:

    - open your Medieval 2 folder

    -> open the folder of the mod you are using

    -> open that mod's data folder

    -> look for a text file named export_descr_units.txt, copy it someplace else as a backup (just in case something goes wrong) and then open the original

    -> use the search function (ctrl-f in case you don't know it) and search for the name of a 2-handed unit (that's right - you have to look for the names for every single unit that you want to change later on)

    -> when you have found your desired unit, look for the line stat_pri_attr; if there is a no in it, simply replace it with ap
    -> if there is something in that line already (example: bp meaning body piercing) you have to add a comma, a space and then the ap so it looks this way: stat_pri_attr bp, ap
    Just remember to keep the "blocks" of text aligned the way they are from the beginning, that makes it a lot easier to work with it later on.


    Note: You can have a look at the very top part of this text file, there is a complete explanation on what each section of a units text means, what you can put in there and what the effect of that will be.
    Last edited by Tankfriend; April 11, 2008 at 02:54 PM.

  5. #5
    Harry Lime's Avatar Not a ToS violation
    Artifex Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Kent, England
    Posts
    15,771

    Default Re: add AP trait?

    Moved to Mod Workshop > Text editing and scripting
    Proud Patron of derdrakken, dave scarface, J@mes & irishron
    Indulging in the insight & intelligence of imb39

  6. #6

    Default Re: add AP trait?

    is export_descr_units.txt in the imperial_campaign folder? By the way im using vanilla(i dont think that changes anything).

  7. #7

    Default Re: add AP trait?

    No, it's inside the data folder in your M2TW folder.

    To access it:

    - make sure you have installed M2TW version 1.1 or higher (unpacker is included in 1.1)

    - open [your M2TW folder]\tools\unpacker

    - make sure you read the readme if you want to know more about the unpacker

    - make sure you have another ~7GB space left on your hard drive with M2TW on it

    - open unpack_all.bat and wait until it is finished (will take quite a long time, unpacking the huge amount of data)

    - when finished, you can find all the unpacked files added to the data folder in your M2TW main folder; among them the file in question

    In case you need a link to patch 1.1:
    http://www.twcenter.net/forums/showthread.php?t=75019

  8. #8

    Default Re: add AP trait?

    There's another tutorial somewhere, I think, but you have to dig around in this file if you want to mess with units.
    "The dark giant lay sprawled on the sands of Tunis. Far to the north the new champion of the arena lifted his arms in triumph. The galleys passed upon the sea, the soldiers laid down their arms, cities were rebuilt and peace was everywhere welcomed. The supine giant was unconscious, but not dead. Slowly he began to raise himself upon his elbows."
    ~Hannibal, by Ernie Bradford

Posting Permissions

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