"AttachWearables" in npc_units_custom.txt

When looking through the npc_units_custom.txt file for holdout_example, I found this under "Creature" for "npc_dota_creature_corpselord" and wondered if anyone knows how to use this.

"Creature" {

// other stuff

"AttachWearables"
{
    "Wearable1"
    {
        "ItemDef"    "391"
    }
    "Wearable2"
    {
        "ItemDef"    "392"
    }

    // etc

}

}

Judging from the name, it looks like its meant for attaching cosmetics, but I can't remember the enemy units in that mode having that. If they did, I'd like to know if someone has any information about this, as hero models used as ordinary units doesn't have any cosmetics attached by default (bald Enchantresses or Clinkz without head, arms, bow or quiver doesn't look very good).

Comments

  • edited February 2015 Posts: 1,670

    That's indeed the method to attach cosmetics to npc_dota_creature units, I use it extensively in Warchasers units.

    For example, this is the Creature block for Avatar of Vengeance:

    "Creature"
    {
        "AttachWearables"
        {
            "Wearable1"    {   "ItemDef"    "4903"  } //"Dress of the Ephemeral Haunt"
            "Wearable2"    {   "ItemDef"    "4902"  } //"Horns of the Ephemeral Haunt"
            "Wearable3"    {   "ItemDef"    "4901"  } //"Sleeves of the Ephemeral Haunt"
            "Wearable4"    {   "ItemDef"    "4900"  } //"Wings of the Ephemeral Haunt"
            "Wearable5"    {   "ItemDef"    "5835"  } //"Blade of the Abyss"
        }
    }
    

    To get the number of the cosmetic, first find the name of the item or model used (using the [Dota 2 Wiki Equipment Page] or just the Tools' Asset Browser), and search for that string inside items_game.txt. This file is found in the main game VPK, but you can also check it in this linke here, which should always be up-to-date:

    items_game in dotabuff repository



    PS: 4 spaces make it a code block, you can also put it nicely starting the line with ~~~, putting all your code inside, then closing with ~~~.

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 48

    Thank you very much for the answer! How to add cosmetics to my units is something I've been struggling with for quite some time now, and now I can finally dress up my units. I'll also try to remember about the code blocks next time, as I didn't see it was wrong until my post was posted.

  • edited February 2015 Posts: 1,670

    No problem.

    You should be able to preview your posts with the preview button, and edit them later by clicking on the gear on top right of the post title.

    Any other questions don't hesitate making new threads, we're here to share knowledge and help :blush:

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • Posts: 48

    For some reason some of the icons on the page doesn't show up in my browser, and that's probably why I couldn't find the edit button. :neutral_face:

    But I must say that the tutorials on this page have been such a blessing! I'll see if there's something I can contribute with when I get further with my modules and knowledge in the field of modding.

  • In similar vain of this post, does "AttachWearables" work on heroes? I'm kinda stuck with a bald Riki with no daggers or tail and I'd like to fix that, if it doesn't work is there another way for me to add cosmetics onto a newly created hero?

    Ohgodohgodohgodohgodohgodohgodohgod wheredidalltheabilitiesgo ohgodohgodohgodohgodohgod whatdidido ohgodohgodohgod howdoicomputer

  • Posts: 1,670

    I'm afraid it only works on custom units with "BaseClass" "npc_dota_creature". I tried adding a Creature block inside a hero definition and it was ignored.

    If you are picking a riki ingame and it doesn't show cosmetics, it might also be a precache issue, those models should be appearing without having to attach them.

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • edited February 2015 Posts: 36

    I'm not picking Riki, I have a new hero that just uses Riki's model but I'm unsure of how to give him his daggers, because copying over most of the code below Riki's base hero stuff seems to cause all the heroes to stop existing.

    Ohgodohgodohgodohgodohgodohgodohgod wheredidalltheabilitiesgo ohgodohgodohgodohgodohgod whatdidido ohgodohgodohgod howdoicomputer