Results 1 to 7 of 7

Thread: How to have multiple battle model general/captain animations in a single faction

  1. #1
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Icon1 How to have multiple battle model general/captain animations in a single faction

    UPDATE: Unfortunatelly, this method is compromised because after loading a savegame, the sub-faction trick will lose its effect, the custom general in battlemap will be replaced by a generic one from the owning faction.

    --------------------------------------------------------------------------------------------------------------------------------

    This tutorial is focused in generals but in case you're aiming at captains, the information you need is all here too, the process is the same.


    For each faction, the game allows only one specific animation for battle models of captains, and another one for generals. So you can have many different custom 3D battle models for the generals in a specific faction, but they will all use the same animation.

    This will obviously cause problems in case you use different sizes for each custom general model of a single faction (large monsters, small goblins etc). A single animation will not fit for them all.

    As a side note, the hardcoded limit of factions is 31, this means you can have 31 custom animations for generals/captains.

    So if you have a faction with multiple different 3D battlemodels for generals and want custom animations for each one of them, you must bring the animations from another factions.

    In descr_character.txt you have many sections, one of them is for captains.
    Code:
    type            general
    There is another one for generals.
    Code:
    type            named character
    In the generals section (type named_character), there is one entry for each faction, and they look like this example:

    Code:
    faction        venice
    dictionary        15
    strat_model    rhun_captain
    battle_model    rhun_captain
    battle_equip    gladius, chainmail shirt helmet and rectangular shield
    The strat_model value points to descr_model_strat.txt
    The battle_model value points to another file called battle_models.modeldb. In this file, search for the battle_model value and you will find the model entry with an animation assigned to it. This is the 3D model of this faction's general, and its assigned animation.

    So in descr_character.txt you can set any model linked to a specific animation in battle_models.modeldb, but remember that once you do it, every general in that faction will get this model and animation. However, while spawning a character via script or setting it via descr_strat.txt, you can set an unique 3d model for it, but not a unique animation.

    So the trick to achieve the objective presented in this tutorial is to choose a faction that is actually not being used in your mod, and use it as a placeholder for the custom animation you want for a custom general of another faction.

    Once you have set the custom model and animation of the placeholder faction by using descr_character.txt and battle_models.modeldb, you can then use this animation for a general of the other faction.

    For doing this, the general that will receive the animation must be set via descr_strat.txt, spawning it via campaign_script.txt won't work.

    In descr_strat.txt, create an entry like any other to normally set the general of your faction at the beggining of the campaign. This entry must be created inside the section of your faction (descr_strat.txt is divided in faction sections).
    It should look something like this example:

    Code:
    character    Sauron, named character, age 22, x 289, y 137, portrait sauron, hero_ability SAURON, label sauron1
    traits Sauron 1, NightBattleCapable 1
    army
    unit        Troll_chieftain            exp 3 armour 0 weapon_lvl 0
    unit        Mordor Halberd            exp 3 armour 0 weapon_lvl 0
    unit        Mordor Halberd            exp 3 armour 0 weapon_lvl 0
    Now comes the trick. Edit the entry you just created, by placing a sub_faction parameter, like this:

    Code:
    character    sub_faction venice, Sauron, named character, age 22, x 289, y 137, portrait sauron, hero_ability SAURON, label sauron1
    traits Sauron 1, NightBattleCapable 1
    army
    unit        Troll_chieftain            exp 3 armour 0 weapon_lvl 0
    unit        Mordor Halberd            exp 3 armour 0 weapon_lvl 0
    unit        Mordor Halberd            exp 3 armour 0 weapon_lvl 0
    The faction in the sub_faction parameter must be the one you used as a placeholder for the animation.

    Voila! Now you have a general of your faction with a custom animation that comes from another faction.

    THATS ALL!!!

    EXTRAS: You can't use this process when spawning generals via campaign_script.txt, despite the fact that there is a sub_faction parameter there too, it won't work.

    If you don't want your general to be visible in the campaign at its start, do everything like you read in this tutorial and set the general in descr_strat.txt to some isolated place in the strat map (it must be a place with blocked pathfinding, otherwise he will move around). Then create a script to move him to the corrdinates you want when the time comes.

    WARNING: Using
    send_character_off_map command to get rid of the general at the campaign start and then spawning him again later will break the animation trick so the general will not receive the custom animation from the placeholder faction but actually the one from its own faction. So don't do this if you don't want the entire effort described in this tutorial to fail.

    If you're using the same process presented in this tutorial for captains instead of generals, you can set a captain via descr_strat.txt by using general instead of named character, but remember that traits don't work for captains, you can set them and the game won't crash, but they don't really work.




    Credits go to WhiffOfGrapeshot who discovered the sub faction trick.
    Last edited by leo.civil.uefs; May 30, 2020 at 11:05 AM.

  2. #2
    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,125
    Blog Entries
    35

    Default Re: How to have multiple battle model general/captain animations in a single faction

    Just to clarify - using the battle_model line\entry in descr_strat does not use the animation that comes with that particular model but rather the animation linked to the model in descr_characters?

    Using your example:
    Code:
    character    Sauron, named character, age 22, x 289, y 137, portrait sauron, battle_model sauron, hero_ability SAURON, label sauron1
    And doing it via the script doesn't work either?

    Suggestion - normally the custom models are based on the elephant mount, replacing that animation sequence in the descr_character model should do the trick, elephants are hardly used. That would then work in the script as well.
    It won't work for multiple animations obviously. And you will have to use your approach for oversized infantry models like the trolls (at least I think they are based on infantry)
    Last edited by Gigantus; November 22, 2019 at 10:51 PM.










  3. #3
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: How to have multiple battle model general/captain animations in a single faction

    Quote Originally Posted by Gigantus View Post
    Just to clarify - using the battle_model line\entry in descr_strat does not use the animation that comes with that particular model but rather the animation linked to the model in descr_characters?

    Using your example:
    Code:
    character    Sauron, named character, age 22, x 289, y 137, portrait sauron, battle_model sauron, hero_ability SAURON, label sauron1
    Exactly.

    Quote Originally Posted by Gigantus View Post
    And doing it via the script doesn't work either?
    Yes, it does not work.

  4. #4

    Default Re: How to have multiple battle model general/captain animations in a single faction

    This is an excellent discovery. Well done.

    Even without using a dummy faction, this can add a lot of diversity to the starting generals who can now borrow animations from other normal factions. If I find the time, I will investigate iterations of the trick for spawning via CS.


    Edit: It turns out that the sub_faction tag borrows a lot more than just the default general animation from the sub faction. It will also borrow the name, the strat model (at whatever level), and the tooltip text (at whatever level). I should have expected this since this is how rebel generals are setup - the novelty of this discovery is that sub_faction works for every faction not just slave. If you use the sub_faction tag for a character in DS, the character name must be included in the list for the sub faction in descr_names, it does not need to be included in the list for the faction the character belongs to. This is a nice way to get uniquely named characters without using the respawning trick in CS. Characters with a sub_faction tag will also use the strat model and tooltip from the sub_faction for whatever trait level they have. This means that you can multiply the number of strat models used by any given faction by the number of dummy factions your mod uses. For example, if you have 3 dummy factions, your target faction can have 44 unique strat models & tooltips (11 from original faction + 3*11 = 44).

    None of this works for characters spawned in CS. This trick only applies to characters starting on the map in descr_strat.
    Last edited by Callistonian; November 24, 2019 at 01:44 AM.

  5. #5
    Araval's Avatar Protector Domesticus
    Join Date
    Nov 2010
    Location
    Tartu, Estonia
    Posts
    4,754

    Default Re: How to have multiple battle model general/captain animations in a single faction

    Sounds great! Thanks for the research guys!

  6. #6
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: How to have multiple battle model general/captain animations in a single faction

    First post updated.

    Bad news, guys...

    Sorry.

    All hopes now lie here.

  7. #7
    nadalio's Avatar Civis
    Join Date
    Apr 2016
    Location
    Where the nameless things gnawing the earth
    Posts
    116

    Default Re: How to have multiple battle model general/captain animations in a single faction

    That's sad hope is possible to have unic animations..there are any news from the overhaul project?

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
  •