# Interiors presets

### Overview

```lua
-- Location: rcore_prison/data/presets/xxx.lua
```

In short overview, this interior preset system is handling all interaction & options used in our Prison system, which means that you can simply make own interior preset or use already defined ones.

By default there is interior template which is used along with rcore\_\_prison\_\_map.

{% hint style="info" %}
Supporting GABZ, Uncle Just, Alcatraz interiors by default.
{% endhint %}

Our interior preset system is offering to change anything you like in terms of:

1. Spawn points
2. Other (coords)
3. Job activities for Prisoners
4. Canteen
5. Interaction (npc, marker, type, position)

### Spawn points

Spawn points are used for spawning prisoners inside Prison cells, if script detect that are all cells are occupied by some Prisoner, new prisoner will be teleport at prisonYard position as fallback.

{% hint style="info" %}
You dont need to define any spawnPoints, but its recommended for better immersion.
{% endhint %}

#### Usage:

<pre class="language-lua"><code class="lang-lua"><strong>-- Note: You dont need to define cellId, its just optional.
</strong><strong>-- Note The format is strict!
</strong>
<strong>spawnPoints = {
</strong>    {
        coords = vec3(1713.704834, 2571.923340, 50.189816),
        cellId = 1,
    },
    {
        coords = vec3(1713.704834, 2571.923340, 50.189816),
        cellId = 1,
    },
}
</code></pre>

### Other

There are few coords, which you can change as specific for releasePos, outfitMenu, prisonYard.

<pre class="language-lua"><code class="lang-lua"><strong>-- Format: (x, y, z, heading)
</strong>
<strong>releasePos = vec4(1847.230469, 2587.085693, 45.672638, 269.0),
</strong>outfitMenu = vec4(402.704010, -996.795166, -99.000252, 180.0),
prisonYard = vec4(1774.836914, 2552.014404, 45.564976, 74.0),  
</code></pre>

| Variable   | Desc                                                                   |
| ---------- | ---------------------------------------------------------------------- |
| releasePos | Release position, when Prisoner has finished his time in Prison.       |
| outfitMenu | Position where new Prisoner is selecting his outfit.                   |
| prisonYard | Position when new Prisoner is teleported, when not any cells are free. |

### Job activities (Jobs)

There you can change all stuff related to specific activities on Prison yard or define own? :thumbsup:

| Variable          | value                             | Desc                                                                                                                        |
| ----------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| jobId             | 1                                 | Unique number value for specific activity                                                                                   |
| activeLimit       | 1                                 | How many prisoners, can do this activity at once.                                                                           |
| reward.type       | ('reduceSentece / credits')       | You can specify what is reward when prisoners in specific activity finished their job (giving credis or reducing jail time) |
| reward.amount     | value (int)                       | How much you like to gave to prisoners for specific job.                                                                    |
| requiredDelivery  | 1                                 | How many tasks needs to be acomplished for finishing current activity                                                       |
| text              | 'JOB\_CLEAN\_YARD\_MISSION\_TEXT' | Mission text for current activity, using lang text entry.                                                                   |
| cooldown          | 30 \* 1000 (30 sec)               | When Prisoners can do this activity again?                                                                                  |
| name              | Clean Yard                        | What the activity name?                                                                                                     |
| type              | clean\_yard                       | Internal activity type, that will handle specific job.                                                                      |
| drawmarker.opaciy | 100                               | Option to change drawmarker opacity.                                                                                        |
| points            | array of vec3                     | Define your array of coords for specific activity                                                                           |

### Canteen

Define what type of items are going to be in Canteen

| label   | cost | itemName | Desc                                                                                                       |
| ------- | ---- | -------- | ---------------------------------------------------------------------------------------------------------- |
| Sludgie | 50   | sludgie  | <p>label - name in menu<br><br>cost - price in credis<br><br>itemName - name of item in your inventory</p> |

```lua
Canteen = {
    {
        label = 'Sludgie',
        cost = 50,
        itemName = 'sludgie'
    },
}
```

### Interaction

Define positions of interaction points and other specific things.

```lua
-- Locations: rcore_prison/configs/interiors.lua ['interaction']
-- Example interaction point with NPC (canteen type)

{
    npc = {
        model = 's_m_m_prisguard_01',
        heading = 90.0,
    },
    marker = {
        renderState = false,
        rgba = vec4(255, 255, 255, 255),
        size = vec3(0.5, 0.5, 0.5),
        type = 0
    },
    coords = vec3(1712.886108, 2573.232422, 45.555862),
    type = 'canteen',
},
```

#### Blips for interaction

Option to define blips for specific interactions.

```lua
    blip = {
        state = Prison.RenderNPCBlips,
        name = 'Cigarett production',
        sprite = 214,
        scale = 0.6,
        color = 0,
    },
    marker = {
        renderState = false,
        rgba = vec4(255, 255, 255, 255),
        size = vec3(0.5, 0.5, 0.5),
        type = 0
    },
    coords = vec3(1712.886108, 2573.232422, 45.555862),
    type = 'canteen',
```

| Variable           | Param                    | Desc                                |
| ------------------ | ------------------------ | ----------------------------------- |
| npc.model          | 's\_m\_m\_prisguard\_01' | Define model of NPC                 |
| npc.heading        | '90.0                    | Define heading of specific NPC      |
| marker.renderState | true/false               | Should interaction use marker       |
| coords             | vec3                     | Position of npc / interaction point |
| type               | string                   | internalType (action)               |

{% hint style="info" %}
Would you like to disable npc on interaction?
{% endhint %}

```lua
{
    npc = nil
    marker = {
        renderState = false,
        rgba = vec4(255, 255, 255, 255),
        size = vec3(0.5, 0.5, 0.5),
        type = 0
    },
    coords = vec3(1712.886108, 2573.232422, 45.555862),
    type = 'canteen',
},
```

#### Telephone booth

Option to define telephone booth, number needs to be unique! :thumbsup:

{% hint style="info" %}
Require third-party phone to be connected with Prison callSystem.
{% endhint %}

```lua
{
    npc = nil
    marker = {
        renderState = true,
        rgba = vec4(255, 255, 255, 255),
        size = vec3(0.5, 0.5, 0.5),
        type = 0
    },
    booth = {
        number = 1000,
    },
    coords = vec3(1765.303589, 2529.866455, 45.796360),
    type = 'booth',
}    
```
