# Tutorial

## Writing your first scene

Make sure all the steps from [Getting Started](https://uyen18827.gitbook.io/veinif/tutorial-1/getting-started) has been done successfully. At this point, your browser should display the example game through `localhost`

Open `src/game/allParagraphs.ts`. You will be greeted with the demo game content inside function `getParagraph()`. Delete all content inside&#x20;

Currently, Visual Studio Code users can quickly generate VeinIF code snippets. type `paragraph` and press TAB or Enter for a new paragraph object.

![Snippet!](https://2901370289-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIeBaBOKpPAkLySgC0P%2F-M_B8eXiDOxKo5L3LJ5W%2F-M_BKAY41A7Dekm0MzKp%2Fimage.png?alt=media\&token=ad8411ad-085d-4bf4-a0b9-a9675d5f36c0)

```
{
  name: "",
  content: ``,
  choices: [
    {
     id: 1, 
     content: ``, 
     nextName: `` 
    },
  ],
},
```

For other IDEs, this function is not supported yet. Simply copy the above code into `getParagraph()`

The first paragraph object should has property `name: "start"`

The `nextName` property of a choice and `name` property of a paragraph must match to successfully "branch" them together.

**Example**:

```typescript
{
   name: "start",
   content: `This is the content of the first paragraph`,
   item: [
     {
      itemName: `flower`,
      itemQty: 1,
      description: `A single purple flower.`,
       itemCode: `purple-flower`,
     },
          
   ],
   choices: [
     {
      id: 1, 
      content: `Nice. Let's go to the next one.`, 
      nextName: `next-p` 
     },
   ],
 },
 {
   name: "next-p",
   content: `This is the next paragraph!`,
   choices: [
     {
      id: 1, 
      content: `Content Content!`, 
      nextName: `start-1` 
     },
   ],
 },
```


---

# Agent Instructions: 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:

```
GET https://uyen18827.gitbook.io/veinif/tutorial-1/tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
