-
Notifications
You must be signed in to change notification settings - Fork 1
Battery Base Template
Vuthakral edited this page Sep 4, 2019
·
3 revisions
On this page you can find a template for a working Halo-style plasma gun with ironsights capability. I highly recommend you copy and paste the first code block without comments, and then use the rest of the page here as reference for what each setting does.
NOTE : The explanation code at the bottom will ONLY cover settings for the battery base on this page. If you need information on what the base gun functions do, please go see the Gun Base Template page
Start by making a new lua file in your lua\weapons\ folder and name it what you want. e.g. yourname_plasmagunname, or in Draconic's case, drc_example_plasmagun.
SWEP.Base = "draconic_battery_base"
SWEP.Gun = "draconic_plasmagun_example"
SWEP.HoldType = "smg"
SWEP.Category = "Draconic Examples"
SWEP.PrintName = "Plasma Gun Example"
SWEP.Auhtor = "Vuthakral"
SWEP.Contact = " https://discord.gg/6Y7WXrX // Steam: Vuthakral // Disc: Vuthakral#9761 "
SWEP.Purpose = "Example weapon for the 'battery' base of DSB"
SWEP.Instructions = ""
SWEP.Spawnable = true
SWEP.AdminSpawnable = false
SWEP.AutoSwitchTo = false
SWEP.Weight = 1
SWEP.DeploySpeed = 1
SWEP.Slot = 2
SWEP.SlotPos = 0
SWEP.ViewModelFOV = 54
SWEP.ViewModelFlip = false
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/cstrike/c_shot_xm1014.mdl"
SWEP.WorldModel = "models/weapons/w_shot_xm1014.mdl"
SWEP.VMPos = Vector(0, 0, 0)
SWEP.VMAng = Vector(0, 0, 0)
SWEP.IronSightsPos = Vector(-6.861, -10.429, 2.671)
SWEP.IronSightsAng = Vector(-0.5, -0.84, 0)
SWEP.SS = 1
SWEP.BS = 1
SWEP.DisperseHeatPassively = true
SWEP.CanOverheat = true
SWEP.CanVent = true
SWEP.LowerRPMWithHeat = true
SWEP.DoOverheatDamage = true
SWEP.DoOverheatAnimation = false
SWEP.DoVentingAnimation = false
SWEP.DoOverheatSound = true
SWEP.DoVentingSound = true
SWEP.OverheatSound = Sound("draconic.OverheatGeneric")
SWEP.VentingSound = Sound("draconic.VentGeneric")
SWEP.VentingStartSound = Sound("draconic.VentOpenGeneric")
SWEP.VentingStopSound = Sound("draconic.VentCloseGeneric")
SWEP.OverheatHoldType = "knife"
SWEP.VentingHoldType = "slam"
SWEP.OverheatDamagePerInt = 1
SWEP.HPS = 6
SWEP.HeatLossInterval = 0.1
SWEP.HeatLossPerInterval = 1
SWEP.OverheatStrength = 2
SWEP.OverHeatFinishPercent = 0.32
SWEP.VentingStrength = 4
SWEP.HeatRPMmin = 400
SWEP.BatteryConsumPerShot = 0.5
SWEP.Primary.NumShots = 1
SWEP.Primary.Spread = 12
SWEP.Primary.SpreadDiv = 200
SWEP.Primary.Kick = 0.36
SWEP.Primary.RecoilUp = 0.3
SWEP.Primary.RecoilDown = 0.3
SWEP.Primary.RecoilHoriz = 25
SWEP.Primary.Force = 0.2
SWEP.Primary.Damage = 12
SWEP.Primary.RPM = 700
SWEP.Primary.Automatic = true
SWEP.Primary.Tracer = 1 -- https://wiki.garrysmod.com/page/Enums/TRACER
SWEP.Primary.Sound = Sound("draconic.PewPew")
SWEP.Secondary.Ironsights = true
SWEP.Secondary.Scoped = false
SWEP.Secondary.SightsSuppressAnim = true
SWEP.Secondary.IronFOV = 80
SWEP.NPCBurstShots = 8
SWEP.JackalSniper = false
- SWEP.DisperseHeatPassively // Whether or not the weapon will disperse heat passively over time.
- SWEP.CanOverheat // Whether the weapon can overheat or not
- SWEP.CanVent // Whether the weapon can be manually vented or not by holding the reload key
- SWEP.LowerRPMWithHeat // Whether or not the weapon's RPM lowers with the heat of the gun
- SWEP.DoOverheatDamage // Whether or not the weapon should damage the user if it overheats
- SWEP.DoOverheatAnimation // Whether or not the weapon should play animations when overheating
- SWEP.DoVentingAnimation // Whether or not the weapon should play animations when manually venting.
- SWEP.DoOverheatSound // Whether the weapon should play a scripted sound when overheating or not
- SWEP.DoVentingSound // Whether the weapon should play a scripted sound when venting (MUST BE A SCRIPTED SOUND OR ADDED WITH SOUND.ADD!)
- SWEP.OverheatSound // Sound to play when the weapon overheats
- SWEP.VentingSound // Sound to play when the weapon is venting (MUST BE A SCRIPTED SOUND OR ADDED WITH SOUND.ADD!)
- SWEP.VentingStartSound // Sound to play when a weapon starts to vent
- SWEP.VentingStopSound // Sound to play when a weapon stops venting
- SWEP.OverheatHoldType // Holdtype to switch to while overheated
- SWEP.VentingHoldType // Holdtype to switch to while manually venting
- SWEP.OverheatDamagePerInt // Amount of damage the user should take when the weapon overheats, if SWEP.DoOverheatDamage == true every interval.
- SWEP.HPS // "Heat Per Shot", how much heat is generated on the weapon per shot.
- SWEP.HeatLossInterval // How long the interval is for the heat to vent (default 0.1 AKA 1/10ths of a second).
- SWEP.HeatLossPerInterval // Heat passively dispersed per interval, if SWEP.DisperseHeatPassively == true.
- SWEP.OverheatStrength // Multiplier. How much heat should be dispersed if the weapon overheats. (Math is SWEP.OverheatStrength times SWEP.HeatLossPerInterval)
- SWEP.OverHeatFinishPercent // The percentage (from 100) that the weapon finishes overheating at. (default 0.17, means at 83% heat the weapon is finished overheating.)
- SWEP.VentingStrength // Also a multiplier. How much heat should be dispersed if the player is manually venting. (Math is SWEP.VentingStrength times SWEP.HeatLossPerInterval)
- SWEP.HeatRPMmin // The minimal RPM the SWEP should drop to when fully heated if SWEP.LowerRPMWithHeat == 1
- SWEP.BatteryConsumPerShot // How much of the battery should be consumed per shot? 1 = 1%, 0.5 = 0.5%. Default value is 0.5. // Example: 0.5 = 200 shots before running out of power.