> For the complete documentation index, see [llms.txt](https://freedom-developer.gitbook.io/the-chess/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freedom-developer.gitbook.io/the-chess/scenes-details/chesspgn.md).

# ChessPGN

### **Scene Description**

<figure><img src="/files/llLfzn3UJODRcdNekGA3" alt=""><figcaption></figcaption></figure>

The dropdown bar at the top side of the scene act as a navigator for all processed PGN text file data, as shown in image above.

Descriptions of numbered UI in image above : &#x20;

1\) **Puzzle Editor Button** - This button **not only** load Puzzle Editor scene but leaving the ChessPGN scene undestroyed, things can be continued when moving back from ChessPuzzleEditor scene. On top of that, currently viewing game match data from this scene will be carry over to ChessPuzzleEditor scene for editing. However, there are two options while picking type of data to be transferred.

<figure><img src="/files/cK7gSYPohiBzq6POkEkx" alt=""><figcaption></figcaption></figure>

i) Move Variant - Transfer only current move variant data that are displaying in the 2) Move Variant Scroll View and any other saved move variant data that will not cause illegal moves. Fixed moves data, those converted from algebraic notations of text file, will be carried over partially if not fully, up to the bridging point(as displayed by grey button in the 2) Move Variant Scroll View).

ii) Fixed Move - All move variant data will be ignored while all of the displaying fixed moves data, will be carried over.

2\) **Move Variant Scroll View** -  It is exactly the same as the **Move Variant Scroll View** in [ChessPuzzleEditor scene](/the-chess/scenes-details/chesspuzzleeditor.md#mode-2-edit-puzzle-mode).

The scroll view on the right side of this scene is exactly same as the **Fixed Move Variant Scroll View** in [ChessPuzzleEditor scene](/the-chess/scenes-details/chesspuzzleeditor.md#mode-2-edit-puzzle-mode). The difference is that making a move by the controller is possible when green button is in this scroll view.

### **How to load PGN text file**

The PGN text folder is located at path Resources/PGN/TextFiles, any newly imported PGN text files have to be in this location.

To be able to select a new imported PGN text file :&#x20;

1\) The exact file name has to be registed in ChessPGNGameFilesName scriptable object located in Resources/ScriptableObjects/ChessPGN folder.

<figure><img src="/files/FtvNuUpLzQ604upZcuh9" alt=""><figcaption></figcaption></figure>

2\) The PGN text file selection dropdown will automatic refer to the file name in the list of ChessPGNGameFilesName scriptable object according to index of itself(without counting in Custom dropdown option), add as many dropdown options as the number of text file name in the scriptable object list, the dropdown name isn't necessary to match the text file name, but the index does.

<figure><img src="/files/TY8RJlDc1Ht2wpAAF7QK" alt=""><figcaption><p>PGN text file selection dropdown</p></figcaption></figure>

<figure><img src="/files/axk6YYM0qvlkWJ5lMS7b" alt=""><figcaption></figcaption></figure>

### **How to add new PGN header record type for PGN file text format?**

**The example format for PGN text file**

![](/files/FECq1vWmoghuftAkIEX2)

Step 1

In ChessPGNRecord.cs file located at path Scripts/Mechanism/Structs, add new property to ChessPGNRecord struct, the name of the property will be used in step 3.

![](/files/XCBhOc5fAepxCTSvSXgt)

Step 2

Note that each of the values contained in ChessPGNType enum are the exact name as circled in red in below image. If there are different or additional name in the PGN header section in your own format, just modify or add those value to ChessPGNType enum, then move on to the next step.

![](/files/Odj4cy8VyU8oTyCSRVW2)

![](/files/jRcIg75anntZ5Nf95vaG) ![](/files/gyfZD9pTwqsC2WVQEGUI)

Step 3

In HelperGUI.cs file located at path Scripts/Main/Others, in the `ConvertToPGNRecords(TextAsset)` function, add an else if statement for the new property added from 2nd Steps like the example image below.

![](/files/sZWs6Bt2GXwPr9obiFcT)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://freedom-developer.gitbook.io/the-chess/scenes-details/chesspgn.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
