GSC reference › Built-in
IsAssetLoaded()
Built-in (engine)
Server
Check whether or not an asset is loaded.
Signature
IsAssetLoaded(<assetType>, <assetName>)
Parameters
| Name | Required? | Details |
|---|---|---|
| assetType | Required | "weapon" or "material" |
| assetName | Required | The name of the asset - should match zone_source |
Example (from Treyarch's docs)
IsAssetLoaded( "weapon", "rpg" )
Real uses in BO3's scripts
Called 9 times in the decompiled scripts. A few, zombies first:
- scripts/shared/vehicle_shared.gsc, line 4224
if(isassetloaded("", "")) - scripts/shared/vehicle_shared.gsc, line 4230
if(isassetloaded("", "")) - scripts/shared/vehicle_shared.gsc, line 4236
if(isassetloaded("", "")) - scripts/shared/vehicle_shared.gsc, line 4242
if(isassetloaded("", "")) - scripts/cp/_cache.gsc, line 154
if(w_primary_weapon_base != level.weaponnull && isassetloaded("weapon", w_primary_weapon_base.name))
Related built-ins
- TableLookupFindCoreAsset()Find core asset index for a stringtable
- AreTexturesLoaded()Check to see if start-of-level textures are loaded - if they're not, the streamer forces a black screen.
- IsArchetypeLoaded()Returns true if a given archetype is loaded in the level.
- IsNavVolumeLoaded()Checks whether nav volume is loaded
- GetCharacterAssetName()Returns the asset name for a character for the current session mode
- GetAtrLoaded()Return an array of anim tree name loaded onto the server.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).