Creating a weapon item

From HIVE
Jump to navigation Jump to search

For this tutorial, we will create an item that will attach a Marauder's "Punisher Grenades" to a Marine.

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.

Creating the Item Class

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."

  1. 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.

That's all you have to do here, since we're only making a weapon item.

Creating the Item's Button

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.

  1. 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.
  2. 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.

Creating 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.

  1. In the box on the right, find "Class" and change that to "WeaponClass."
  2. 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.
  3. 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.

  1. 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.

  1. Above the box on the right, find "Unit Name" and set that to "Punisher Grenade Launcher."
  2. 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 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.
  3. 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.
  4. Now find "Event - Events+" and double-click the space on the right of it to open an "Object Values" window.
    1. 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)."
    2. Now click the "ActionImpact" under the "UnitBirth.PunisherGrenadeLauncher" Event. Set the "Msg Type:" to "Create."
    3. Click "OK" to close the window.
  5. Find "UI - Unit Icon" and set that to "decalhazard03_diffuse.dds." Note: If you have the Campaign Dependencies, you can find a better selection to choose from.
  6. 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."

ItemWeapon.png

See Also

Video Tutorial

Credits for this video goes to OneTwo. <youtube>0ZH8Bx9jtcs</youtube>