Third Party Support - Jackarunda/gmod GitHub Wiki

In your own addon, you can add new armor to the JMod armor table using the following method:

JMod.AdditionalArmorTable = JMod.AdditionalArmorTable or {}

JMod.AdditionalArmorTable["my new piece"] = {
	PrintName = "CONE",
	mdl = "models/props_junk/trafficcone001a.mdl",
	mat = "models/mat_jack_gmod_trafficcone",
	clr = { r = 240, g = 120, b = 0 },
	slots = {
		head = .7, -- fractional coverage of this slot
	},
	def = NonArmorProtectionProfile, -- which (local) damage-type protection profile table
	bon = "ValveBiped.Bip01_Head1",
	siz = Vector(.85, .85, .85),
	pos = Vector(-3.5, 15.5, 0),
	ang = Angle(-90, 18, 0),
	wgt = 4,
	dur = 10,
	mskmat = "mats_jack_gmod_sprites/one-quarter-from-top-blocked.png", -- optional, if this armor has a HUD overlay
	ent = "ent_jack_gmod_ezarmor_trafficcone" -- whichever entity you want to be created for this
}

-- rinse and repeat

Place this in any SHARED file that runs before InitPostEntity (autorun works well) and its contents will be merged with the default jmod armor table. It is recommended that you look at the jmod armor table to know how to construct the data for an armor piece.

Likewise, you can add a backup repair recipe for your armor piece in your addon if you don't want to add a crafting recipe to the jmod config.

JMod.BackupArmorRepairRecipes = JMod.BackupArmorRepairRecipes or {}

JMod.BackupArmorRepairRecipes["My Armor Piece"] = {
    basic parts = 100
}

Gas- or toxic-particle- based weapons

If you're trying to get your bioweapons from your addon to work properly with jmod's gasmasks or suits, you can use the shared convenience functions:

local FaceProtection, SkinProtection = JMod.GetArmorBiologicalResistance(ply, typ)

which takes a player and the type of resistance you're trying to gauge. The only supported types are DMG_NERVEGAS and DMG_RADIATION. JMod's default armors assume that DMG_RADIATION is some kind of particulate-based toxin, like radioactive fallout or virus particles, whereas DMG_NERVEGAS is a molecular vapor. The function returns FaceProtection and SkinProtection as a tuple, where 0 is no protection and 1 is perfect protection for each. Likewise, you can easily deplete the armor's chemical charge (like for gasmasks, respirators and simple hazmat suits) by calling:

JMod.DepleteArmorChemicalCharge(ply, amt)

Keep in mind that the amt should generally be a very small amount, like .02. Most the JMod chemical air filters only have a chem charge on the order of a dozen or so.

Custom Icon Support

WARNING: This section is for advanced server owners/developers that use Jmod extensively beyond just adding it to their server in order to create a unique experience for their players.

As of June 19th, 2022, it is possible to add custom icons for craftables and packages that display directly to the left of each item's name.

To do so, you must either create a new content pack addon or use an existing content pack addon for your server, or client if running in SP, with the icons in PNG format with the following path: materials/entities/my_entity_class_name.png OR materials/jmod_selection_menu_icons/Order Name.png. Order Name is cAsE seNsiTivE, while my_entity_class_name is not.

To make a new WS addon, make a folder and name it something you can find easily, such as "My Server's Content Pack".

After that is done, you want to make a folder called materials, and then follow the path/naming format above for creating icons. The icons can be anything you wish them to be, as long as they are in PNG format.

Crowbar is highly recommended due to its many features and ease of use thanks to its UI, so go ahead and install it on your machine. Once that is done, go to the Publish tab and click "Add Item". Fill out the form below, browse to your addon's location, choose a preview icon for your addon, then click "Publish". After the addon is published, check your Workshop files page on the Steam Workshop to find your addon, and then add it to your server or subscribe to it if running in SP.

Voila! You now have icons for your craftables and/or packages. To add new ones, simply add new PNGs while following the path/naming format.