Skip to content

2. Adding

EdyTheCow edited this page Apr 20, 2020 · 1 revision

Adding content to the Pointshop

The complex part! Make sure to follow all of the instructions below! Correct file formatting and naming is very important.

Creating the lua file

  • Copy the template file and paste the SWEP tool contents into the copied template.
  • Replace SWEP keyword with ITEM

Example

File name: 0_1_bomb_head.lua

ITEM = {}

ITEM.ClassName = "0_1_bomb_head"
ITEM.Name = "Bomb Head"
ITEM.Description = "It's looking bomb!"
ITEM.Model = "models/Combine_Helicopter/helicopter_bomb01.mdl"

ITEM.PointsCost = 100
ITEM.PremiumPointsCost = 0

ITEM.FocusPart = "head"

ITEM.WElements = {
	["base"] = { type = "Model", model = "models/Combine_Helicopter/helicopter_bomb01.mdl", bone = "ValveBiped.Bip01_Head1", rel = "", pos = Vector(1.557, -0.519, 1.557), angle = Angle(-1.17, 5.843, -90), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}

SH_POINTSHOP:RegisterItem(ITEM)
Option Description
ITEM.ClassName Class name has to follow the file naming conventions listed below. The class name normally always matches the file name.
ITEM.Name Name is what is going to be displayed inside the Pointshop interface
ITEM.Description Item's description
ITEM.Model Model path, has to match the model path from SCK's copied code
ITEM.PointsCost The amount of points the item costs
ITEM.FocusPart Which part should Pointshop's interface be focused at when displaying the item. Normally matches whatever bone you have chosen.

File naming conventions

❗It's very important to follow these naming conventions, failure to follow them will result in content not being accepted.

Folder example - 2_1273191703_super_mario_hats

Part Description
2 Folder ID, used to identify content
1273191703 Steam workshop addon ID
super_mario_hats Simple name for the content

Note: any default models which do not require additional addons will always use folder ID of 0!

File example - 2_1_astronaut_helmet.lua

Part Description
2 Item ID, must match folder ID!
1 Represents item type
astronaut_helmet Simple name for the item

Item types

ID Category Description
1 Hats and masks Anything that goes on player's head
2 Accessories Anything that's not a hat or mask
3 Trails Stuff that follows you back home
4 Player models Well.. player models

Currently being used content

Folder ID Workshop ID Folder Name Workshop Title
0 None default Default models
1 1426577189 crash Crash: N. Sane Trilogy pack
2 1273191703 super_mario_hats Super Mario Odyssey Hats
3 130241144 one_piece_hats One Piece Hats and Misc Pack
4 129736354 roblox_hats Roblox Hats Pack