Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 12:20:40 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Making Melee Weapon...
Pages: [1]
Author Topic: Making Melee Weapon...  (Read 4629 times)
PandaSauce
Poster

Posts: 6


« on: November 11, 2010, 04:26:22 PM »

First off, I'm completely noob to making items.  I do use Google and find some things there so dont give me useless posts about Google, if you google it and find it great, tell me what google search words you used so I can learn what ever terms I'm not familiar with.

Everyone that we play with on our server loves one hit knifes.  But every time we fix the knife to 100dmg it get overwritten by TTT update.  So we decided to make a new knife-like weapon that was custom and wouldnt get overwritten. I'm following the TTT guide: http://ttt.badking.net/custom-weapon-guide.

I'm a little lost on a couple things.  What guies do you know of that help with making custom weapons in GMod. Here are just a couolpe of the examples I have come across in the shared.lua file alone:

Quote
SWEP.AmmoEnt = "item_ammo_<name>"
What do I do here for what is basically a knife with no ammo pickup?

Quote
SWEP.Primary.Delay       = 0.2
SWEP.Primary.Recoil      = 0
SWEP.Primary.Automatic   = true
SWEP.Primary.Damage      = 20
SWEP.Primary.Cone        = 0.1
SWEP.Primary.Ammo        = "none"
SWEP.Primary.ClipSize    = 1
SWEP.Primary.ClipMax     = 0
SWEP.Primary.DefaultClip = 45
SWEP.Primary.Sound       = Sound( "Weapon_AK47.Single" )
What do I do for this code

...and other questions.  Any help or guides would be great(please dont send links to the LUA manual, only post if you really want to help). I just want to learn about lua through working on these custom weapons right now.  thank you

EDIT: Just wanted to add a note that I'm useing the TTT knife lua to start with, but still want to know the above if anyone has some great tutorials.  thanks
« Last Edit: November 11, 2010, 04:49:41 PM by PandaSauce »
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #1 on: November 11, 2010, 07:50:37 PM »

Well, if you making a replica of the knife, but want it the old way. Copy and past the knife and rename the folder, then change the shared.lua so it matches you preferences. If you just want to learn how to make lua weapons for ttt from scratch. Then the first suggestion I make, is the above code, i.e SWEP.Delay = 0.2, etc, isn't fully required due to BKU's magnificent weapon base, but of course, you set these if you want different to that of the weapon base.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
PandaSauce
Poster

Posts: 6


« Reply #2 on: November 12, 2010, 04:12:11 PM »

I've come a long way as a nub since yesterday.  The knife turned Machete is working with full damage and kewl new icon. Because of its strangth I added new values that make sense to limit how its used and did it in a logical way, like it takes more time to pull out and put away(how are you going to whip out a mackete as quick as a knife?) and to throw it takes more time to swing(how could you throw something that big as quickly as a knife)?. But now I want more.  :D

I want it to look like a machete when held now.  I downloaded a Machete Model and am trying to figure out where it goes so that people that join our TTT server download it and get it.  Any help would be great. Where do these materials, sound, and model folders go to get downloaded?  What string of text do I use to force the download just paste the "if SERVER then" statement with added parameters??

Oh and thank you Manmax for the help.
« Last Edit: November 12, 2010, 04:15:44 PM by PandaSauce »
Fuffe
Poster

Posts: 128


Crummycradle was a mistake


« Reply #3 on: November 12, 2010, 05:23:13 PM »

I want it to look like a machete when held now.  I downloaded a Machete Model and am trying to figure out where it goes so that people that join our TTT server download it and get it.  Any help would be great. Where do these materials, sound, and model folders go to get downloaded?  What string of text do I use to force the download just paste the "if SERVER then" statement with added parameters??


Check here: http://wiki.garrysmod.com/?title=Resource.AddFile
PandaSauce
Poster

Posts: 6


« Reply #4 on: November 13, 2010, 12:03:01 AM »

I have another question for ALL. :-) at the moment when my machete is thrown it flys in the air rotaing sideways.  This direction(from what I can guess in the code) is "Right".  Sample:
function ENT:HitPlayer(other, tr)

Quote
  local range_dmg = math.max(self.Damage, self.StartPos:Distance(self:GetPos()) / 3)

  if other:Health() < range_dmg + 5 then
      self:KillPlayer(other, tr)
  elseif SERVER then
      local dmg = DamageInfo()
      dmg:SetDamage(range_dmg)
      dmg:SetAttacker(self:GetOwner())
      dmg:SetInflictor(self.Entity)
      dmg:SetDamageForce(self:EyeAngles():Forward())
      dmg:SetDamagePosition(self:GetPos())
      dmg:SetDamageType(DMG_SLASH)

      local ang = Angle(-28,0,0) + tr.Normal:Angle()
      ang:RotateAroundAxis(ang:Right(), -90)
      other:DispatchTraceAttack(dmg, self:GetPos() + ang:Forward() * 3, other:GetPos())

      if not self.Weaponised then
        self:BecomeWeapon()
      end
  end
end


Note the "ang:RotateAroundAxis".  I want it to flip end over end so I figured "Front" would work... but it didnt... anyone know how to change htis?
Rectal Exambot
Poster

Posts: 166


« Reply #5 on: November 13, 2010, 04:50:33 AM »

I would like to see a TTT mod where you can only use either all Melee.... or Melee + Bows/Darts/Crossbows
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #6 on: November 13, 2010, 09:23:14 AM »

that would be odd

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
PandaSauce
Poster

Posts: 6


« Reply #7 on: November 13, 2010, 05:26:50 PM »

I would like to see a TTT mod where you can only use either all Melee.... or Melee + Bows/Darts/Crossbows


ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm................................... ok.  Any thoughts on subject of this thread? 
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Making Melee Weapon... « 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.