# Resources

## Calculation

### By Building -  `byBuilding`

If `True` the building's production will be calculated by the building instead. If `False` the building production/consume will be done by each tile.

**Attribute Type:** Boolean (default: `False`).

As example, if you have a building of 3x3, the production would be **9x** what you specified in case this value is not defined or set as `False`.

{% hint style="warning" %}
This also apply to how it's seen by other building, they'll count it as only 1 tile when doing their requirements calculations.
{% endhint %}

### Counts Itself -  `countsItself`

The building requirements or upgrades will count their own resource and variables.

**Attribute Type:** Boolean (default: `False`).

## Production & Consume

{% hint style="info" %}
To cause a consomation or usage, just set the values as **negatives**.
{% endhint %}

### Cost -  `cost`

Cost of the building on placement.

**Attribute Type:** List of Resources.

<details>

<summary>Resource Format</summary>

Format:

```json
{
    "rec": "madera",
    "q": 2
}
```

**Rec** (Resource)**:** Name of resource

**Q:** Quantity.

</details>

{% tabs %}
{% tab title="Example 1" %}
The building will cost:

* 50x `Work`&#x20;
* 10x `Wood`

```json
"cost": 
	[
		{
			"rec": "trabajo0",
			"q": 50
		},
		{
			"rec": "madera",
			"q": 10
		}
	]
```

{% endtab %}

{% tab title="Example 2" %}
The building will cost:

* 20x `Coal`&#x20;
* 15x `Highly Skilled Work`

```json
"cost": 
	[
		{
			"rec": "carbon",
			"q": 20
		},
		{
			"rec": "trabajo2",
			"q": 15
		}
	]
```

{% endtab %}
{% endtabs %}

### Local Variables -  `localVariables`

Produce/Consume one or multiples [local variables](https://worive.gitbook.io/urbek-modding/in-depth-knowledge/in-game-data-names/local-variables).

**Attribute Type:** List of Resources.

<details>

<summary>Local Variable Format</summary>

Format:

```json
{
    "locVar": "ocio",
    "q": -3
}
```

**locVar:** Name of Local Variable

**Q:** Quantity.

</details>

{% tabs %}
{% tab title="Example 1" %}
The building will produce:

* 10x `Density`
* 5x `Leisure`

```json
"localVariables": 
	[
		{
			"locVar": "densidad",
			"q": 10
		},
		{
			"locVar": "comodidad",
			"q": 5
		}
	]
```

{% endtab %}

{% tab title="Example 2" %}
The building will produce:

* 10x `Density`

The building will consume:

* 5x `Leisure`

```json
"localVariables": 
	[
		{
			"locVar": "densidad",
			"q": 10
		},
		{
			"locVar": "comodidad",
			"q": -5
		}
	]
```

{% endtab %}
{% endtabs %}

### Produces -  `produces`

Produce/Consume one or multiples [resources](https://worive.gitbook.io/urbek-modding/in-depth-knowledge/in-game-data-names/resources)

**Attribute Type:** List of Resources.

<details>

<summary>Resource Format</summary>

Format:

```json
{
    "rec": "madera",
    "q": 2
}
```

**Rec** (Resource)**:** Name of resource

**Q:** Quantity.

</details>

### Resource Extraction -  `resourceExtraction`

Store one or multiples [resources](https://worive.gitbook.io/urbek-modding/in-depth-knowledge/in-game-data-names/resources).

**Attribute Type:** Resource Extraction.

<details>

<summary>Resource Extraction</summary>

Format:

```json
{
    "resource": "madera",
    "q": 2,
    "distance": 10
}
```

**Resource:** Name of resource

**Q:** Quantity.

**Distance:** Distance at which it will collect resources&#x20;

</details>

### Storage -  `storage`

Store one or multiples [resources](https://worive.gitbook.io/urbek-modding/in-depth-knowledge/in-game-data-names/resources).

**Attribute Type:** List of Resources.

<details>

<summary>Resource Format</summary>

Format:

```json
{
    "rec": "madera",
    "q": 2
}
```

**Rec** (Resource)**:** Name of resource

**Q:** Quantity.

</details>
