![]() |
Nuclide
Software Development Kit for id Technology (BETA)
|
Precaching library.
Public Member Functions | |
| float | Model (string pathToModel) |
| Precaches a given model file and additional helper files. | |
| float | Sound (string soundDef) |
| Precaches a given sound def or sample. | |
| musictrack_t | Music (string musicTrack) |
| Precaches a given music track. | |
| float | Particle (string particleEffect) |
| Precaches a given particle effect. | |
| float | Entity (string className) |
| Precaches a given entity class. | |
| string | SpriteFrame (string spritePath, float frameNum, float timeIntoFrame) |
| Precaches a given sprite frame to a material. | |
| string | Material (string materialName) |
| Precaches a given material. | |
| float precacheAPI_t::Entity | ( | string | className | ) |
Precaches a given entity class.
Ensuring models, sounds and other assets referenced within are loaded ahead of time.
| className | to precache |
| string precacheAPI_t::Material | ( | string | materialName | ) |
Precaches a given material.
On a server, this function will ensure that a model is added to the connection resource list. On a client-side progs, you usually want to call this function within HUD_ReloadVideoResources or ClientGame_RendererRestart.
r_imageextensions console variable. The engine may also create a fallback image. This behaviour is implementation specific.| particleEffect | to precache |
| float precacheAPI_t::Model | ( | string | pathToModel | ) |
Precaches a given model file and additional helper files.
precache.Model("models/weapons/v_pistol.vvm");
| pathToModel | to precache |
| musictrack_t precacheAPI_t::Music | ( | string | musicTrack | ) |
Precaches a given music track.
precache.Music("music/e1m1.ogg"); precache.Music("music/track02.ogg");
| musicTrack | to precache |
| float precacheAPI_t::Particle | ( | string | particleEffect | ) |
Precaches a given particle effect.
The following loads r_part impactSpark from particles/weapon_laser.cfg.
`precache.Particle("weapon_laser.impactSpark");
| particleEffect | to precache |
| float precacheAPI_t::Sound | ( | string | soundDef | ) |
Precaches a given sound def or sample.
precache.Sound("Foo.Bar"); precache.Sound("foo/bar.wav");
| soundDef | to precache |
| string precacheAPI_t::SpriteFrame | ( | string | spritePath, |
| float | frameNum, | ||
| float | timeIntoFrame ) |
Precaches a given sprite frame to a material.
An image from a .spr type sprite file.
| spritePath | is the path to a sprite, e.g. "sprites/rain.spr" |
| frameNum | specifies the framegroup/sequence of which we pick from |
| timeIntoFrame | specifies the time into the sequence we'll pretend to be at |