meta.xml: Difference between revisions
Jump to navigation
Jump to search
PerikiyoXD (talk | contribs) (Easy redirect by keyword "meta.xml") Tag: New redirect |
PerikiyoXD (talk | contribs) (New `meta.xml`) Tag: Removed redirect |
||
| Line 1: | Line 1: | ||
== Resource `meta.xml` == | |||
Defines metadata and file declarations for a resource. | |||
Every resource '''must contain a `meta.xml` file''' or the resource will not load. | |||
---- | |||
== Basic Structure == | |||
<pre> | |||
<meta> | |||
<info author="" type="" version="" description="" /> | |||
<script src="" type="" language="" /> | |||
<dependency src="" /> | |||
<map src="" type="" /> | |||
<file src="" type="" /> | |||
</meta> | |||
</pre> | |||
---- | |||
== Complete Example == | |||
<pre> | |||
<meta> | |||
<info | |||
author="JohnDoe" | |||
type="gameplay" | |||
version="1.0.0" | |||
description="Example resource" | |||
/> | |||
<script src="server/main.js" type="server" language="javascript" /> | |||
<script src="client/ui.js" type="client" language="javascript" /> | |||
<file src="config/settings.json" type="server" /> | |||
<file src="ui/index.html" type="client" /> | |||
<map src="maps/city.map" type="map" /> | |||
<dependency src="core" /> | |||
</meta> | |||
</pre> | |||
---- | |||
== Elements == | |||
=== <meta> === | |||
Root element that contains all metadata and file declarations for the resource. | |||
Only one `<meta>` element should exist in a `meta.xml`. | |||
---- | |||
=== <info> === | |||
Provides general metadata about the resource. | |||
==== Attributes ==== | |||
{| class="wikitable" | |||
! Attribute | |||
! Description | |||
|- | |||
| author | |||
| Name of the resource author. | |||
|- | |||
| type | |||
| Resource category or custom description. | |||
|- | |||
| version | |||
| Resource version number. | |||
|- | |||
| description | |||
| Short description explaining the resource. | |||
|} | |||
==== Example ==== | |||
<pre> | |||
<info | |||
author="JohnDoe" | |||
type="gameplay" | |||
version="1.0.0" | |||
description="Adds custom gameplay mechanics" | |||
/> | |||
</pre> | |||
---- | |||
=== <script> === | |||
Declares a script file that should be loaded by the resource. | |||
Each script file must have its own `<script>` entry. | |||
==== Attributes ==== | |||
{| class="wikitable" | |||
! Attribute | |||
! Description | |||
|- | |||
| src | |||
| Relative path to the script file. | |||
|- | |||
| type | |||
| Execution side (<code>server</code> or <code>client</code>). | |||
|- | |||
| language | |||
| Script language used by the file. | |||
|} | |||
==== Example ==== | |||
<pre> | |||
<script src="server/main.js" type="server" language="javascript" /> | |||
<script src="client/ui.js" type="client" language="javascript" /> | |||
</pre> | |||
---- | |||
=== <file> === | |||
Declares a custom file included in the resource. | |||
==== Attributes ==== | |||
{| class="wikitable" | |||
! Attribute | |||
! Description | |||
|- | |||
| src | |||
| Relative path to the file. | |||
|- | |||
| type | |||
| Target side (<code>client</code> or <code>server</code>). | |||
|} | |||
==== Example ==== | |||
<pre> | |||
<file src="config/settings.json" type="server" /> | |||
<file src="ui/index.html" type="client" /> | |||
</pre> | |||
---- | |||
=== <dependency> === | |||
Declares a required resource dependency. | |||
If specified, the dependency resource must load before this one. | |||
==== Attributes ==== | |||
{| class="wikitable" | |||
! Attribute | |||
! Description | |||
|- | |||
| src | |||
| Name of the required resource. | |||
|} | |||
==== Example ==== | |||
<pre> | |||
<dependency src="core" /> | |||
<dependency src="database" /> | |||
</pre> | |||
---- | |||
=== <map> === | |||
Registers a map file used by the resource. | |||
==== Attributes ==== | |||
{| class="wikitable" | |||
! Attribute | |||
! Description | |||
|- | |||
| src | |||
| Relative path to the map file. | |||
|- | |||
| type | |||
| Map type definition. | |||
|} | |||
==== Example ==== | |||
<pre> | |||
<map src="maps/city.map" type="map" /> | |||
</pre> | |||
---- | |||
== Path Rules == | |||
All <code>src</code> attributes use '''paths relative to the resource root folder'''. | |||
=== Valid Examples === | |||
<pre> | |||
example.js | |||
client/ui.js | |||
server/modules/auth.js | |||
assets/images/logo.png | |||
</pre> | |||
=== Invalid Example === | |||
<pre> | |||
/absolute/path/file.js | |||
</pre> | |||
Absolute paths are not supported. | |||
---- | |||
== Key Rules == | |||
* Every resource must include a <code>meta.xml</code>. | |||
* Each script requires its own <code><script></code> entry. | |||
* All <code>src</code> paths are relative to the resource root folder. | |||
* Dependencies ensure correct resource load order. | |||
* Custom files must be declared using <code><file></code> to be available at runtime. | |||
Latest revision as of 13:12, 12 March 2026
Resource `meta.xml`
Defines metadata and file declarations for a resource. Every resource must contain a `meta.xml` file or the resource will not load.
Basic Structure
<meta>
<info author="" type="" version="" description="" />
<script src="" type="" language="" />
<dependency src="" />
<map src="" type="" />
<file src="" type="" />
</meta>
Complete Example
<meta>
<info
author="JohnDoe"
type="gameplay"
version="1.0.0"
description="Example resource"
/>
<script src="server/main.js" type="server" language="javascript" />
<script src="client/ui.js" type="client" language="javascript" />
<file src="config/settings.json" type="server" />
<file src="ui/index.html" type="client" />
<map src="maps/city.map" type="map" />
<dependency src="core" />
</meta>
Elements
<meta>
Root element that contains all metadata and file declarations for the resource.
Only one `<meta>` element should exist in a `meta.xml`.
<info>
Provides general metadata about the resource.
Attributes
| Attribute | Description |
|---|---|
| author | Name of the resource author. |
| type | Resource category or custom description. |
| version | Resource version number. |
| description | Short description explaining the resource. |
Example
<info
author="JohnDoe"
type="gameplay"
version="1.0.0"
description="Adds custom gameplay mechanics"
/>
<script>
Declares a script file that should be loaded by the resource.
Each script file must have its own `<script>` entry.
Attributes
| Attribute | Description |
|---|---|
| src | Relative path to the script file. |
| type | Execution side (server or client).
|
| language | Script language used by the file. |
Example
<script src="server/main.js" type="server" language="javascript" /> <script src="client/ui.js" type="client" language="javascript" />
<file>
Declares a custom file included in the resource.
Attributes
| Attribute | Description |
|---|---|
| src | Relative path to the file. |
| type | Target side (client or server).
|
Example
<file src="config/settings.json" type="server" /> <file src="ui/index.html" type="client" />
<dependency>
Declares a required resource dependency.
If specified, the dependency resource must load before this one.
Attributes
| Attribute | Description |
|---|---|
| src | Name of the required resource. |
Example
<dependency src="core" /> <dependency src="database" />
<map>
Registers a map file used by the resource.
Attributes
| Attribute | Description |
|---|---|
| src | Relative path to the map file. |
| type | Map type definition. |
Example
<map src="maps/city.map" type="map" />
Path Rules
All src attributes use paths relative to the resource root folder.
Valid Examples
example.js client/ui.js server/modules/auth.js assets/images/logo.png
Invalid Example
/absolute/path/file.js
Absolute paths are not supported.
Key Rules
- Every resource must include a
meta.xml. - Each script requires its own
<script>entry. - All
srcpaths are relative to the resource root folder. - Dependencies ensure correct resource load order.
- Custom files must be declared using
<file>to be available at runtime.