# Starting up

{% hint style="danger" %}
Please, this tutorial requires minimal knowledge of the Godot engine and its node hierarchy.

So if you don't know how to use Godot - first look at some tutorials on YouTube.
{% endhint %}

1. Open source project of PITO in Godot editor.
2. Find folder called "level\_editor" inside res://

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FKBGelAqvF4hrJpucVzUt%2Fimage.png?alt=media&#x26;token=a0209b40-0b5f-44de-aef2-477269f2609a" alt=""><figcaption><p>level_editor folder with prefabs</p></figcaption></figure>

With this folder, you'll be working when creating packed levels for the game.

It has different folders with names:

> ai/
>
> helpers/
>
> MUST\_HAVE/
>
> sprites/
>
> static\_objects/
>
> usable\_triggers/
>
> zones/

* AI - contains prefabs of neutral NPC and HOSTILE NPC
* HELPERS - contains in-editor objects such as target\_point for transition zone, that will be hidden when game starts.
* MUST\_HAVE - a folder that contains must-have nodes on the level, or the game will not run the level.
* SPRITES - contains 2D billboard sprites in 3D scenes (such as light sparkles, and trees)
* STATIC\_OBJECTS - contains 3D static objects like barrels, boxes, car etc.&#x20;
* USABLE\_TRIGGERS - contains 3D trigger zones with colliders so players can interact with them.
* ZONES - contains 3D areas (such as radiation zone, enemy eye zone)

{% hint style="info" %}
Don't forget that we work with levels only in 3D mode!

<img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FiOeHIYA2aDaWjAE1PSPx%2Fimage.png?alt=media&#x26;token=ce69655e-c351-428f-a9b9-a94c49f7288e" alt="" data-size="original">
{% endhint %}

3. Create a new scene using \[Scene/New Scene] (1) or by clicking \[ + ] (2) sign near the game scene.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FTjns6yRheNtbFllNB52t%2Fimage.png?alt=media&#x26;token=03ce112b-0ad4-4b44-b5a3-91087da70f5f" alt=""><figcaption></figcaption></figure>

4. Select <mark style="color:red;">3D Scene</mark> for root node.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2Fp5y3ljJCiuGn3mti6YOD%2Fimage.png?alt=media&#x26;token=bbacbf92-f0e2-49c5-a690-ee9c2b8e2256" alt=""><figcaption></figcaption></figure>

5. Rename root node of your level by double clicking on node name in the node tree.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FyjgEXqtxqtegEKU7Ddlm%2Fimage.png?alt=media&#x26;token=71eb1c24-b97a-490c-a6e3-f7fb37ecfe6b" alt=""><figcaption></figcaption></figure>

6. Add to the level must-have node "level\_settings" from MUST\_HAVE/ folder by drag-n-drop prefab from folder to scene tree.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FQcVLOTfngT2otPooSLaL%2Fimage.png?alt=media&#x26;token=a0b83b41-733b-4e26-ae9d-dfba12939606" alt=""><figcaption></figcaption></figure>

7. In the inspector at the right side of the editor set up settings for the level.

