Difference between revisions of "Items"

From HIVE
Jump to navigation Jump to search
(Split the tutorial in another article, this is now generally about items, link to the tutorial is provided)
 
Line 1: Line 1:
'''Items''' are objects that can be equipped by units when paired with an [[Inventory]]. They can have very basic effects like adding armor to a unit, equipping a weapon to a unit, or even have more complex "on-use" effects that deal damage to a target or heal the unit.
+
{{TutorialsBox
 +
|contents = [[Creating a weapon item]]
 +
}}
 +
'''Items''' are [[catalog]] objects that can be equipped by units when paired with an [[Inventory]]. They can have very basic effects like adding armor to a unit, equipping a weapon to a unit, or even have more complex "on-use" effects that deal damage to a target or heal the unit.
  
=Creating a Weapon Item=
+
Item itself just links several other objects together. An item consist of:
For this tutorial, we will create an item that will attach a Marauder's "Punisher Grenades" to a Marine.
+
*[[Buttons|Button]] - contains the item's icon and description
 +
*[[Behaviors|Behavior]] - (optional) provides passive bonuses for item's bearer (the behavior is applied as usually, beware of stacking limits)
 +
*[[Effects|Effect]] or [[Ability]] - (optional) used for items with active effects
 +
*[[Weapons|Weapon]] - (optional) used for items that give a [[Weapons|weapon]] to the bearer
 +
*[[Units|Unit]] - represents the unit when ''outside'' of inventory (the link goes the other way here, the ''unit'' has a field called ''item'', which links them together)
 +
**[[Actors|Actor]] - obviously the item's unit needs it's own actor
  
Open up the Data Editor by going to "Modules > Data" (F7). Before we begin, make you have the "Show Table View" button pressed next to the right "Search" bar.
+
Additionally, item has an [[Item classes|item class]], which is used by [[Item containers|item containers]] to determine, which items can be placed in which slots.
 
+
==Types==
==Creating the Item Class==
+
===Generic===
Before we can create our item, we need to decide what type of item this will be. This '''Item Class''' will ultimately coincide with your [[Inventory]]. Item Classes are basically customized item types that will be attached to the item units. Under "Data Type:" select "Item Classes."
+
Generic items are passive, they can only give the unit [[Behaviors|behavior]] or [[Weapons|weapon]].
#In the box on the left, right-click and select "Add Object" (Ctrl+=). Name this new object "WeaponClass," click "Suggest" for the ID, and then click "OK" to close the window.
+
===Effect - Instant===
 
+
These items have, as the name suggests, an instant effect. It is possible to specify cost for use (commonly used for items with limited charges).
That's all you have to do here, since we're only making a weapon item.
+
===Effect - Target===
 
+
Same as above, except uses targeted effect.
==Creating the Item's Button==
+
===Ability===
We will need a button to asociate the item with, so you'll need to make a custom one next. Under "Data Type:" select "Buttons." In the box on the left, right-click and select "Add Object" (Ctrl+=). Name this new object "Punisher Grenade Launcher," click "Suggest" for the ID, and then click "OK" to close the window.
+
??? Can be safely used with Effec - Instant and Effect - Target abilities
#In the box on the right, find "Icon" and change that to "'''btn-terran-experiencedplasmagun.dds.'''" You can change this to whatever you would like, but I randomly chose an image of a weapon.
+
==Fields==
#Find "Tooltip" and change that to something along the lines of "'''Equip a "Punisher Grenade Launcher."'''" You could add details about the weapon if you'd like, as well.
+
Each item has several basic fields:
 
+
*'''Face''' - [[Buttons|Button]] used for this item
==Creating the Item==
+
*'''Carry Behaviors/Weapons''' - Behaviors/Weapons added to unit when ''carrying'' the item
Now we need to create our basic "Item." Under "Data Type:" select "Items." In the box on the left, right-click and select "Add Object" (Ctrl+=). Name this new object "Punisher Grenade Launcher," click "Suggest" for the ID, set the "Type" to "Generic," and then click "OK" to close the window.
+
*'''Equip Behaviors/Weapons''' - Behaviors/Weapons added to unit when the item is ''equipped''
#In the box on the right, find "Class" and change that to "WeaponClass."
+
''(Some slot in inventory can be marked to not equip the item (storage slots), items in this slots will provide only carry bonuses.) For more info, see [[Item containers]].''
#Now find "Equip Weapons+" and double-click the space to the right of it to open an "Object Values" window. Click the green X on the right of the box to add a line to it. Select the blank line and change the "Weapon" to "'''Marauder - Punisher Grenades.'''" Click "OK" to close the window.
+
*'''Container''' - items can be used as further item containers, containing other items. See [[Item containers]]
#Find "Face" and change that to our custom button, "'''Punisher Grenade Launcher'''."
 
 
 
