Welcome, Guest. Please login or register.
Did you miss your activation email?
September 19, 2024, 11:55:41 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom weapon
Pages: [1]
Author Topic: Custom weapon  (Read 15430 times)
desicions
Poster

Posts: 3


« on: February 26, 2012, 09:07:53 PM »

Hello,
I am trying to add a new weapon, and I must say that http://ttt.badking.net/custom-weapon-guide , is un clear.

For example, they did not say what to do if I'm adding a custom model, rather than a CSS model.

C4 example:
SWEP.ViewModel  = Model("models/weapons/v_c4.mdl")
SWEP.WorldModel = Model("models/weapons/w_c4.mdl")


There's so v_c4.mdl in gamemodes/ttt.folder , so I assume it's from CSS, and gets the model there..
But what should I do if I have a custom model , sound file , and most important what if weapon I'm adding has it's own lua.folder, and three lua files in it, cl_init, init and shared.

I'm trying to add this:
http://www.garrysmod.org/downloads/?a=view&id=125244

Best regards,

Desicions.
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #1 on: February 26, 2012, 09:55:44 PM »

The model would just be like so..
SWEP.ViewModel  = Model("models/weapons/v_newmodel.mdl")
SWEP.WorldModel = Model("models/weapons/w_newmodel.mdl")

Because its still being fetched from the same folder.

How ever you would need to send your clients the models with a Resource.AddFile
example:
resource.AddFile( "models/weapons/v_newmodel" );


For the cl_init, init, and shared they just need to have the includes part of code from the shared.lua. cl_init, and init are just parts of the shared.lua but those parts are broken down not to be shared by client and server.

>note im tired so if I fucked anything up here tell me.

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
desicions
Poster

Posts: 3


« Reply #2 on: February 27, 2012, 02:53:00 PM »

So, basicly, I'll have to add new models inside the
C:\Users\gera\Desktop\gamemodes\terrortown\content\models\ttt\weapons

Note : There's no weapons.folder inside of the ttt folder, so I'm really not sure about the path.
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #3 on: February 27, 2012, 09:32:28 PM »

No it would be...
garrysmod/models/weapons/

or
garrysmod/models/weapons/<your folder here>

This one makes it more organized for your clients and you, btu you would need to add the sub-folder of weapons to the code of the weapon.

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom 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.009 seconds with 18 queries.