Results 1 to 3 of 3

Thread: How to create/implement a custom tile in your stramap.

  1. #1
    leo.civil.uefs's Avatar nis que va bruxo!
    Join Date
    Sep 2010

    Default How to create/implement a custom tile in your stramap.


    The strat map is divided in squares (tiles), you cant see these squares ingame, but you can edit each one of them in files like map_regions, map_climates etc. (Dont worry you dont need any of them for this matter). each one of them will load a battlemap (when a battle happens there), and its heights/geography will automatically be generated by the engine when the battle goes to the battle map, based in the perviously quoted files.

    However, you can create a custom tile and allocate it in a specific position on your battle map. Thats what we did in Third Age Total War for places like THE ARGONATH or the OSGILIATH RIVERCROSSING (check my signature). Then if a battle happens in one of these locations in the stratmap, the battlemap loaded will run your custom tile. This custom tile is nothing but a "settlement", but with no possibility of adding things like gates, walls or the control plaza, and it actually is not a settlement in the stratmap, you cant even select it by clicking on it. Its files are exactly the same from settlements and you can create/edit your custom tile using the IWTE tool, exactly like you do with settlements. That's what I did with The Argonath, used IWTE to edit the terrain and add the statue models.


    If your custom tile is just about terrain, trees, vanilla techtree buildings / ambient buildings / settlements, then you can create it directly via battle editor. But if you want to add custom 3d models, then you need first to create them via the IWTE tool. I recmomend that while creating your custom building in IWTE, edit its .worldpkgdesc file to be an ambient one(check a vanilla ambient settlement of any culture as example).


    Pay attention to the text colors below, they will guide you to avoid confusion.

    Once you have your custom building created and ready to be placed in your custom tile, run medieval 2, go in options then battle editor. Click on the map exactly in the coordinates where you want your custom tile implemented. This is not the step where you are actually choosing the location where your custom tile whill show up when implemented in the game, but it is impportant to implement it in the final exact place now as the integration between your "settlement/tile" terrain and the strat map terrain need to fit.

    Click next to load the battlemap.

    Once the battemap editor is loaded, click place/edit worldpackage tool (sixth button from right to left on the bottom bar), click ambient and navigate to your just created building. Click on it and move the mouse over the terrain, you're now placing your building, choose a location and use "hold shift + mouse movement" to define the height of your building.

    WARNING: If you place your building in a too low or too high height it will result in a bug that will deploy the armies huddled together when you load a battle in the tile and block the entire pathfinding of the map, preventing you from deploying the armies correctly. Adjust the height to a intermediary value to get the tile working normally (you Ill need to do some later test).

    After finding the height you want, click with the left mouse button to place the building. Click esc, save it. Close the editor.

    Go into the game folders, look for data/world/maps/battle/custom/"name you used to save". There' is your tile, you dont need the text files, just the .wfc one. Rename it to whatever you want and paste it in data/world/maps/campaign/imperial/campaign/custom_tiles, if there is not such folder, then create it.

    Now go in data/world/maps/campaign/imperial/campaign and create a text file called "custom_tiles_db" (if there is already such file, then use it).

    Open this file, you will see something like this:

    Misty-Mountains_Province    179    216    moria.wfc        light fog    morning
    West-Osgiliath_Province        255    127    osg.wfc            clear    morning
    East-Osgiliath_Province        240    128    pelenor.wfc        clear    sunrise
    Druadain_Province        242    132    rammas_n.wfc        clear    midday
    Anorien_Province        249    127    rammas_e.wfc        clear    midday
    Cardolan_Province        114    235    barrow.wfc        clear    midday
    Nan-Curunir_Province        165    184    isen_fords.wfc        clear    midday
    Helms-Deep_Province        167    158    hornburg_amb.wfc    clear    midday
    East_Emnet_Province        241    169    argonath.wfc        clear    midday
    Lower-Misty-Mountains_Province    181    216    moria_halls.wfc        clear    night

    The region names you see are just IDs. In my tests, I found out that you can actually use anything there, any text like "ID-01" of whatever, Im 99% sure that it actually dont need to be a region name. But using region names was what original TATW did, so maybe the original modder had a good reason for doing like this... we never know.

    One thing is for sure, YOU CAN'T USE THE SAME ID MORE THAN ONCE.
    If you use the same ID (province name or not) for 2 or more custom tiles, the log.txt will warn you and this will cause some custom tiles to not load in game and/or crash when accessing custom battles. So always use unique IDs.

    So use any text or any region name from data/text/imperial_campaign_regions_and_settlement_names.txt to use here, notice that there are two lines of text for each region in this file, you are looking for the text inside the {} in the first line.

    Now you must type the exact coordinates where your custom tile will be located. Go ingame, start a campaign, place your mouse cursor exactly on the point where you want to locate your custom tile, hit " on your keyboard, type show_cursorstat, that shows you the coordinates on where the mouse cursor is located. Now go back to the text file and place this coordinates right after the name of the region you just placed (like you see in the code I posted here).

    Now comes the name of the .wfc file, use the same name you used back there.

    Then type the weather condition and the time of day.



    If you want your custom tile to be available in custom battles, go into data/custom_locations.txt.
    Each entry is like that example:

    custom_location        Osgiliath Rivercrossing
        location        255    127
        image            data/menu/battlefield_pics/custom_rivercrossing.tga
        sett_locked        yes
        climate            temperate_deciduous_forest
        summer            no
    Where the following colors matches the bits of it:

    Name shown on custom battle game menu
    Coordinates (the same your placed in the other text file)
    The image shown on custom battle menu (create one if you want, and place it in DATA/MENU/BATTLEFIELD_PICS)
    yes for preventing loading settlements there, no to allow it.

    The rest is self explanatory.



    Lets say you want to take and edit a custom tile from another mod, or edit a custom tile of yours wich map.wfc file is not in the data/world/maps/battle/custom/ folder anymore. Its very simple. Create a new scenario in the battle editor (preferably in the final coordinates where your custom tile will be), when the terain editor is opened, dont do anyting, just save the game with any name. Now go into data/world/maps/battle/custom/ and open the folder with the name you just used to save the scenario. There will be a map.wfc there, leave it as it is. Now go in wherever the custom tile that you want to edit is and rename it to "map.wfc" and use it to replace the map.wfc you just created. Now go again in the battle editor and load the game you just saved. Voila, you will now see the custom tile you want to edit.

    THE END.

    Last edited by leo.civil.uefs; November 17, 2019 at 03:16 AM.

  2. #2

    Default Re: How to create/implement a custom tile in your stramap.

    Is there a limit on the number of custom tiles a mod can have?

  3. #3
    leo.civil.uefs's Avatar nis que va bruxo!
    Join Date
    Sep 2010

    Default Re: How to create/implement a custom tile in your stramap.

    Quote Originally Posted by MIKE GOLF View Post
    Is there a limit on the number of custom tiles a mod can have?
    Not that I know.
    Last edited by leo.civil.uefs; November 17, 2019 at 03:23 AM.

Posting Permissions

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