UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How do I precache a material?

broken avatar :(
Created 4 years ago
by supervladeg
0 Members and 1 Guest are viewing this topic.
1,081 views
broken avatar :(
×
broken avatar :(
Location: ru
Date Registered: 14 February 2016
Last active: 4 years ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
supervladeg's Groups
supervladeg's Contact & Social Links
Hello, I had an issue before where I tried to add an MP weapon, having no sound, then trying to fix it, and then xmodels and fx missing, which I fixed by either preaching or just having the xmodels in the map somewhere. One issue remains with the hud_icon_svt40 missing, which is a material. Now, I added custom images before, but is there a 'correct' way to include this? I'm a total novice at scripting so I'd appreciate something easy to follow.
 
Thanks!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 3 months ago
Posts
684
Respect
Forum Rank
Zombie Enslaver
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTeffrieGympie5#5971TheRevenantSkullTeffrie
in your modbuilder / .csv: material,YOURMATERIALNAME
 
In your mod: (I would put it in _zombiemode along the others) PrecacheShader( "YOURMATERIALNAME" );
 
But all these precaching would be solved if you just add the weapon to your mod.
 
Code Snippet
Plaintext
1. Add your weapon to your modbuilder / .csv:

weapon,sp\YOURWEAPONNAME
sound,YOURSOUNDALIAS,,all_sp

2. Add your weapon file to folder:
Call of Duty World at War\mods\YOURMOD\weapons\sp

3. Add your weapon in _zombiemode_weapons, search at init_weapons() :
add_zombie_weapon( "YOURWEAPONNAME", "Press & hold &&1 to buy NAME [Cost: 2000]", 2000, "" );

4. Add your weapon in dlc3_code, search at include_weapons() :
include_weapon( "YOURWEAPONNAME" );
Old tutorial that should work fine:
 


 
Loading ...