Results 1 to 5 of 5

Thread: Unit.txt

  1. #1
    Member Member Baron von Alvincy's Avatar
    Join Date
    Nov 2007
    Location
    Salzburg in Austria
    Posts
    19

    Default Unit.txt

    A little question about the text files from the units:
    When you open textures-men-for instance MSHelm-Arbalester_S.txt, you can see only the number "4".
    What does that mean?


    Thanks

    Baron von Alvincy

  2. #2
    Crusading historian Member cegorach's Avatar
    Join Date
    Aug 2004
    Location
    Poland
    Posts
    2,523

    Default Re: Unit.txt

    _S means it is to define which shield is used by the model. Number means which folder is used in Items folder - in this case number 4.

    _W defines weaponry (if such is defined separately to the main soldier model) in the same way.


    If a model doesn't have a txt file to define its weaponry and shield it will not have such on the battlefiled.

    Sometimes it is not necessary - when the model doesn't use attached weaponry/shield.


    I suggest to check what means what and what is it for - you will quickly realise that you can easily add several weapons/shileds if you need this or different weapons for different actions e.g. a musket for shooting and reloading and a sword for melee.
    In such cases _W file would have more than one number.

    Try to experiment and test the results, but keep backup files in case something goes wrong.

  3. #3
    Second-hand chariot salesman Senior Member macsen rufus's Avatar
    Join Date
    Dec 2004
    Location
    Ratae Corieltauvorum
    Posts
    2,507

    Default Re: Unit.txt

    I'll add a few other notes:

    In each texture sub-directory (eg Textures/Men/MSHelm - we'll stick with your example, as it's a useful one ) you will also see two files called weapons.txt and shields.txt which define the position of the weapons and shields in the Texture.BIF file as x-y coordinates. The shields are defined as top-left, bottom-right co-ordinates; the weapons also have two extra numbers relating to the scaling.

    If you want to add a new shield design to a BIF you can so long as you make sure of a few things:

    1) there must be room for it
    2) it must go in all 12 frames in exactly the same place
    3) its co-ordinates must be added to the shields.txt file as a new line. If you have one shield defined so far, this will make it shield 2 (unusually for MTW the numbering of shields and weapons does actually start at 1 instead of 0 this time)
    4) for a unit to use this new shield you need a file: Textures/Men/MSHelm/newunit_s.txt whose sole content is the number 2
    5) you also need a new subfolder: Textures/Men/Items/Shield2/Newunit - which defines the positioning of the shield for various actions - easiest to copy the files from another unit with the same animation and same size shield

    If, in error, you put your new files in say the Shield1 folder, all that will happen is your units will not display shields in battle. If anything CTDs, it won't be this....

    The big difference between weapons and shields as far as the engine is concerned is how they look. Weapons are defined as one-dimensional, and are defined as a line between two points on the animation (technically known as the "blunt end" and the "pointy end" )

    Shields however are two-dimensional and are defined by four corners. This way you get perspective effects from different angles. This is why CROSSBOWS ARE SHIELDS, not weapons - purely so they can be drawn with perspective, and why pavise crossbows appear to have two shields.

    I really suggest a good read of the "Unit animations" thread for the full story on this, but that should be enough for you to try out some new shields. And, yes, always make back ups
    ANCIENT: TW

    A mod for Medieval:TW (with VI)

    Discussion forum thread

    Download A Game of Thrones Mod v1.4

  4. #4

    Default Re: Unit.txt

    It's easy really when you get used to it, just gets confusing navigating all of the folder and trying to remember where you've put everything and whether you've already done something or not.

    Then your Byzantine Psiloi come running out into battle holding their swords by the points and you realise that you might have made just a little error somewhere...



    Edit: The one thing I wanted to do was have cavalry that charged with lanced and fought in melee with swords or maces, but I've never gotten around to it. It's purely cosmetic anyway.
    Last edited by caravel; 11-26-2007 at 14:19.

  5. #5
    Second-hand chariot salesman Senior Member macsen rufus's Avatar
    Join Date
    Dec 2004
    Location
    Ratae Corieltauvorum
    Posts
    2,507

    Default Re: Unit.txt

    Edit: The one thing I wanted to do was have cavalry that charged with lanced and fought in melee with swords or maces, but I've never gotten around to it. It's purely cosmetic anyway.
    I think it should be doable - just declare the two weapons in your "CaravelsNewCav_w.txt" file, then the lance can be used when standing, running, walking and charging, and the other weapon for fighting (and probably dieing ), with the appropriate weapons divided between the two relevant folders in Items ...
    ANCIENT: TW

    A mod for Medieval:TW (with VI)

    Discussion forum thread

    Download A Game of Thrones Mod v1.4

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO