Creating a custom shop, step by step

Creating a dota_shop entity

Start off by creating an entity(Shift+E) and assigning it the "ent_dota_shop", once you've done this place the entity.

Dota_shop entity object properties


Select the entity and navigate to the object properties(Alt+Enter), once inside the object properties look for the World Model view and click to view local library (little magnifying glass underneath the string field) and assign it a model of your liking.

Assigning a Shop Type to entity

Once you've assigned your World Model, scroll all the way down inside the object properties, down to the "Shop Type" Field, here we can specify the following:
  • Home - Items are automatically placed in stash, unless you're within the trigger area, then it will be placed in your inventory if a free slot is available.
  • Side - Have to be at this shop to buy items with inventory space, does not get stashed
  • Secret - Have to be at this shop to buy items with inventory space, does not get stashed
**Note-* You can only have these three shop types i've been unsuccesfull in creating a fully custom shop. By assigning it a secret type all secret types are linked together(Items) and so are the trigger area's we will be creating soon. This means you can create two instances of trigger area's for 1 shop if you please so but you can't have two unique secret shops.

Creating a trigger Area(block)

Once you've assigned your Shop Type, we now have to create a trigger area, this can be done by pressing Shift+B, now drag a desired box for the purchase area (preferably give it equal height to the model selling).

Assigning a trigger material to created Area(block)

Once you've created your Block, we have to assign it a trigger material, this can be done by going to the material library and name filtering "trigger", then drag and drop this material onto the block, it should change to the specified material.

Assigning an trigger_shop entity class to the trigger block

Now we have to add a class to the block, this can done by pressing Ctrl + T, once this has been done, assign it the class "trigger_shop", then afterwards scroll all the way down and assign it the shop type field matching the shop you want it to trigger, so if you selected the secret early, you will assign this shop_type field secret aswell to match the shop type.

**Note-* If you assign it a different shop type then you will purchase from that specified shop.

Creating a custom shop.txt file

We now have to create a shop list txt file, this file has to be located within, if you do not see the shops folder which is likely if you copied the addon from dota pvp, simply create the directory:

dota_ugc\game\dota_addons\ADDON_NAME\scripts\shops

Custom shop file naming convention:

<map_name>_shops.txt

Custom Shop File Content

 "dota_shops"
{ //Home Shop Start //--------------------------
"consumables"
{
"item" "ITEM_NAME"
}
"attributes"
{
"item" "ITEM_NAME"
}
"weapons_armor"
{
"item" "ITEM_NAME"
}
"misc"
{
"item" "ITEM_NAME"
}
// Level 1 - Green Recipes
"basics"
{
"item" "ITEM_NAME"
}
// Level 2 - Blue Recipes
"support"
{
"item" "ITEM_NAME"
}
"magics"
{
"item" "ITEM_NAME"
}
// Level 3 - Purple Recipes
"defense"
{
"item" "ITEM_NAME"
}
"weapons"
{
"item" "ITEM_NAME"
}
// Level 4 - Orange / Orb / Artifacts
"artifacts"
{
"item" "ITEM_NAME"
}
//Sideshop Start - Page 1
//--------------------------
"sideshop1"
{
"item" "ITEM_NAME"
}
//Sideshop Page 2
"sideshop2"
{
"item" "ITEM_NAME"
}
//Secret Shop Start
//--------------------------
"secretshop"
{
"item" "ITEM_NAME"
}
}



After this build your map and you should have your shop! if you followed everything right it should work!, congrats on your first shop!


Tut  by cUppa94

Post a Comment

Powered by Blogger.