Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 11:39:57 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Burst Fire?
Pages: [1]
Author Topic: Burst Fire?  (Read 5427 times)
Domineeto
Poster

Posts: 3


« on: July 21, 2010, 03:54:32 AM »

I began making a custom weapon for TTT earlier today and it works perfectly other than the fact that I don't know how to make it burst fire. Here's the code:
---- Example TTT custom weapon

-- First some standard GMod stuff
if SERVER then
  AddCSLuaFile( "shared.lua" )
end

if CLIENT then
  SWEP.PrintName = "Decimator"
  SWEP.Slot      = 6 -- add 1 to get the slot number key

  SWEP.ViewModelFOV  = 72
  SWEP.ViewModelFlip = true
end

-- Always derive from weapon_tttbase.
SWEP.Base = "weapon_tttbase"

--- Standard GMod values

SWEP.HoldType = "pistol"

SWEP.Primary.Delay      = 0.03
SWEP.Primary.Recoil      = 3.5
SWEP.Primary.Automatic  = true
SWEP.Primary.Damage      = 20
SWEP.Primary.Cone        = 0.01
SWEP.Primary.Ammo        = "smg1"
SWEP.Primary.ClipSize    = 15
SWEP.Primary.ClipMax    = 30
SWEP.Primary.DefaultClip = 15
SWEP.Primary.Sound      = Sound( "Weapon_tmp.Single" )

SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 )
SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 )

SWEP.ViewModel  = "models/weapons/v_smg_tmp.mdl"
SWEP.WorldModel = "models/weapons/w_smg_tmp.mdl"


--- TTT config values

-- Kind specifies the category this weapon is in. Players can only carry one of
-- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP or ROLE.
-- The last two will not auto pickup when a player walks over them.
SWEP.Kind = WEAPON_EQUIP

-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP, then this gun can
-- be spawned as a random weapon. Of course this AK is of the type WEAPON_EQUIP,
-- but for the sake of example this is set to false anyway.
SWEP.AutoSpawnable = false

-- The AmmoEnt is the ammo entity that can be picked up when carrying this gun.
SWEP.AmmoEnt = "item_ammo_smg1_ttt"

-- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If
-- a role is in this table, those players can buy this.
SWEP.CanBuy = { ROLE_TRAITOR }

-- InLoadoutFor is a table of ROLE_* entries that specifies which roles should
-- receive this weapon as soon as the round starts. In this case, none.
SWEP.InLoadoutFor = nil

-- If LimitedStock is true, you can only buy one per round.
SWEP.LimitedStock = false

-- If AllowDrop is false, players can't manually drop the gun with Q
SWEP.AllowDrop = true

-- If IsSilent is true, victims will not scream upon death.
SWEP.IsSilent = true

-- If NoSights is true, the weapon won't have ironsights
SWEP.NoSights = true

-- Equipment menu information is only needed on the client
if CLIENT then
  -- Path to the icon material
  SWEP.Icon = "VGUI/ttt/icon_decimator"

  -- Text shown in the equip menu
  SWEP.EquipMenuData = {
      type = "Weapon",
      desc = "A heavily modified TMP, with a 5 round burst to prevent it from over-heating. Quickly and silently dispose of the innocents, although a side effect of its awesome power is a high recoil."
  };
end

-- Tell the server that it should download our icon to clients.
if SERVER then
  -- It's important to give your icon a unique name. GMod does NOT check for
  -- file differences, it only looks at the name. This means that if you have
  -- an icon_ak47, and another server also has one, then players might see the
  -- other server's dumb icon. Avoid this by using a unique name.
  resource.AddFile("VGUI/ttt/icon_decimator.vmt")
end

If no one knows how to I'll just lower the damage and increase the time between shots and I guess it will be okay.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: July 21, 2010, 08:28:00 AM »

Burst fire is fairly complex, you can't do it by just changing values here and there, it requires a bunch of code in various parts of the weapon.

One way to emulate it in an easy way might be a very small clip, like 10 bullets, with a high firing rate.
bigbadboo
Poster

Posts: 287


« Reply #2 on: July 21, 2010, 11:26:04 AM »

Could you not looked at the lua coded version of the glock?
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #3 on: July 21, 2010, 11:37:28 AM »

GMod's version of the Glock does not have burst fire either.
bigbadboo
Poster

Posts: 287


« Reply #4 on: July 21, 2010, 12:21:26 PM »

http://www.garrysmod.org/downloads/?a=view&id=42996

This apparently has burst fire. Also I stand corrected.
Kologer0s
Poster

Posts: 48


« Reply #5 on: July 21, 2010, 05:35:22 PM »

That's not a damn glock, that's a beretta :S You said glock...

http://bit.ly/Mogzcom MOGZ Gmod TTT + Killing Floor Servers
bigbadboo
Poster

Posts: 287


« Reply #6 on: July 21, 2010, 05:51:25 PM »

GMod's version of the Glock does not have burst fire either.


Also I stand corrected.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Burst Fire? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.01 seconds with 18 queries.