Results 1 to 10 of 10

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

  1. #1
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    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.










  2. #2

    Default Re: Creating a World - Animation Updates made easy

    You will also have to rename/remove the vanilla animations folder(specificly pack/skeleton.pack/.idx) or the game will look there for animations and crash.
    Edit: Iam bad at reading
    Last edited by Jojo00182; December 05, 2019 at 04:26 AM.

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Creating a World - Animation Updates made easy

    Quote Originally Posted by Jojo00182 View Post
    You will also have to rename/remove the vanilla animations folder(specificly pack/skeleton.pack/.idx) or the game will look there for animations and crash.
    Quote Originally Posted by The Bat file section
    It will first rename the game's animation folder, then start the mod and after 20 seconds reverse the folder renaming which is ample time for the files to be generated.
    'the game' = vanilla

    I have now updated to: "...the original game's ('vanilla') animation folder..."










  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

    Default Re: Creating a World - Animation Updates made easy

    UPDATE

    Opening post totally reworked, download now as installer










  5. #5
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,492

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

    damn easy!!

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

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

    My favorite phrase exactly : "All of this effectively means that you only have to edit your files and start the mod to be able to test."










  7. #7

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

    This is working brilliantly about 90% of the time. Other 10% of the time I'm still ending up with 0kb files after attempting to start campaign (and crashing, obviously...)

    could that be a timing issue about when it's doing the re-naming?

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

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

    I didn't encounter issues, but you can test this by increasing the renaming delay by editing this number in the BAT file, although 20 seconds should be ample time. Reference for timeout command.
    Code:
    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
    Last edited by Gigantus; September 26, 2020 at 08:21 AM.










  9. #9

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

    Thanks setting it to 40 did the trick, I did notice by looking at the count down that my computer can take over 20s to get to the splash screen...

    (it's not that bad a computer, so probably more to do with me having Photoshop, Blender, IWTE, Firefox and Email running at the same time. EDIT also actually as it's still on disc version, the CD takes a while to wake up)

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

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

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

    Having a load of processor hogs running in the background will do for a delay, glad that a simple increase in the timer period did the job.

    The reversal of the directory renaming does have no effect on the game itself which means there should be no issue to lengthen the period even further if required.










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
  •