How do you copy an addon and make changes?

Let’s say you have a vehicle addon. You download the addon and the you extract it using gma and then unsubscribe from the addon. You should still have the folder and it should still work. Check. You make changes to the skin.vmt/vtf files and make a new spawn menu entry.

How do you duplicate this process for the same truck but let it have different skins? Changing the script for the spawn menu is easy but the skins change the same. Without using a hex editor or recompiling the model, how do I change the skin? Please outline the exact process for me.

Also, if someone can refer me to a good tutorial specifically address pathing issues for gamemodes and addons, I would really appreciate it. I don’t know what folder overrides what and what folder to make changes in, for example, people say the path in lua is relative to game mode folder…then why does putting a skin file in that path do nothing but it works when it put it in the garrysmod materials folder?

Every folder in garrysmod/addons is ‘mapped’ to the main garrysmod folder. I know that the lua and material folders are mapped, I’m not sure what other folders can be accessed through an addon. Gamemodes are slightly different. garrysmod/gamemodes/yourgamemode/content is ‘mapped’ to the garrysmod folder, but only the maps, materials, models, and sounds. This is why you couldn’t put a skin file in just the gamemode folder, it would need to go in yourgamemode/content/materials.

Okay, it makes more sense now. Thank you. Now, when you are writing a script to spawn a custom vehicle, how would you use ent.Create to spawn a custom vehicle with an additional script like photon lighting?

In my init file : I only get so far…it’s not drivable or painted…very odd


	local ent = ents.Create("prop_vehicle_jeep")
	ent.VehicleTable = 0x347fa2c8
	ent:SetModel ("models/sentry/caison_fire.mdl")
	ent:SetPos(hit)
	ent:Spawn()