Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2024, 12:07:38 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom Weapon Models
Pages: [1]
Author Topic: Custom Weapon Models  (Read 4002 times)
PAL-18
Poster

Posts: 36



« on: August 30, 2010, 05:59:46 AM »

I noticed that while trying to install a weapon that uses a custom model, the models don't precache.  I was precaching the models with sourcemod, but i'd rather use lua.  Where can i add the precache code and what precache code do i use?
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: August 30, 2010, 08:13:19 AM »

They will precache if you use the Model function when setting SWEP.WorldModel and such.

If you mean other models, they should be precached manually in SWEP:Precache() using util.PrecacheModel.
« Last Edit: August 30, 2010, 08:14:46 AM by Bad King Urgrain »
PAL-18
Poster

Posts: 36



« Reply #2 on: August 30, 2010, 04:12:30 PM »

The weapon is set to use the world model and the models still werent being precached:

Quote
SWEP.ViewModel = "models/weapons/v_gnife_t.mdl"
SWEP.WorldModel = "models/weapons/w_gnife_t.mdl"


No textures were being precached either.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #3 on: August 30, 2010, 04:38:52 PM »

Yeah, I mean it needs to be:

Quote
SWEP.ViewModel = Model("models/weapons/v_gnife_t.mdl")
SWEP.WorldModel = Model("models/weapons/w_gnife_t.mdl")


This is not specific to TTT, all gmod SWEPs should precache their model in this way.
PAL-18
Poster

Posts: 36



« Reply #4 on: August 30, 2010, 07:37:39 PM »

Ah.

Thanks!

P.S. Why did you change your name from TheGreenBunny?
« Last Edit: August 31, 2010, 01:21:34 AM by PAL-18 »
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Custom Weapon Models « 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.008 seconds with 18 queries.