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

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT custom sweps shared.lua
Pages: [1] 2
Author Topic: TTT custom sweps shared.lua  (Read 9950 times)
Polishhotdog
Poster

Posts: 18


« on: July 30, 2010, 11:01:29 PM »

Hey, I've got a TTT server and I've currently uploaded all the files to a custom swep which is a barret 50 cal. I've made a folder in gamemodes/TerrorTown/entities/weapons named weapon_ttt_barret50 and inside there is a shared.lua file with information about the swep and so forth. The problem is I can see the barret on the server but other people cannot( they see it as an error) but the weird thing is that when I join the server I download the model fine. Am I putting the shared.lua file in the incorrect directory?
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #1 on: July 30, 2010, 11:13:29 PM »

You probably need to add the model to the resources.lua file.

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
Polishhotdog
Poster

Posts: 18


« Reply #2 on: July 30, 2010, 11:17:52 PM »

Yeah I've done that already, I also added the shared.lua to it
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #3 on: July 30, 2010, 11:19:07 PM »

Yeah I've done that already, I also added the shared.lua to it

You don't need to add the shared.lua, it does that via AddCSLuaFile.
Otherwise, I don't know what's wrong.

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #4 on: July 30, 2010, 11:23:54 PM »

Possible typo in the shared file.. check SWEP.WorldModel / ViewModel (or similar...) point to the correct filepath for the model you are trying to use.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Polishhotdog
Poster

Posts: 18


« Reply #5 on: July 30, 2010, 11:27:07 PM »

You don't need to add the shared.lua, it does that via AddCSLuaFile.
Otherwise, I don't know what's wrong.


Hmm, maybe I'll try removing it and see if that works 
manbearpig101
Poster

Posts: 11


« Reply #6 on: July 31, 2010, 06:01:00 AM »

If you have FastDL remember to add it to your FastDL repository/webserver!
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #7 on: July 31, 2010, 09:02:57 AM »

If you put the contents of your weapon's shared.lua in a http://pastebin.com/ and post the link, we can tell more easily if there's a mistake.

Perhaps you put in the wrong path for the model download? That way it could download fine for everyone, but only work for you because you already have a copy that's in the right place, while for everyone else it's in the wrong directory and can't be found.

You probably need to add the model to the resources.lua file.

I would recommend strongly against modifying resources.lua. You can put the resource.Add in the weapon's shared.lua script (as the guide does). That way you can avoid having to manually update the resources.lua file every time you update TTT.
Polishhotdog
Poster

Posts: 18


« Reply #8 on: July 31, 2010, 09:39:48 AM »

Here's the link to the contents of the shared.lua file:

http://pastebin.com/HDGBS72c
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #9 on: July 31, 2010, 10:03:59 AM »

I don't see anything obviously wrong. What have you put in resources.lua?
Polishhotdog
Poster

Posts: 18


« Reply #10 on: July 31, 2010, 11:21:33 AM »

here's Resources.lua

http://pastebin.com/H5yBVBqb

Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #11 on: July 31, 2010, 11:41:10 AM »

Assuming you have something like "local AddFile = resources.AddFile" above that (else nothing would download and you said that did work), then everything seems correct. The model paths match up etc.

Does the sound work for other people? And the icon (when you search a body killed by the weapon)?
Polishhotdog
Poster

Posts: 18


« Reply #12 on: July 31, 2010, 11:55:51 AM »

hmm, i dont actually have a local AddFile = resources.AddFile line in the File. Im guessing i put that in there?

And no the kill icon/sound does not work because people do not download the files required
« Last Edit: July 31, 2010, 11:57:15 AM by Polishhotdog »
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #13 on: July 31, 2010, 02:02:04 PM »

I was assuming you had added those lines in the pastebin to TTT's resources.lua file. I don't know where exactly you put it, but perhaps you should just use this as the contents of your shared.lua file:
http://pastebin.com/yseJdm6u

It has the resource stuff in there now as you can see. You won't need the AddFile stuff in a separate place that way, and it should download properly.

If the server uses fastdl/sv_downloadurl, the files also have to be on there of course.
Polishhotdog
Poster

Posts: 18


« Reply #14 on: July 31, 2010, 09:35:33 PM »

Ok I'll try using that for the shared.lua. I'll get back to you with results
Polishhotdog
Poster

Posts: 18


« Reply #15 on: August 01, 2010, 12:27:00 AM »

I made a file in lua/autorun/server called Forcedl.lua and the server downloads everything except the Materials? why is this?

here is the lua file: http://pastebin.com/YBqE6LTR

EDIT: Sorry, the files were in the wrong directory, It is working now. Thank you for all your help :)

2nd Edit: Theres one small problem, when you see another person holding the weapons it appears to be coming out of their p***s. Is there any possible way to fix this?

Third edit: Just a small question, how can i enable killing after the round is over? kthx
« Last Edit: August 01, 2010, 01:29:14 AM by Polishhotdog »
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #16 on: August 01, 2010, 08:23:21 AM »

2nd Edit: Theres one small problem, when you see another person holding the weapons it appears to be coming out of their p***s. Is there any possible way to fix this?

It sounds like the weapon's w_ model does not have the correct bones, so the game doesn't know how to position it in the player's hands. Fixing that requires editing the model.

Quote
Third edit: Just a small question, how can i enable killing after the round is over? kthx

ttt_postround_dm 1
Raserisk
Poster

Posts: 12


« Reply #17 on: August 01, 2010, 07:06:31 PM »

I'm also trying to get a custom weapon implemented for the server I play on, but unfortunely have very little Lua experience. So we basically just make a ttt_weapon_<name> folder in TTT/Entities/Weapons, put the shared.lua file in of the weapon and a "resource.lua" file? Or is it much more complicated?

I'm trying to get a Tranquilizer swep in.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #18 on: August 01, 2010, 08:18:08 PM »

I can't teach you Lua, but all you need to know about custom weapons is here: http://ttt.badking.net/custom-weapon-guide

You do not need a resource.lua and shouldn't make one. Everything goes into the shared.lua script.
Raserisk
Poster

Posts: 12


« Reply #19 on: August 01, 2010, 10:00:13 PM »

The ak47 was simple to put in. However trying to do a custom swep was more tiresome. I noticed in the ak47 shared.lua file you had your own config settings for TTT. Do you HAVE to include all those in the original shared.lua file of the swep?
Pages: [1] 2
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT custom sweps shared.lua « 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.