==Creating the Item's Unit==
 
Now that the basic "Item" is done, we need to make a [[Unit]] for it. Under "Data Type:" select "Units." In the box on the left, right-click and select "Add Object" (Ctrl+=). Name this new object "Punisher Grenade Launcher," click "Suggest" for the ID, set the "Based On" to "Default Settings (Item)," and then click "OK" to close the window.
 
#In the box on the right, find "Stats - Item" and set that to "Punisher Grenade Launcher."
 
 
 
==Creating the Item's Actor==
 
Unfortunately without an [[Actor]] the Unit will show up with a missing model, so we'll create one for the item. Under "Data Type:" select "Actors." In the box on the left, right-click and select "Add Object" (Ctrl+=). Name this new object "Punisher Grenade Launcher," click "Suggest" for the ID, set the "Type" to "Unit," and Based On "GenericUnitStandard." Click "OK" to close the window.
 
#Above the box on the right, find "Unit Name" and set that to "Punisher Grenade Launcher."
 
#Now in the box on the right, find "Art - Model" and set that to "Crate." It will default to a non-existent "Punisher Grenade Launcher" [[Model|model]] otherwise, and will show up as a white blob if this isn't changed. You could also create a "Punisher Grenade Launcher" model if you wanted, but for something like this it isn't necessary.
 
#Find "Art - Scale" and set each value to "'''0.5'''." This will reduce the size of the Cargo model by 50% so it isn't as huge.
 
#Now find "Event - Events+" and double-click the space on the right of it to open an "Object Values" window.
 
##Right click the space on the left and select "'''Add Event.'''"
 
##*Set the "Msg Type:" to "'''Unit Birth'''."
 
##*Set the "Source Name:" to "'''Punisher Grenade Launcher'''."
 
##*Set the "Sub Name:" to "'''(Any)'''."
 
##Now click the "ActionImpact" under the "UnitBirth.PunisherGrenadeLauncher" Event. Set the "Msg Type:" to "'''Create'''."
 
##Click "OK" to close the window.
 
#Find "UI - Unit Icon" and set that to "'''decalhazard03_diffuse.dds'''." ''Note: If you have the [[Dependencies|Campaign Dependencies]], you can find a better selection to choose from.
 
#Find "UI - Wireframe" and set it to the same image as above, "'''decalhazard03_diffuse.dds'''."
 
 
 
 
 
Now if you place the Unit on the map, it will look like a crate. When you pick it up, it will automatically be added to your '''Item Container''' and equip the "Punisher Grenade Launcher."
 
 
 
[[File:ItemWeapon.png]]
 
 
 
=See Also=
 
*[[Inventory]]
 
 
 
===Video Tutorial===
 
Credits for this video goes to '''OneTwo'''.
 
<youtube>0ZH8Bx9jtcs</youtube>
 
  
 
[[Category:StarCraft II]]
 
[[Category:StarCraft II]]
 
[[Category:Data Editor]]
 
[[Category:Data Editor]]
[[Category:Tutorials]]
 
 
[[Category:Reference]]
 
[[Category:Reference]]
[[Category:Video Tutorials]]
+
[[Category:Catalogs]]

Latest revision as of 13:15, 9 May 2011


Items are catalog objects that can be equipped by units when paired with an Inventory. They can have very basic effects like adding armor to a unit, equipping a weapon to a unit, or even have more complex "on-use" effects that deal damage to a target or heal the unit.

Item itself just links several other objects together. An item consist of:

  • Button - contains the item's icon and description
  • Behavior - (optional) provides passive bonuses for item's bearer (the behavior is applied as usually, beware of stacking limits)
  • Effect or Ability - (optional) used for items with active effects
  • Weapon - (optional) used for items that give a weapon to the bearer
  • Unit - represents the unit when outside of inventory (the link goes the other way here, the unit has a field called item, which links them together)
    • Actor - obviously the item's unit needs it's own actor

Additionally, item has an item class, which is used by item containers to determine, which items can be placed in which slots.

Types

Generic

Generic items are passive, they can only give the unit behavior or weapon.

Effect - Instant

These items have, as the name suggests, an instant effect. It is possible to specify cost for use (commonly used for items with limited charges).

Effect - Target

Same as above, except uses targeted effect.

Ability

??? Can be safely used with Effec - Instant and Effect - Target abilities

Fields

Each item has several basic fields:

  • Face - Button used for this item
  • Carry Behaviors/Weapons - Behaviors/Weapons added to unit when carrying the item
  • Equip Behaviors/Weapons - Behaviors/Weapons added to unit when the item is equipped

(Some slot in inventory can be marked to not equip the item (storage slots), items in this slots will provide only carry bonuses.) For more info, see Item containers.

  • Container - items can be used as further item containers, containing other items. See Item containers