- Joined
- Jan 3, 2010
- Messages
- 39
This tutorial assumes the user has basic knowledge of the Data Editor. It will cover these topics...
1. Creating Item Classes
2. Creating Item Containers
3. Adding Equipment and Inventory to a Unit
4. Creating Items
Before starting, make sure that under View within the Data Editor you have "Show Table View" and "Show Advanced Values" both checked.
Note: After completing this tutorial, the buttons to open the equipment/inventory windows are on the right-hand side of the screen just above basic commands in-game.
1. Creating Classes
Item Classes are just categories used to define items. We can use them to define a certain item as a weapon, for example, then create an equipment slot that holds only weapons. For this example I'm going to create 3 item classes: Weapons, Armor, and Accessories.
From within the Data Editor select the Data Type: Item Classes. Right click within the data window and select Add Object. Under Name type "WeaponClass" and hit suggest to generate an ID. Hit OK.
Create 2 more objects using the same method, but name these "ArmorClass" and "AccessoryClass".
We will reference these Item Classes later when creating new Items and Containers.
2. Creating Item Containers...
Containers are essentially backpacks, which store the items your character picks up. We will create 2 types of containers: one for Equipment and one for Inventory.
From within the Data Editor select the Data Type: Item Containers. Right click within the data window and select Add Object. Under name type "EquipmentContainer" and hit suggest to generate an ID. Hit OK.
Set the following fields of this Object to these values...
Model: Marine
Model Height: 300
Model Width: 300
This defines the background of the equipment window, which in this case would display a 300x300 Marine.
Next, edit the Slots + field. This causes a new window to pop up. Click the green X (adjacent to the box labeled "Slots") to create a new slot, make sure the newly created slot is selected, then click the second green X (adjacent to the window labeled "Classes") and from the drop-down menu that appears select "WeaponClass". Next, check the box marked "Enabled" (under Equip), then set the field labeled "Column" to 0, and the field labeled "Row" to 1.
This defines where the Weapon slot will appear within the equipment window and makes sure that it can only hold items of the Weapon Class.
Create 5 more slots using the same method described above, but input the following values for each slot...
Index: 1, Classes: ArmorClass, Column: 5, Equip: Enabled, Row: 1
Index: 2, Classes: AccessoryClass, Column: 1, Equip: Enabled, Row: 5
Index: 3, Classes: AccessoryClass, Column: 2, Equip: Enabled, Row: 5
Index: 4, Classes: AccessoryClass, Column: 3, Equip: Enabled, Row: 5
Index: 5, Classes: AccessoryClass, Column: 4, Equip: Enabled, Row: 5
Now the equipment screen is set to have 1 weapon slot, 1 armor slot, and 4 slots to hold accessories. Hit OK.
Right click within the data window and add another object. Name this one "InventoryContainer", suggest the ID, and hit OK.
Next, edit the Slots + field. Create 16 slots (Index 0-15) for this container, but this time around NONE of the slots should have equip enabled nor should they have any defined classes. Input these values...
Index: 1, Column: 0, Row: 0
Index: 2, Column: 0, Row: 1
Index: 3, Column: 0, Row: 2
Index: 4, Column: 0, Row: 3
Index: 5, Column: 1, Row: 0
Index: 6, Column: 1, Row: 1
Index: 7, Column: 1, Row: 2
Index: 8, Column: 1, Row: 3
Index: 9, Column: 2, Row: 0
Index: 10, Column: 2, Row: 1
Index: 11, Column: 2, Row: 2
Index: 12, Column: 2, Row: 3
Index: 13, Column: 3, Row: 0
Index: 14, Column: 3, Row: 1
Index: 15, Column: 3, Row: 2
Index: 16, Column: 3, Row: 3
This will create a 4x4 container matrix, a.k.a. a 16 slot bag. Since we've left the classes of these slots undefined they can hold any type of item AND since equip has been left disabled the items held in this bag will not provide bonuses to their carrier.
3. Adding Equipment & Inventory to a Unit
From within the Data Editor select the Data Type: Buttons. Right click within the data window and select Add Object. Under name type "Inventory", hit suggest to generate an ID, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Alert Icon: btn-techupgrade-terran-combatshield.dds (type "combat" into the search field to find it easily)
Icon: btn-techupgrade-terran-combatshield.dds (you can copy paste the value from the Alert Icon field rather than finding it again)
Alert Tooltip: Inventory
Then, create a second button object named "Equipment", hit suggest to generate an ID, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Alert Icon: btn-unit-terran-marine.dds (type "marine" into the search field and it's the first choice on the list)
Icon: btn-unit-terran-marine.dds (you can copy paste the value from the Alert Icon field rather than finding it again)
Alert Tooltip: Equipment
Next, from within the Data Editor select the Data Type: Abilities. Right click within the data window and select Add Object. Under name type "Inventory", hit suggest to generate an ID, set the Ability Type to Inventory, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Range: 2
Maximum Drop Range: 2
These values adjust the distances required to pick up and drop items.
Next, edit the Info + field. This causes a new window to pop up. Click the green X (adjacent to the box labeled "Info") to create a new container, select the container, set "Alignment Field" to Left, set "Container" to EquipmentContainer, and set "Empty Face" to Equipment (the button we just created).
Click the green X again, but this time set "Alignment Field" to Right, set "Container" to InventoryContainer, and set "Empty Face" to Inventory.
Now simply add this ability to a unit (the Marine, for example), place it on the map under Player 1's control, and you have a working equipment and inventory system.
Note: The size of the equipment window will automatically expand to meet the farthest row or column specified. You can go back and edit the equipment container at any time to include more slots or adjust their placement. If you have trouble visualizing how you want things to line up this may help...
4. Creating Items...
Making items is somewhat of a pain. Each item requires the creation of at least 5 objects: a button, an item, a unit, an actor, and a behavior or effect. (Behaviors are used to create passive bonuses and effects can be used to create items with actively used abilities). I'll provide a general template for creating items and show how passive and actively used items differ.
Step 1 - Make a Button
From within the Data Editor select the Data Type: Buttons. Right click within the data window and select Add Object. Name the button (the same name you plan on giving the item itself), hit suggest to generate an ID, and set the race to Neutral. Hit OK.
Set the following fields of this Object...
Alert Icon: The icon you want to represent this item from within the inventory/equipment windows. (It's best to select an icon that begins with the letters 'btn'. While browsing you can hit Shift+P to preview the icons and find one you like).
Icon: Same as above.
Alert Tooltip: A description of the item, what bonuses or abilities it provides, etc.
Step 2 - Set Behaviors or Effects
This is the step with the most variance. In the case of items with passive bonuses...
From within the Data Editor select the Data Type: Behaviors. Right click within the data window and select Add Object. Name it, suggest the ID, set Behavior Type to "Buff", and set the race to neutral. Hit OK. Then modify the following fields for this object...
Behavior - Alignment: Positive
UI - Icon: Set this to the same icon you used for the item's button.
Then edit the "Behavior - Modification +" field to open a window with a list of adjustable values. Use the tabs at the top of this window to navigate and set passive bonuses. For example, I decided to set the "Movement Speed Multiplier" to 2 under the Movement tab and "Vital Max Bonus - Life" to 500 under the Unit tab.
If you're making an item that is actively used instead...
From within the Data Editor select the Data Type: Effects. Right click within the data window and select Add Object. Name it, suggest the ID, and set the effect type to whatever you want it to do (there's a long list and each has a varying list of adjustable fields). For example, I set the Effect Type to "Create Unit", then set "Effect - Effect - Spawn" to Infested Swarm (Initial Set), set "Target - Location +" to Target Point, "Unit - Spawn Range" to 3, AND "Unit - Spawn Unit" to Infested Swarm Egg.
Once you've set the fields of the Behavior or Effect to your liking you can move on.
Step 3 - Make an Item
From within the Data Editor select the Data Type: Items. Right click within the data window and select Add Object. Name it, suggest the ID, then for passive items leave the "Item Type" field as Generic otherwise set it to Instant or Target (depending on the sort of effect you created), and finally set the Item Class to whatever you want it to be (Accessory, Armor, etc). Hit OK. Then modify the following fields of this object...
If you're creating an item with passive bonuses modify the "Equip Behaviors" field of this object and add the behavior you just created.
If you're creating an item that is actively used modify the "Effect" field of this object and add the effect you just created.
Note: If you want your effect to have charges modify the "Effect Cost+" field then set Count Max and Count Start to the total number of charges you want the item to have, set Count Use to 1, and make sure location is set to Ability. Then modify the "Flags" field and check the box labeled "Destroy when Depleted".
For my actively used item I set the "Item Type" to target and also set the "Range" to 15 so it would fire Infested Terran Eggs from a distance.
Step 4 - Make a Unit
From within the Data Editor select the Data Type: Units. Right click within the data window and select Add Object. Name it, suggest the ID, set the Race to Neutral, and the Object Type to Item. Hit OK. Then modify the following fields for this object...
Unit - Flags: Pawnable (check this on the list of flags)
Stats - Item: Set this to the name of the item you just created.
Step 5 - Make an Actor
Now pick any actor to duplicate and then set the unitName of that actor to the name of the unit you just created (you can right click to duplicate an object and then right click again to change its name and suggest a new ID).
Note: You can scale down the actor to be more item-like by modifying the Art - Scale field and changing the X, Y, Z values to decimals.
Now place your item on the map under the control of a neutral player. It should auto-equip when picked up.
View attachment EquipmentTutorial.SC2Map
1. Creating Item Classes
2. Creating Item Containers
3. Adding Equipment and Inventory to a Unit
4. Creating Items
Before starting, make sure that under View within the Data Editor you have "Show Table View" and "Show Advanced Values" both checked.
Note: After completing this tutorial, the buttons to open the equipment/inventory windows are on the right-hand side of the screen just above basic commands in-game.
1. Creating Classes
Item Classes are just categories used to define items. We can use them to define a certain item as a weapon, for example, then create an equipment slot that holds only weapons. For this example I'm going to create 3 item classes: Weapons, Armor, and Accessories.
From within the Data Editor select the Data Type: Item Classes. Right click within the data window and select Add Object. Under Name type "WeaponClass" and hit suggest to generate an ID. Hit OK.
Create 2 more objects using the same method, but name these "ArmorClass" and "AccessoryClass".
We will reference these Item Classes later when creating new Items and Containers.
2. Creating Item Containers...
Containers are essentially backpacks, which store the items your character picks up. We will create 2 types of containers: one for Equipment and one for Inventory.
From within the Data Editor select the Data Type: Item Containers. Right click within the data window and select Add Object. Under name type "EquipmentContainer" and hit suggest to generate an ID. Hit OK.
Set the following fields of this Object to these values...
Model: Marine
Model Height: 300
Model Width: 300
This defines the background of the equipment window, which in this case would display a 300x300 Marine.
Next, edit the Slots + field. This causes a new window to pop up. Click the green X (adjacent to the box labeled "Slots") to create a new slot, make sure the newly created slot is selected, then click the second green X (adjacent to the window labeled "Classes") and from the drop-down menu that appears select "WeaponClass". Next, check the box marked "Enabled" (under Equip), then set the field labeled "Column" to 0, and the field labeled "Row" to 1.
This defines where the Weapon slot will appear within the equipment window and makes sure that it can only hold items of the Weapon Class.
Create 5 more slots using the same method described above, but input the following values for each slot...
Index: 1, Classes: ArmorClass, Column: 5, Equip: Enabled, Row: 1
Index: 2, Classes: AccessoryClass, Column: 1, Equip: Enabled, Row: 5
Index: 3, Classes: AccessoryClass, Column: 2, Equip: Enabled, Row: 5
Index: 4, Classes: AccessoryClass, Column: 3, Equip: Enabled, Row: 5
Index: 5, Classes: AccessoryClass, Column: 4, Equip: Enabled, Row: 5
Now the equipment screen is set to have 1 weapon slot, 1 armor slot, and 4 slots to hold accessories. Hit OK.
Right click within the data window and add another object. Name this one "InventoryContainer", suggest the ID, and hit OK.
Next, edit the Slots + field. Create 16 slots (Index 0-15) for this container, but this time around NONE of the slots should have equip enabled nor should they have any defined classes. Input these values...
Index: 1, Column: 0, Row: 0
Index: 2, Column: 0, Row: 1
Index: 3, Column: 0, Row: 2
Index: 4, Column: 0, Row: 3
Index: 5, Column: 1, Row: 0
Index: 6, Column: 1, Row: 1
Index: 7, Column: 1, Row: 2
Index: 8, Column: 1, Row: 3
Index: 9, Column: 2, Row: 0
Index: 10, Column: 2, Row: 1
Index: 11, Column: 2, Row: 2
Index: 12, Column: 2, Row: 3
Index: 13, Column: 3, Row: 0
Index: 14, Column: 3, Row: 1
Index: 15, Column: 3, Row: 2
Index: 16, Column: 3, Row: 3
This will create a 4x4 container matrix, a.k.a. a 16 slot bag. Since we've left the classes of these slots undefined they can hold any type of item AND since equip has been left disabled the items held in this bag will not provide bonuses to their carrier.
3. Adding Equipment & Inventory to a Unit
From within the Data Editor select the Data Type: Buttons. Right click within the data window and select Add Object. Under name type "Inventory", hit suggest to generate an ID, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Alert Icon: btn-techupgrade-terran-combatshield.dds (type "combat" into the search field to find it easily)
Icon: btn-techupgrade-terran-combatshield.dds (you can copy paste the value from the Alert Icon field rather than finding it again)
Alert Tooltip: Inventory
Then, create a second button object named "Equipment", hit suggest to generate an ID, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Alert Icon: btn-unit-terran-marine.dds (type "marine" into the search field and it's the first choice on the list)
Icon: btn-unit-terran-marine.dds (you can copy paste the value from the Alert Icon field rather than finding it again)
Alert Tooltip: Equipment
Next, from within the Data Editor select the Data Type: Abilities. Right click within the data window and select Add Object. Under name type "Inventory", hit suggest to generate an ID, set the Ability Type to Inventory, and set the race to Terran. Hit OK.
Set the following fields of this Object to these values...
Range: 2
Maximum Drop Range: 2
These values adjust the distances required to pick up and drop items.
Next, edit the Info + field. This causes a new window to pop up. Click the green X (adjacent to the box labeled "Info") to create a new container, select the container, set "Alignment Field" to Left, set "Container" to EquipmentContainer, and set "Empty Face" to Equipment (the button we just created).
Click the green X again, but this time set "Alignment Field" to Right, set "Container" to InventoryContainer, and set "Empty Face" to Inventory.
Now simply add this ability to a unit (the Marine, for example), place it on the map under Player 1's control, and you have a working equipment and inventory system.
Note: The size of the equipment window will automatically expand to meet the farthest row or column specified. You can go back and edit the equipment container at any time to include more slots or adjust their placement. If you have trouble visualizing how you want things to line up this may help...
4. Creating Items...
Making items is somewhat of a pain. Each item requires the creation of at least 5 objects: a button, an item, a unit, an actor, and a behavior or effect. (Behaviors are used to create passive bonuses and effects can be used to create items with actively used abilities). I'll provide a general template for creating items and show how passive and actively used items differ.
Step 1 - Make a Button
From within the Data Editor select the Data Type: Buttons. Right click within the data window and select Add Object. Name the button (the same name you plan on giving the item itself), hit suggest to generate an ID, and set the race to Neutral. Hit OK.
Set the following fields of this Object...
Alert Icon: The icon you want to represent this item from within the inventory/equipment windows. (It's best to select an icon that begins with the letters 'btn'. While browsing you can hit Shift+P to preview the icons and find one you like).
Icon: Same as above.
Alert Tooltip: A description of the item, what bonuses or abilities it provides, etc.
Step 2 - Set Behaviors or Effects
This is the step with the most variance. In the case of items with passive bonuses...
From within the Data Editor select the Data Type: Behaviors. Right click within the data window and select Add Object. Name it, suggest the ID, set Behavior Type to "Buff", and set the race to neutral. Hit OK. Then modify the following fields for this object...
Behavior - Alignment: Positive
UI - Icon: Set this to the same icon you used for the item's button.
Then edit the "Behavior - Modification +" field to open a window with a list of adjustable values. Use the tabs at the top of this window to navigate and set passive bonuses. For example, I decided to set the "Movement Speed Multiplier" to 2 under the Movement tab and "Vital Max Bonus - Life" to 500 under the Unit tab.
If you're making an item that is actively used instead...
From within the Data Editor select the Data Type: Effects. Right click within the data window and select Add Object. Name it, suggest the ID, and set the effect type to whatever you want it to do (there's a long list and each has a varying list of adjustable fields). For example, I set the Effect Type to "Create Unit", then set "Effect - Effect - Spawn" to Infested Swarm (Initial Set), set "Target - Location +" to Target Point, "Unit - Spawn Range" to 3, AND "Unit - Spawn Unit" to Infested Swarm Egg.
Once you've set the fields of the Behavior or Effect to your liking you can move on.
Step 3 - Make an Item
From within the Data Editor select the Data Type: Items. Right click within the data window and select Add Object. Name it, suggest the ID, then for passive items leave the "Item Type" field as Generic otherwise set it to Instant or Target (depending on the sort of effect you created), and finally set the Item Class to whatever you want it to be (Accessory, Armor, etc). Hit OK. Then modify the following fields of this object...
If you're creating an item with passive bonuses modify the "Equip Behaviors" field of this object and add the behavior you just created.
If you're creating an item that is actively used modify the "Effect" field of this object and add the effect you just created.
Note: If you want your effect to have charges modify the "Effect Cost+" field then set Count Max and Count Start to the total number of charges you want the item to have, set Count Use to 1, and make sure location is set to Ability. Then modify the "Flags" field and check the box labeled "Destroy when Depleted".
For my actively used item I set the "Item Type" to target and also set the "Range" to 15 so it would fire Infested Terran Eggs from a distance.
Step 4 - Make a Unit
From within the Data Editor select the Data Type: Units. Right click within the data window and select Add Object. Name it, suggest the ID, set the Race to Neutral, and the Object Type to Item. Hit OK. Then modify the following fields for this object...
Unit - Flags: Pawnable (check this on the list of flags)
Stats - Item: Set this to the name of the item you just created.
Step 5 - Make an Actor
Now pick any actor to duplicate and then set the unitName of that actor to the name of the unit you just created (you can right click to duplicate an object and then right click again to change its name and suggest a new ID).
Note: You can scale down the actor to be more item-like by modifying the Art - Scale field and changing the X, Y, Z values to decimals.
Now place your item on the map under the control of a neutral player. It should auto-equip when picked up.
View attachment EquipmentTutorial.SC2Map
Last edited: