• New TTT Server issues
    15 replies, posted
So I have been trying to set up my TTT server with a host of addons and whatnot, but am experiencing a bunch of issues both small and large. The first issue is M9K Weapons. I have them spawning on the map, but you cannot pick them up so I cannot test them. The second is some playermodels aren't showing up at all in the pointshop and a few that do are errors for me(despite having them on my client) The third is when you used the flashlight or change weapons, there is no sound for these actions The fourth is certain items in the T shop and D shop aren't showing up, one in the D shop creates lua errors And the fifth, occasionally when someone joins, the server ping goes to shit briefly pls help
Can't really help with this little details but, how are you gettng the M9K weapons to TTT? Can we see the playermodels that are appearing as errors on the Pointshop menu and their related workshop link or model download? I don't think changing weapons makes sounds, depends on the weapon you switch to/switch from, and about the flashlight, I don't remembering it making a sound in TTT. And, about the T and D shop items not appearing. Can you tell us what Items aren't appearing on the store and which ones are creating errors?
donald.lua -Workshop ID 722374307 draven.lua -Workshop ID 464838417 weiss.lua -Workshop ID 575962788 These models are errors, as it turned out the models not showing up was due to missing quotations. Workshop ID 295735248 | Detective Grappling Hook This D shop weapon is causing LUA errors Workshop ID 254177214 | Traitor Jihad Bomb Workshop ID 162581348 | Traitor Defibrillator These T shop weapons are not showing up in the T shop(no script errors in console) As for M9K, I have the individual weapon files in terrortown/entities/weapons (ex. weapon_m9k_amd65.lua) and the weapon placement file in maps (ex. ttt_bb_teenroom_b2_ttt.txt) The weapons show up on the map, but cannot be equipped. You can move them and throw them like normal props and entities via magneto stick.
Looks like you've just tried sticking the weapons into the gamemode without any edits done to them. TTT disallows players form picking up weapons unless it knows it's a valid TTT weapon, because valid TTT weapons have a bunch of additional code unique to TTT. Hence why they're "TTT weapons" and not just general "weapons." You're not going to be able to get M9K to work in TTT unless you make edits to the weapon files and the weapon base of M9K to include the necessary values and functions TTT needs to allow you to pick up the weapon.
I've taken a small look at the playermodels and it seems they're errors because you got the path to them wrong. For example, the Donald trump model: It's actual path: https://files.facepunch.com/forum/upload/1348/6768967a-20f3-4489-aad9-cb4100098058/image.png Vs donald.lua: https://files.facepunch.com/forum/upload/1348/5881be4d-0c1b-4187-9b28-99e82b965f42/image.png It's 'models', not 'model' If a workshop item is giving errors and not appearing on the shop that probably means it's broken. Unless you know how to modify it and fix it by yourself, i'd recommend you removing it. I don't know how the defibrillator isn't appearing on your shop but I have that same exact addon and it appears on it. Are you sure you're mounting it right? And, what version of TTT are you running? Maybe the items don't appear because either something is overriding them or you've got a custom TTT version or a custom loadout menu.
I'm running the default version of TTT, no custom menu. I'll look at the player models again and fix their paths. Do you happen to know how to get the pointshop to arrange items by cost instead of alphabetically, by chance?
a lot, so it sounds like you'll be in over your head.
I ran a server once with them, but it's been awhile. I haven't remembered anything from then.
weapon_m9k_famas.lua weapon_m9k_intervention.lua weapon_m9k_spas12.lua weapon_m9k_amd65.lua I got them so that you can pick them up now, but they are all kinds of busted. The famas shared the same stats as the amd when they have different numbers in the code. The intervention is semi-automatic instead of bolt action and isn't accurate at all. The spas12 does not go through reload animations or reload and cannot ads. I finally got them to be picked up, but man they are busted.
As @Deathking15 told you, those weapons you just sent us aren't adapted for TTT, therefore why they aren't working for you, as it seems you just copied them and pasted them inside the terrortown gamemode folder.
Okay.... what about this? weapon_m9k_intervention.lua Did I finally do it right? Seems to work on the server.
in gamemodes\terrortown\entities\weapons you will find dozens of examples on how to set up the weapon file for TTT. I would recommend copy/pasting from a sample weapon, such as the pistol or M16, and analyzing the various stuff in it to figure out what to change for your new weapons. I'll go ahead and make the intervention for you, based purely on the rifle. The is the most simple method for converting SWEPs into TTT format. I would highly recommend you do this. Yes, you can just add what you need to the M9K weapon, but that M9K file will contain a lot of extraneous crap that you don't need for TTT. Hope this helps. AddCSLuaFile() --NOTE: The M9K file will contain all sorts of information you can use to help you do this: it will probably have the iron sights information, FOV information, FOV while zoomed information, and all sorts of shit.  --Take what you need from the M9K file and apply it to your various TTT weapons. SWEP.HoldType              = "ar2" if CLIENT then    SWEP.PrintName          = "Intervention" --changed from rifle_name    SWEP.Slot               = 2    SWEP.ViewModelFlip      = false    SWEP.ViewModelFOV       = 54 --Increased from 54 to match weapon_m9k_intervention    SWEP.Icon               = "vgui/ttt/icon_scout" --You will want to make your own icon for the gun    SWEP.IconLetter         = "n" end SWEP.Base                  = "weapon_tttbase" SWEP.Kind                  = WEAPON_HEAVY SWEP.WeaponID              = AMMO_RIFLE SWEP.Primary.Delay         = 1.5 --I did literally 0 balancing, you set this up how you want SWEP.Primary.Recoil        = 7 SWEP.Primary.Automatic     = true SWEP.Primary.Ammo          = "357" SWEP.Primary.Damage        = 50 SWEP.Primary.Cone          = 0.005 SWEP.Primary.ClipSize      = 10 SWEP.Primary.ClipMax       = 20 SWEP.Primary.DefaultClip   = 10 SWEP.Primary.Sound         = Sound("Weapon_INT.Single") --Sound taken from the M9K file SWEP.Secondary.Sound       = Sound("Default.Zoom")  SWEP.HeadshotMultiplier    = 4 SWEP.AutoSpawnable         = true SWEP.Spawnable             = true SWEP.AmmoEnt               = "item_ammo_357_ttt" --ammo 357 is just sniper ammo SWEP.UseHands              = true SWEP.ViewModel             = Model("models/weapons/v_snip_int.mdl") --model the player will see, taken from the M9K file SWEP.WorldModel            = Model("models/weapons/w_snip_int.mdl") --model other people will see, taken from M9K file SWEP.IronSightsPos         = Vector( 5, -15, -2 ) SWEP.IronSightsAng         = Vector( 2.6, 1.37, 3.5 ) --These 2 lines define where the iron sight position is. You may need to raise/lower this. function SWEP:SetZoom(state)    if IsValid(self:GetOwner()) and self:GetOwner():IsPlayer() then       if state then          self:GetOwner():SetFOV(20, 0.3)       else          self:GetOwner():SetFOV(0, 0.2)       end    end end function SWEP:PrimaryAttack( worldsnd )    self.BaseClass.PrimaryAttack( self.Weapon, worldsnd )    self:SetNextSecondaryFire( CurTime() + 0.1 ) end -- Add some zoom to ironsights for this gun function SWEP:SecondaryAttack()    if not self.IronSightsPos then return end    if self:GetNextSecondaryFire() > CurTime() then return end    local bIronsights = not self:GetIronsights()    self:SetIronsights( bIronsights )    self:SetZoom(bIronsights)    if (CLIENT) then       self:EmitSound(self.Secondary.Sound)    end    self:SetNextSecondaryFire( CurTime() + 0.3) end function SWEP:PreDrop()    self:SetZoom(false)    self:SetIronsights(false)    return self.BaseClass.PreDrop(self) end function SWEP:Reload() if ( self:Clip1() == self.Primary.ClipSize or self:GetOwner():GetAmmoCount( self.Primary.Ammo ) <= 0 ) then return end    self:DefaultReload( ACT_VM_RELOAD )    self:SetIronsights( false )    self:SetZoom( false ) end function SWEP:Holster()    self:SetIronsights(false)    self:SetZoom(false)    return true end if CLIENT then    local scope = surface.GetTextureID("sprites/scope")    function SWEP:DrawHUD()       if self:GetIronsights() then          surface.SetDrawColor( 0, 0, 0, 255 )                    local scrW = ScrW()          local scrH = ScrH()          local x = scrW / 2.0          local y = scrH / 2.0          local scope_size = scrH          -- crosshair          local gap = 80          local length = scope_size          surface.DrawLine( x - length, y, x - gap, y )          surface.DrawLine( x + length, y, x + gap, y )          surface.DrawLine( x, y - length, x, y - gap )          surface.DrawLine( x, y + length, x, y + gap )          gap = 0          length = 50          surface.DrawLine( x - length, y, x - gap, y )          surface.DrawLine( x + length, y, x + gap, y )          surface.DrawLine( x, y - length, x, y - gap )          surface.DrawLine( x, y + length, x, y + gap )          -- cover edges          local sh = scope_size / 2          local w = (x - sh) + 2          surface.DrawRect(0, 0, w, scope_size)          surface.DrawRect(x + sh - 2, 0, w, scope_size)                    -- cover gaps on top and bottom of screen          surface.DrawLine( 0, 0, scrW, 0 )          surface.DrawLine( 0, scrH - 1, scrW, scrH - 1 )          surface.SetDrawColor(255, 0, 0, 255)          surface.DrawLine(x, y, x + 1, y + 1)          -- scope          surface.SetTexture(scope)          surface.SetDrawColor(255, 255, 255, 255)          surface.DrawTexturedRectRotated(x, y, scope_size, scope_size, 0)       else          return self.BaseClass.DrawHUD(self)       end    end    function SWEP:AdjustMouseSensitivity()       return (self:GetIronsights() and 0.2) or nil    end end
Actually, I've fixed everything for the most part. For some reason the weapons with scopes display a missing texture screen when you ads with them and some weapons have the wrong ammotypes(which is an easy fix that I don't need help to fix...) weapon_m9k_intervention.lua weapon_m9k_m24.lua weapon_m9k_mp7.lua Are all the weapons that have the missing texture while ADSed(which is bad)
I had that problem with cw2.0 I could not fix it but I used a different material for the scopes (those of weapons that worked) that looked like the same. Check this in ur files:    local scope = surface.GetTextureID("sprites/scope") and edit it to a working scope.
Probably because you're attempting to use the Scout's ADS function. Or some other weapon's. What does the code look like for the ADS function? Post it here. CW2.0 in TTT you say? Shameless plug: https://steamcommunity.com/sharedfiles/filedetails/?id=1590111190
That's something different. I'm not using that addon due to being unnecessary for me, since I converted them already.
Sorry, you need to Log In to post a reply to this thread.