{% hint style="info" %}
Objects that can be set must contain **level\_object.gd** script on it and will have special **"keys"** dictionary variable (looks like JSON). All descriptions can be found [here](https://app.gitbook.com/s/3nRkQI0xXhcgAZp5TWxQ/levels) on the levels page!
{% endhint %}

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FZmVxEbYHNOyqOx16FDCj%2Fimage.png?alt=media&#x26;token=d07ef456-1428-407e-a8bc-7c8473a03d22" alt=""><figcaption></figcaption></figure>

These keys are basic for levels and must be set!\
**Daylight** - key that enables/disables night mode on levels and allows work lights on scene (and flashlight)\
**Fog** - only works with night scenes (daylight must be off)\
**Weather color** - is color of outsky that will be behind the skybox model, there's in-editor presets for the sky color with hex (day: 4a739f, evening: 392e3d, night: 0a0a0a)

8.  Let's add terrain to the scene and place a spawn point for the player. Go to MUST\_HAVE/ folder and drag **spawn\_point.tres** to the scene. Keep it on zero coordinates for XYZ by looking Transform group in Inspector and clicking on the round arrow in the corner.

    <figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FQvhGBz7udfxiwhHaAmvh%2Fimage.png?alt=media&#x26;token=91fab7ef-0146-4740-973f-089c7eb4984b" alt=""><figcaption><p>Reset position</p></figcaption></figure>

Then set Y to 1.7 (it's probably 170cm in height of the main character)

9. Go to STATIC\_OBJECTS/ folder and drag terrain.tres to the scene.

{% hint style="info" %}
Keep in mind, that these objects are prepared for creating levels in the Stalker Mobile universe, but you can create your objects in Blender, Maya or 3Ds Max in \*.obj and save them in res://assets/models/ then just create a new prefab using another one and edit for the new object.
{% endhint %}

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2Fa4TalNV0wN9wqS46oYxH%2Fimage.png?alt=media&#x26;token=567c42c7-8a2e-4cc1-b070-783c805cfa7c" alt=""><figcaption><p>Terrain</p></figcaption></figure>

10. Add skybox\_1.tres to the scene too. And set scale to 10 inside Transform group in inspector.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FMbZEHI3UL0hQClRisHQ9%2Fimage.png?alt=media&#x26;token=74b85d21-4a63-475a-8f6c-f0989ab32d7e" alt=""><figcaption><p>Scale</p></figcaption></figure>

{% hint style="info" %}
If you want to make skybox move (like in vanilla pito game) go to keys dictionary in inspector and add new String key with name "id" and add String value to it "skybox".\
![](https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2F53nbBP7TqXJfukxUtTmO%2Fimage.png?alt=media\&token=1f89077c-2770-43d7-9909-08f6b0a9be0d)\
![](https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FVPk5aPhgDN75Y4F5bcBg%2Fimage.png?alt=media\&token=3c511f8a-ee6e-4595-ab27-d003069ab62a)
{% endhint %}

11. Save the level to the res://assets/levels/ with \*.tres file type. (Ctrl+S) or (Scene->Save Scene As...)

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FsxL1LOdpwvCgOfqJuYT8%2Fimage.png?alt=media&#x26;token=581e5fd9-d7ef-43ac-9dd8-decc40cdbac6" alt=""><figcaption></figcaption></figure>

The name of the level will be it's ID for loading. Now let's launch our new level! Now we'll going to the res://assets/creatures/player.json inside **Source Project** and edit "start\_level" key with our new level name.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FkdSJZVSLHnj2s1lZRaUN%2Fimage.png?alt=media&#x26;token=d55251d9-8b1d-4a87-8faf-a38393e1c846" alt=""><figcaption><p>Find player.json file</p></figcaption></figure>

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FN1Ej02zFXATQZ2XU1vh6%2Fimage.png?alt=media&#x26;token=bdb69449-3f46-4cd0-8751-ab7c10d126e6" alt=""><figcaption><p>Set new start level</p></figcaption></figure>

12. Start a new game by pressing the **Play** button at the top right corner and your new level will be loaded.

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2F5t41W88Nq4IXAOPkTKYi%2Fimage.png?alt=media&#x26;token=87cf30da-f290-4658-8cc5-2f288b2814ec" alt=""><figcaption><p>Play button</p></figcaption></figure>

<figure><img src="https://1426670673-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FekY9xNdT8kuOP48LQNQK%2Fuploads%2FmzeFx28M8bIkvgQUEpdz%2Fimage.png?alt=media&#x26;token=94366cfc-a8e7-4012-8803-d34108c0ce18" alt=""><figcaption><p>Our new level in game</p></figcaption></figure>

You can run the same level outside the source project if you first export the game using instructions from the main GitHub page and then copy assets/ folder from the source to the exported \*.exe files, then just put a new level \*.tscn file into assets/levels/ folder and do the same steps as here in step 11.

{% hint style="warning" %}
You only need to export the game once, you don't need to export every time before every level test. After all, the current version of the game 1.2 fix 3, which is in this project already knows how to run packed levels. If it is still difficult to export - you can download the latest version of the game from Itch and run your level with this downloaded version.
{% endhint %}
