Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2024, 09:15:33 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

  Show Posts
Pages: [1]
1  Other / Trouble in Terrorist Town / TTT Defibrillator, can it be done? on: March 01, 2012, 06:42:17 AM
Heres what I've scooped off the internet from some anon.

if SERVER then
  AddCSLuaFile( "shared.lua" )
  resource.AddFile("models/weapons/v_defilibrator.mdl")
  resource.AddFile("models/weapons/v_defilibrator.dx90.vtx")
  resource.AddFile("models/weapons/v_defilibrator.dv80.vtx")
  resource.AddFile("models/weapons/v_defilibrator.vtx")
  resource.AddFile("models/weapons/v_defilibrator..sw.vtx")
  resource.AddFile("models/weapons/v_defilibrator.vvd")
  resource.AddFile("materials/models/weapons/v_defilibrator/Paddle.vmt")
  resource.AddFile("materials/models/weapons/v_defilibrator/v_hand_sheet.vmt")
  resource.AddFile("materials/models/weapons/v_defilibrator/v_hand_sheet_normal.vmt")
  resource.AddFile("materials/vgui/ttt/icon_sourcetribe_defib.vmt")
  resource.AddFile("sound/ttt/ael.wav")
  resource.AddFile("sound/ttt/leeroy_boom.wav")
  resource.AddFile("sound/ttt/DefendThisPosition.wav")
end


if CLIENT then
  SWEP.PrintName = "Defibrillator"
  SWEP.Slot = 6

  SWEP.ViewModelFOV = 10

  SWEP.EquipMenuData = {
      type = "item_weapon",
      desc =
[[Revives you allies.]]
  };

  SWEP.Icon = "vgui/ttt/icon_AM_defib"
end

SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_defilibrator.mdl"
--SWEP.WorldModel = ""
SWEP.ShowViewModel = true
SWEP.ShowWorldModel = false

--[[SWEP.VElements = {
["microwave"] = { type = "Model", model = "models/props/cs_office/microwave.mdl", bone = "ValveBiped.Bip01", pos = Vector(11.019, -21.619, 15.625), angle = Angle(-3.57, 8.512, -90.644), size = Vector(0.4, 0.4, 0.4), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}--]]

SWEP.Base = "weapon_tttbase"

SWEP.DrawCrosshair      = false
SWEP.Primary.ClipSize      = -1
SWEP.Primary.DefaultClip    = -1
SWEP.Primary.Automatic      = false
SWEP.Primary.Ammo      = "none"
SWEP.Primary.Delay = 1.0

SWEP.Secondary.ClipSize    = -1
SWEP.Secondary.DefaultClip  = -1
SWEP.Secondary.Automatic    = false
SWEP.Secondary.Ammo    = "none"
SWEP.Secondary.Delay = 1.0

SWEP.Kind = WEAPON_EQUIP
SWEP.CanBuy = {ROLE_DETECTIVE}
SWEP.LimitedStock = true
SWEP.WeaponID = AMMO_DEFIB
SWEP.AllowDrop = false
SWEP.NoSights = true

if CLIENT then
function SWEP:GetViewModelPosition ( Pos, Ang )
Pos = Pos + Ang:Up() * 6

return Pos, Ang
end
end

function SWEP:Initialize()
self:SetWeaponHoldType("normal")
end
if SERVER then
function SWEP:PrimaryAttack()
local EyeTrace = self.Owner:GetEyeTrace()
local Distance = self.Owner:EyePos():Distance(EyeTrace.HitPos)

if Distance > 75 then return false end
if ValidEntity(EyeTrace.Entity) and EyeTrace.Entity:GetClass() == "prop_ragdoll" then
local ply = CORPSE.GetPlayer(EyeTrace.Entity, false)
if ply then
if ply:GetRole() == ROLE_TRAITOR then self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: This is not an innocent!") return end

local time = 25
if ( ply:GetNWString("DonorStatus", Guest)== "Bronze") then time = 40
elseif ( ply:GetNWString("DonorStatus", Guest)== "Silver") then time = 75
elseif ( ply:GetNWString("DonorStatus", Guest)== "Gold") then time = 150
elseif ( ply:GetNWString("DonorStatus", Guest)== "Diamond") then time = 250
elseif ( ply:GetNWString("DonorStatus", Guest)== "Platinum") then time = 500
elseif ( ply:GetNWString("DonorStatus", Guest)== "CoOwner") then time = 1000
elseif ( ply:GetNWString("DonorStatus", Guest)== "Founder") then time = 1000000
end
if (tonumber(ply.DiedTime) + time) < CurTime() then self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: Player has been dead for more than "..time.." seconds!") return end

local ent = EyeTrace.Entity
local player = self.Owner
self.Owner:Freeze(true)
self.Owner:EmitSound("AM/DefendThisPosition.wav", 150, 100)
timer.Simple(4, function() if player:Alive() then self.Owner:EmitSound("AM/ael.wav", 150, 100) end end)
timer.Simple(5, function()
if player:Alive() then
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self.Owner:Freeze(false)
self.Owner:EmitSound("AM/leeroy_boom.wav", 100, 100)
ply:SpawnForRound(true)
ply:SetPos(ent:GetPos())
ply.ShouldntCollide = true
timer.Simple(5, function() ply.ShouldntCollide = false end)
ent:Remove()
self:Remove()
end
end)

else
self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: Unable to retrieve player/ player is not an innocent.")
end
else
self.Owner:PrintMessage(HUD_PRINTTALK, "ERROR: This is not a corpse!")
end
end
end


hook.Add("ShouldCollide", "PlayerDefib", function(ent1, ent2)
if ent1:IsPlayer() and ent2:IsPlayer() then
if ent1.ShouldntCollide then
return false
elseif ent2.ShouldntCollide then
return false
end
end
end)

function SWEP:SecondaryAttack()
  return false
end

function SWEP:Reload()
  return false
end


Ignore the stupid sounds, I just added them as temps. It doesnt work however. It just doesnt revive.

I would like to end up making there be a 10% chance of the revived turning traitor.... but that is way over my head!
2  Other / Trouble in Terrorist Town / Re: TTT Icon Issue on: March 01, 2012, 06:39:00 AM
-sigh-
To fix the "downloading icon but not actually downloading it" problem, you need to do the following:
It seems as if you have a fastdl enabled, if so then it doesn't take items out of the addons folder.
To make it download, place the icons inside materials/vgui/ttt or whatever spot instead of addons.

That worked for me.


Did you read my post? it was in said directory. Its not in my addons at all. I fixed it however by creating a servernamed folder in materials, and directing it all to that. Thanks for the help Mr. Gash!
3  Other / Trouble in Terrorist Town / Re: TTT Icon Issue on: February 29, 2012, 02:29:10 AM
I fixed the sounds, the file path in the lua needed a path update, thanks for the idea.

As for the icons, I changed the location of the files to VGUI/LA, instead of vgui/ttt. I changed EVERY line associated with capital VGUI/LA to vgui/la: In the resource.Addfile, Swep.icon lines, and even in the vmts.
4  Other / Trouble in Terrorist Town / Re: TTT Icon Issue on: February 29, 2012, 01:36:39 AM
The gun is still trying to play it from the sound/ folder. You need to change the code to play it from sound/LA/ (then again probably just LA/ since it already reads it from the sound/ directory), as for the materials, did you change the lua file that has the resource.AddFile lines to download the materials from the other directory (materials/vgui/LA)?


Heres my resource from my spider gun, each resource.addfile is in each gun's shared.lua,a ll like this:
if SERVER then
  AddCSLuaFile( "shared.lua" )
  resource.AddFile("materials/VGUI/LA/icon_zeph_spider.vmt")
end

  SWEP.Icon = "VGUI/LA/icon_zeph_spider"
5  Other / Trouble in Terrorist Town / Re: TTT Icon Issue on: February 28, 2012, 09:58:43 PM
It's because you put them in "vgui/ttt/". Take them out of the "ttt" folder and put them somewhere else, then it should work.


Thanks for the response Mr. Gash.
I moved the icons to garrysmod/materials/vgui/LA
Sounds to: garrysmod/sound/LA

I changed the resource locations for all icons and sounds. It DID download the sounds, but when using the spidy gun in game I get:
Failed to load sound "to_far.wav", file probably missing from disk/repository (FOR ALL SPIDY SOUNDS)

The icons are doing the samething, re-"downloading" each rejoin while not truly downloading it
6  Other / Trouble in Terrorist Town / TTT Icon Issue on: February 28, 2012, 05:55:25 PM
Hi there, new to the forums and (somewhat) new to coding TTT. I've had a server for a while and haven't been able to get the icons to work. Since its a cosmetic problem I put it low on my todos, but recently I have spent HOURS trying to figure it out. I have browsed several forums and post and tried troubleshooting methods described in them but to no avail. I'm finally ready to bring the issue to the pros.

I have a few custom sweps. They all work perfectly except for the icons. I had my gfx artist make some icons. I stressed how important it was to follow the guide step by step from badking.net, and not to miss a single instruction (format, etc).
I got the vtfs from him and uploaded it via ftp to my garrysmod/materials/vgui/ttt folder (NOT the vgui/ttt folder in the gamemodes/terrortown, fyi).

I then created a file with the same name, .vmt, and added the lines provided in the tutorial with the correct pathname, using icon_armor.vmt as a template.

I then added the resource.addfile lines to the resources.lua (format identical to the ones already provided by BK.

Right now it is constantly asking me to download the files everytime I join., and the icons ofc dont work

Here the line from my resource.lua:
resource.AddFile("materials/VGUI/ttt/icon_zeph_minigun.vmt")
icon_zeph_minigun.vmt (and .vtf) are in materials/VGUI/ttt/

I says it is downloading materials/VGUI/ttt/icon_zeph_minigun.vmt, and materials/VGUI/ttt/icon_zeph_minigun.vtf.bz2 (or something like that) everytime I join

UPDATE:

I manually added teh vtf and vmts to my personal directory and they work (this didnt happen before, but i changed some coding)

The filenames/directory are still the same however, and they will not work with my fast DL. The keep redownloading for everyone else.  Websyncing (NFO servers) will add the files to my fast DL site (http://lethalaggression.site.nfoservers.com/server).

I dont know why it wont download for them, any ideas?
Pages: [1]


Login with username, password and session length

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