# Class: resource

Resources are files that are typically loaded from the harddisk and are not managed with dynamic memory management, but stored within a reschunk. Unloading of a loaded resources is not trivial, but possible. Unloading of resources is done by the reschunk class.
The load function will try to load the file or return the first instance of the same name. The forceload function will make sure a new copy of this resourcetype (not other resourcetypes) will be loaded.All create functions behave similar to load, they first look for the instance name being loaded/created before, and return that resource, or run the creation process. Therefore make sure to have unique identifier names when you want create multiple unique resources.

## Hierarchy

    o-+ resource
      o-- animation
      o-- gpuprog
      o-- material
      o-- model
      o-- particlecloud
      o-- particlesys
      o-- shader
      o-- sound
      o-- tbterrain
      o-- texture

## Methods:

### Method overview:

- condition
- getresname
- getresshortname
- resuserstring

condition (string name,[boolean])
  returns: ([boolean])
  Some resources allow sort of preprocessor settings for setups. Here you can set the values that you can query in shader,particlesys,material scripts.
getresname (resource)
  returns: (string,[string])
  returns the resource filename and optional second argname
getresshortname (resource)
  returns: (string,[string])
  returns the resource filename without paths and optional second argname
resuserstring (resource,[string])
  returns: ([string])
  returns or sets a user string that is permanent for each resource. String must be shorter than 256 characters.