> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rollingquest.kramgames.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CampaignResource — Campaign File Resource Reference

> API reference for the CampaignResource class in RollingQuest Lua scripting. Represents bundled resource files in a campaign.

The `CampaignResource` class represents a resource file bundled with a campaign. Resources can be binary data, text files, JSON data, or images. You query resources via the [`Campaign`](/api/namespaces/campaign) namespace.

## Properties

| Property | Type                   | Read-only | Description                      |
| -------- | ---------------------- | --------- | -------------------------------- |
| `type`   | `CampaignResourceType` | ✅         | The format of the resource file. |

## CampaignResourceType

The `CampaignResourceType` enum classifies the format of a campaign resource:

| Value                          | Number | Description          |
| ------------------------------ | ------ | -------------------- |
| `CampaignResourceType.Unknown` | `0`    | Unrecognized format. |
| `CampaignResourceType.Binary`  | `1`    | Raw binary data.     |
| `CampaignResourceType.Text`    | `2`    | Plain text data.     |
| `CampaignResourceType.Json`    | `3`    | JSON-formatted data. |
| `CampaignResourceType.Image`   | `4`    | Image file.          |

## Usage Example

```lua theme={null}
function OnStart()
    Logger.info("Campaign: " .. Campaign.name)
    -- Resources are queried through the Campaign API
end
```
