Results 1 to 10 of 10

Thread: Creating a World - Developer's Setup Kit for Animation Editing

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,136
    Blog Entries
    35

    Default Creating a World - Developer's Setup Kit for Animation Editing

    IntroductionThe most common way of providing custom animations in a mod is to include the generated IDX an DAT files, usually omitting the descr_skeleton.TXT file and any supporting animation files. This provides an inconvenience when having to update animations: the newly generated IDX\DAT set that will have to be provided usually is around 50MB regardless of the change in files. This is however not the main reason for this article as that size takes only a short time to download, rather it's the total loss of EVT files for other modders as these do not unpack from the DAT file.
    Easy AlternativeThis installation provides an easy to use base for editing animation and sound files as well as a one click solution to generate new IDX\DAT files.
    The ease of use principle should encourage modders to provide their mods with the original sound and animation files while encouraging the modding efforts of others. It also makes updating a mod extremely simple affair and in the case of sounds keeps the update to a low file size.
    The InstallerWith the above in mind I have created an installer that will provide a working mod folder (battles only**) dedicated to the working with sounds and animations. It contains the following:
    • The original sound TXT files as available here
    • The animation files provided here plus the updated ram animations from kingdoms
    • A set of zero byte IDX\DAT files for sound and animation (more in the 'The BAT file' section)
    • A custom BAT file automating the generating of IDX\DAT files (more in the 'The BAT file' section)
    • A CFG file with a dedicated log section, the log itself easily available by the provided desktop shortcut

    ** To test in a campaign simply copy the data\world folder from the default game into the mod, these files were not provided to keep the download small and uncluttered.
    The BAT fileThis is the heart of the process and works as follows:
    • copies the zero byte IDX\DAT files into their respective directories, forcing the game to generate new files
    • renames the original game's data\animation directory
    • starts the mod in Steam compatible mode
    • after a wait of 20 seconds reverses the directory renaming

    All of this effectively means that you only have to edit your files and start the mod to be able to test.

    Spoiler for BAT file coding
    Code:
    @echo off
    REM --- copying zero byte files
    xcopy data\animations\_zerobytefiles\*.* data\animations /q /y
    xcopy data\sounds\_zerobytefiles\*.* data\sounds /q /y
    REM --- going up two levels to main game level
    cd ..\..
    REM --- going to the data subfolder and renaming the main game's animation folder
    cd data
    ren animations animations_backup
    REM --- going back up one level to main game level
    cd .\..
    REM --- standard universal batch file
    IF EXIST kingdoms.exe (start kingdoms.exe @%0\..\Configuration.cfg) ELSE (
    IF EXIST medieval2.exe (start medieval2.exe @%0\..\Configuration.cfg) ELSE (
        echo ERROR: Cannot find the M2TW or Kingdoms executable.
        echo You probably installed this mod into the wrong folder.
        pause
      )
    )
    REM --- pausing the processing of commands for 20 seconds
    timeout 20
    REM --- reversing the renaming AFTER timeout has expired:
    REM --- going to the data subfolder and renaming the main game's animation folder
    cd data
    ren animations_backup animations
    Set up for upload in a larger modGeneral
    Use the provided BAT file for your mod (no edit required)
    To use the provided CFG file simply edit the mod folder name in the [features] section, edit the log's name at your convenience
    Sound
    Provide all sound TXT files and the full content (including zerobytefiles folder) of the data\animations directory without any DAT\IDX files
    Should your mod generate IDX\DAT files beyond the set in the zerobytefiles folder then create the addiotional requirement by a simple copy\rename of existing zero byte files
    Animation
    Provide the descr_skeleton file and the full content (including zerobytefiles folder) of the data\animations directory without any DAT\IDX files
    Note
    The BAT file will generate the required IDX\DAT files at the first start of the mod
    Working Examples and Application
    Animations
    • Open descr_skeletons.txt and go to line 290
    • Replace the CAS file entry (Strat_Diplomat_stand_A_idle.cas) with the one from the 'die_to_back_right_1' line (Strat_Diplomat_backward_1.cas)
    • Save
    • Start Dev Kit with the desktop shortcut
    • Play as England and have your diplomat in France attempt diplomacy in Angers
    • Watch him fall over backwards instead of doing his diplomatic dance

    To implement that in your properly set up mod will only require to upload the edited descr_skeleton file.
    Tip: always keep custom files in custom folders for easy updating.
    Sounds
    • Create the data\sounds\music directory
    • Place into it a MP3 file of your choice
    • Rename the file to (Credits)_We_are_all_one
    • Start Dev Kit with the desktop shortcut
    • Go to Options\View the Credits and listen to your sound track

    To implement that in your properly set up mod will only require to upload the new sound track
    Download and Installation
    This is one of my 'click through' installations. As long as your registry is fine the installer will find the correct installation path. If not, simply follow the instruction displayed in the installer
    Last edited by Gigantus; January 16, 2020 at 09:09 PM.










Tags for this Thread

Posting Permissions

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