After some trial and error I found out (finally!) how to create an always open "WarCraft III - like" Inventory. As some of you asked in Helral´s Layout Thread about how to do this, I decided to write a step by step tutorial about it.
Some of may have noticed, that you can´t customize the inventory by triggers.
So we have to:
1. Create the ability with the right options set to make it look like it´s always open.
2. Create a Custom Layout file to handle positioning and size of slots and the whole inventory itself.
Create the Ability:
First thing we have to do is creating the ability.
Go to the "Abilities" Tab in the Data Editor and create a new ability of type "Inventory". Double Click on "Ability - Info+"
At the top, add 6 containers to the list and set all slots (Container,Item, Empty Face, Requirements) to "None" in every inventory slot.
You can change the "Classes" (These are the item-classes, that are allowed in the specific slot) to anything you want. The "Alignment" doesn´t matter, it will always be at the right side of your screen (at least without having a custom layout file).
Now go to your hero unit in the "Units" Tab and add the new created inventory ability to your unit.
Short explanation what we did exactly with these steps: Normaly you create an "Inventory" ability AND an "Item Container". In the Info+ Tab of the ability you normally add only one container, as the "Item Container" itself defines the Count of Item Slots you can have. But if you don´t add a specific Item Container, the button, that normally opens the inventory, will BECOME the Item Slot. So we added 6 containers and didn´t define the container in the "Container" Tab, so we have 6 different inventories here, each with only one slot. However, the game will recognize this and also link it with the NumPad correctly. Sadly, it´s not possible to add more than 6 inventories to the ability here so...I hope Blizzard will extend this.
Create the Custom Layout File:
I rearranged the inventory so that it is next to the unit portrait in the black area, as it´s the best position for my map. However, you can reposition it as you like.
Now save the file as >whateveryouwant<.SC2Layout and go to the Import Manager (Modules -> Import).
In the Import Manager, go to Data -> Import Files and select your .SC2Layout file you just created.
Set the Import Path to: Base.SC2Data/CustomUI/ and confirm.
Save your map (important!) and the custom UI file will be added to your map.
Now go to the "Data Editor" and find the "Game UI Data" Tab
Click on "Default SC2 UI Settings" and disable the "Show Table View" Tab, so you can see the Tab with "UI" and click on it.
Now scroll down until you find "Custom Layout Files" and add a new value. If you set the path in the import manager correctly, it should automatically select your custom UI file. Click on it and confirm.
Save your map, click on your hero and have fun with your 2x3 Inventory of type "I´m always open!" :).
For the repositioning of your inventory: You can rename your just created UI file back to .txt and play around with the values of the different lines. It was a bit time consuming to find out which line affects which slot or border.
I found out:
<Frame type="CommandButton" name="Button00">
This is the first slot of the inventory, all entries will affect this specific slot. So Height and Width Value can be changed here. Of course, Button01 is the second slot and so on...
All entries refer to the position of the whole inventory
<Frame type="Frame" name="ContainerSizeFrame">
This line customizes the "visible" field for the inventory. I found out that this line is necessary as I deleted it at first and could only see my inventory partially.
<Frame type="Image" name="BackgroundImage">
All entries here are necessary to create a nice racial-based border around the inventory.
So have fun customize your own 6 slot inventory ! :)
Thanks to Helral and Grimshad for help with customizing the UI ! And sorry for my baaaaad english :)
If you have any further questions, just send me a PM.
I used this method for a long time already, didn't know it was such a mystery, otherwise, I would have shared it earlier xD.
Anyway, nice tutorial. Why exactly is this in Wiki Discussions and not in the Tutorials Section?
I wanted to make a tutorial as so many in the forum wanted to know how it exactly works. See the "How to adjust" Thread of Helral. So yea, seems it was a mystery ;)
And the Widescreen thing, well, yes, this occurs when having no widescreen resolution...but...most use wide so...you can adjust it how you want in the layout file anyways.
Didn't test it yet but does it still work with 1.3?
After this damn patch my whole map is destroyed so that I don't even want to do anything on it cause it would be everything right from the scratch.
Thought custom Layout Files got completely useless after 1.3?
Didn't test it yet but does it still work with 1.3? After this damn patch my whole map is destroyed so that I don't even want to do anything on it cause it would be everything right from the scratch. Thought custom Layout Files got completely useless after 1.3?
the custom SC2Layout files didn't get useless. The replacement method of using SC2Layout files will get completely useless in a future patch. (eg. replacing the UI/Layout/UI/GameUI.SC2Layout with a modified one, by importing it to that location in your map.)
Omg this tutorial I needed to know this. Damn only 6 though... Either way better than having to open the inventory every time.
I currently use a combination of both. 5 consumable slots, always open and accessible via hotkey, and the 6th slot holds an item container for all purely passive equipment items.
I currently use a combination of both. 5 consumable slots, always open and accessible via hotkey, and the 6th slot holds an item container for all purely passive equipment items.
Oh that's a great idea! I may steal that lol. No lawsuits please.
Thanks for the positive feedback concerning this tut !
I will add some pictures and edit the post in the next week or so. The resolution issue is...quite annoying. Some fixing is needed. Anyways, hope it helps you for your map :)
Is there a way to make it like warcraft 3, where if you click an enemy players hero, u can see the enemy's inventory? (and they can see urs vice versa)
and then when u click your own hero, u see your own inventory again?
I couldn´t find any entry about alliance behaviour in the ability. But I think you could create a dialog with 6 Inventory slot graphics and then only show them when you select an enemy hero. So you link the appropriate icons of the different items in the slots and show them in the dialog.
Something like this:
Event: Unit is clicked
Condition: Owner of triggering unit == triggering player : false
Action: Show Dialog
If: item type in slot 1 == "Item"
then: Show image "image for the appropriate item in dialog Enemy Inventory"
Ok, so I tried different settings for the inventory and decided to post my final inventory configuration, that will not be screwed up when changing the resolution. Use these commands for your Layout file:
Hmmm I ran into a problem, the "classes" dont really seem to work
for example, in the inventory ability, I set slot 0 and slot 1 as "Weapon" class, and the rest as no class
And then I set some items as giving a +10 damage increase when equipped and set these as "Weapon" class
So basically you are supposed to be able to put this item into any 6 slots, but you only get the +10 damage if its in slot 0, or slot 1
However, you get the +10 damage in all the slots! Even the slots that are not "Weapon"
Since this inventory ability method leaves all item containers etc blank in the data editor, so we cant set "equip' weapon flag, what is the solution to this problem?
How to make the item only give +10 damage, when in the first 2 slots, but give no bonus if put in the other 4 (storage slots)?
Hi,
After some trial and error I found out (finally!) how to create an always open "WarCraft III - like" Inventory. As some of you asked in Helral´s Layout Thread about how to do this, I decided to write a step by step tutorial about it.
Some of may have noticed, that you can´t customize the inventory by triggers.
So we have to:
1. Create the ability with the right options set to make it look like it´s always open.
2. Create a Custom Layout file to handle positioning and size of slots and the whole inventory itself.
Create the Ability:
First thing we have to do is creating the ability.
Short explanation what we did exactly with these steps: Normaly you create an "Inventory" ability AND an "Item Container". In the Info+ Tab of the ability you normally add only one container, as the "Item Container" itself defines the Count of Item Slots you can have. But if you don´t add a specific Item Container, the button, that normally opens the inventory, will BECOME the Item Slot. So we added 6 containers and didn´t define the container in the "Container" Tab, so we have 6 different inventories here, each with only one slot. However, the game will recognize this and also link it with the NumPad correctly. Sadly, it´s not possible to add more than 6 inventories to the ability here so...I hope Blizzard will extend this.
Create the Custom Layout File:
I rearranged the inventory so that it is next to the unit portrait in the black area, as it´s the best position for my map. However, you can reposition it as you like.
Save your map, click on your hero and have fun with your 2x3 Inventory of type "I´m always open!" :).
For the repositioning of your inventory: You can rename your just created UI file back to .txt and play around with the values of the different lines. It was a bit time consuming to find out which line affects which slot or border.
I found out:
<Frame type="CommandButton" name="Button00">
<Frame type="CommandTooltip" name="InventoryTooltip">
<Frame type="InventoryContainer" name="InventoryButtons">
<Frame type="Frame" name="ContainerSizeFrame">
<Frame type="Image" name="BackgroundImage">
So have fun customize your own 6 slot inventory ! :) Thanks to Helral and Grimshad for help with customizing the UI ! And sorry for my baaaaad english :) If you have any further questions, just send me a PM.
I used this method for a long time already, didn't know it was such a mystery, otherwise, I would have shared it earlier xD.
Anyway, nice tutorial. Why exactly is this in Wiki Discussions and not in the Tutorials Section?
Does the layout part work for all resolutions?
+1 all there ima test it and see how it goes :)
1280x1024 tested, blocks the entire portrait and 1 row of the command card :(
Non - widescreens do not even have the black area you are talking about.
@Kueken531: Go
I wanted to make a tutorial as so many in the forum wanted to know how it exactly works. See the "How to adjust" Thread of Helral. So yea, seems it was a mystery ;)
And the Widescreen thing, well, yes, this occurs when having no widescreen resolution...but...most use wide so...you can adjust it how you want in the layout file anyways.
nice to have a somewhat more extended tutorial about this compared to my small one which just explains what blizzard did for their Aiur Chef map:
See the second post in this thread (linked to post 2)
gj Oneiros33 on this more specific tutorial.
Didn't test it yet but does it still work with 1.3? After this damn patch my whole map is destroyed so that I don't even want to do anything on it cause it would be everything right from the scratch. Thought custom Layout Files got completely useless after 1.3?
This works.
the custom SC2Layout files didn't get useless. The replacement method of using SC2Layout files will get completely useless in a future patch. (eg. replacing the UI/Layout/UI/GameUI.SC2Layout with a modified one, by importing it to that location in your map.)
Omg this tutorial I needed to know this. Damn only 6 though... Either way better than having to open the inventory every time.
I currently use a combination of both. 5 consumable slots, always open and accessible via hotkey, and the 6th slot holds an item container for all purely passive equipment items.
If you get a chance, could you please add screenshots, here and there :)
Oh that's a great idea! I may steal that lol. No lawsuits please.
Feel free to :)
that is so good Oneiros33. thank you very much for this tutorial!
Thanks for the positive feedback concerning this tut !
I will add some pictures and edit the post in the next week or so. The resolution issue is...quite annoying. Some fixing is needed. Anyways, hope it helps you for your map :)
Is there a way to make it like warcraft 3, where if you click an enemy players hero, u can see the enemy's inventory? (and they can see urs vice versa)
and then when u click your own hero, u see your own inventory again?
@HatsuneMikuMegurine: Go
I couldn´t find any entry about alliance behaviour in the ability. But I think you could create a dialog with 6 Inventory slot graphics and then only show them when you select an enemy hero. So you link the appropriate icons of the different items in the slots and show them in the dialog.
Something like this:
Event: Unit is clicked
Condition: Owner of triggering unit == triggering player : false
Action: Show Dialog
If: item type in slot 1 == "Item" then: Show image "image for the appropriate item in dialog Enemy Inventory"
Show Dialog "Enemy Inventory"
It may be a lot of work though.
Ok, so I tried different settings for the inventory and decided to post my final inventory configuration, that will not be screwed up when changing the resolution. Use these commands for your Layout file:
This is a Sotis like position, however, the Slots are bigger and it is surrounded by a nice racial based border. Have fun with it ! :)
Hmmm I ran into a problem, the "classes" dont really seem to work
for example, in the inventory ability, I set slot 0 and slot 1 as "Weapon" class, and the rest as no class
And then I set some items as giving a +10 damage increase when equipped and set these as "Weapon" class
So basically you are supposed to be able to put this item into any 6 slots, but you only get the +10 damage if its in slot 0, or slot 1
However, you get the +10 damage in all the slots! Even the slots that are not "Weapon"
Since this inventory ability method leaves all item containers etc blank in the data editor, so we cant set "equip' weapon flag, what is the solution to this problem?
How to make the item only give +10 damage, when in the first 2 slots, but give no bonus if put in the other 4 (storage slots)?