Skip to content

Commit

Permalink
feat: Fix and improve doc links in various places (#48)
Browse files Browse the repository at this point in the history
* fixing doc issues

* removed old docs warning

* added sidebar link to doc versions
  • Loading branch information
liana-p committed Apr 10, 2023
1 parent 669c120 commit abed47a
Show file tree
Hide file tree
Showing 23 changed files with 96 additions and 187 deletions.
10 changes: 10 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ const config = {
{ text: 'Editing the config', link: '/guides/config-files' },
],
},
{
text: 'Version',
items: [
{ text: 'Current Version', link: 'https://docs.get-narrat.com' },
{
text: 'v2.12.0',
link: 'https://2.12.0.--ornate-pie-561978.netlify.app',
},
],
},
],
},
title: 'Narrat Docs',
Expand Down
84 changes: 0 additions & 84 deletions docs/SUMMARY.md

This file was deleted.

90 changes: 45 additions & 45 deletions docs/commands/all-commands.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/commands/left-side-viewport-commands/set-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `set_button` function can enable or disable a button in a screen.

Syntax: `set_button [buttonId] [true, greyed, hidden or false]`

Refer to the [screens feature](../../features/screens.md) guide for more info
Refer to the [screens feature](../../features/viewport.md) guide for more info

Example:

Expand All @@ -20,7 +20,7 @@ set_button parkButton true

### Possible values

- `true`: Makes the button enabled and clickable (as long as clicking it is allowed, see [screen buttons interaction tags](../../features/screens.md#button-interaction-tags))
- `true`: Makes the button enabled and clickable (as long as clicking it is allowed, see [screen buttons interaction tags](../../features/viewport.md#button-interaction-tags))
- `false`: Makes the button completely disabled and hidden
- `greyed`: Makes the button disabled and greyed. It will be visible with semi-opacity, but not clickable
- `hidden`: Same as `false`
2 changes: 1 addition & 1 deletion docs/commands/left-side-viewport-commands/set-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ main:
set_screen flashing_overlay 1 // Will set the screen flashing_overlay on layer 1, displaying it above the background
```

See [Screens guide](../../features/screens.md) for more info
See [Screens guide](../../features/viewport.md) for more info
2 changes: 0 additions & 2 deletions docs/commands/math-commands/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/commands/modifying-variables/README.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion docs/commands/skills-commands/add-level.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The add_level function in narrat increases the level of the player in a specifie

Syntax: `add_level [skillId] [amountOfLevels]`

See the [skills system guide](../../features/skills-system.md) to know more
See the [skills system guide](../../features/skills.md) to know more

Example:

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/skills-commands/add-xp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The add_xp function in narrat increases the xp of the player in a specified skil

Syntax: `add_xp [skillId] [xp]`

See the [skills system guide](../../features/skills-system.md) to know more
See the [skills system guide](../../features/skills.md) to know more

Example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The set_level function in narrat increases the level of the player in a specifie

Syntax: `set_level [skillId] [level]`

See the [skills system guide](../../features/skills-system.md) to know more
See the [skills system guide](../../features/skills.md) to know more

Example:

Expand Down
2 changes: 0 additions & 2 deletions docs/commands/string-commands/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/features/achievements.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ achievements: data/achievements.yaml

Then achievements can be unlocked in game scripts:

```narrat
```yaml
main:
"There is a boss"
choice:
Expand Down
2 changes: 1 addition & 1 deletion docs/features/inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ main:

Items can also be used, see guide below:

[using-items.md](../guides/using-items.md)
[items.md](../guides/items.md)

<!-- ![](<../.gitbook/assets/image (4) (1).png>) -->

Expand Down
4 changes: 2 additions & 2 deletions docs/features/save-and-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If using `manual` mode, you should give the player a chance to create manual sav

To let the player save manually, there are two commands:

[save-commands.md](../commandssave-commands.md)
[save-commands.md](../commands/save-commands.md)

::: tip
Because save data is only generated when jumping to a new label, save prompts should ideally be at the start of a label. Otherwise, the data saved will be outdated.
Expand All @@ -53,7 +53,7 @@ The engine now supports global save data. Global save data isn't associated with

To use, set values in the `global` object instead of `data`. For example:

```narrat
```
main:
talk player idle "hello world"
add global.counter 1
Expand Down
4 changes: 2 additions & 2 deletions docs/features/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The `difficultyText` config array specifies a list of thresholds and the corresp
Passive skill checks are done by calling the `roll` function inside an `if` command.
See the [roll function documentation](../commandsskills-commands/roll.md) for more info and a list of options
See the [roll function documentation](../commands/skills-commands/roll.md) for more info and a list of options
If the skill check succeeds, the branch inside the if command will be run. A message will also be printed in the dialogue to inform the player that a skill check happened.
Expand Down Expand Up @@ -174,4 +174,4 @@ add_xp agility 3
### Resetting a skill roll
[reset-roll.md](../commandsskills-commands/reset-roll.md)
[reset-roll.md](../commands/skills-commands/reset-roll.md)
2 changes: 1 addition & 1 deletion docs/features/transitions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Transitions

Transitions can be used to animate the change between two screens when using the [set_screen ](../commandsleft-side-viewport-commands/set-screen.md)command
Transitions can be used to animate the change between two screens when using the [set_screen ](../commands/left-side-viewport-commands/set-screen.md)command

### Usage Example

Expand Down
2 changes: 1 addition & 1 deletion docs/features/viewport.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The `default` screen must always exist, as it is the first screen the game gets

Buttons can also have a `tag` property in their config to use interaction tag, the same way inventory items can. See the guide below for more info on interaction tags (in the interaction tags section):

[using-items.md](../guides/using-items.md)
[items.md](../guides/items.md)

## Controlling screens and buttons in scripts

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/editing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Narrat scripts are the main way a game is created. They contain the flow of the
In the `public/data` folder of the game, there is an `example.nar` file (or named differently depending on which template you used). This is where the actual game dialogue is written. The example dialogue there shows how to use a few basic features, so you can easily start writing your own dialogue. Just above is a link to the example narrat script page to find more examples as needed.

{% hint style="warning" %}
Narrat scripts are in a custom language nade for narrat, see the [Language Syntax](language-syntax-and-expressions.md) page for more info.
Narrat scripts are in a custom language nade for narrat, see the [Language Syntax](../scripting/language-syntax.md) page for more info.

We advise using [Visual Studio Code](https://code.visualstudio.com) for editing narrat scripts. There is a [Narrat Language VS Code extension](https://marketplace.visualstudio.com/items?itemName=NarratEngine.language-narrat) which will give you great syntax highlighting.

See the page linked below for more details on how to write narrat scripts.

[language-syntax-and-expressions.md](language-syntax-and-expressions.md)
[language-syntax-and-expressions.md](../scripting/language-syntax.md)

### Config files

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You will probably see npm complain about "**security issues**". Those are false
npm start
```

This should open a browser tab with the game running after a short build time. The game can be accessed at https://localhost:8080
This should open a browser tab with the game running after a short build time. The game can be accessed at <a href="http://localhost:5173/" target="_blank" rel="noreferrer">http://localhost:5173/</a>

The game is ready to edit!

Expand All @@ -98,7 +98,7 @@ Those `npm` commands come from node.js. If the commands aren't recognised, you p

It is now easy to make a game by editing the narrat scripts and config files!

[Editing the game](/guides/editing-the-game)
[Editing the game](editing-game)

## Building and exporting the game

Expand Down
51 changes: 22 additions & 29 deletions docs/features/items.md → docs/guides/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,30 @@ There are also interaction groups which allow scripts to toggle on/off whether u

Config:

```
"items": {
"bread": {
"name": "Bread",
"description": "A bread in the game.",
"icon": "img/items/bread.png",
"onUse": {
"action": "jump",
"label": "eat_bread"
},
"tag": "default"
},
"book": {
"name": "Ominous Book",
"description": "An ominous book",
"icon": "img/items/book.png",
"onUse": {
"action": "run_label",
"label": "read_book"
},
"tag": "always_interactable"
}
},
"interactionTags": {
"default": {
"onlyInteractOutsideOfScripts": true
}
}
```yaml
items:
bread:
name: Bread
description: A bread in the game.
icon: img/items/bread.png
onUse:
action: jump
label: eat_bread
tag: default
book:
name: Ominous Book
description: An ominous book
icon: img/items/book.png
onUse:
action: run_label
label: read_book
tag: always_interactable
interactionTags:
default:
onlyInteractOutsideOfScripts: true
```
The `onUse` `action` property can be either `jump` or `run`, allowing to either jump to a script, or run a script as a function (see [1.3.0 changes](https://github.com/liana-p/narrat-engine/blob/main/CHANGELOG.md#1.3.0) or [functions docs](https://docs.get-narrat.com/features/functions)), which effectively allows interrupting the current dialogue to run an item's function before going back to it.
The `onUse` `action` property can be either `jump` or `run`, allowing to either jump to a script, or run a script as a function (see [1.3.0 changes](https://github.com/liana-p/narrat-engine/blob/main/CHANGELOG.md#1.3.0) or [functions docs](../scripting/functions)), which effectively allows interrupting the current dialogue to run an item's function before going back to it.

### Interaction tags

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/steam-publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ narrat now has a [Steamworks](https://partner.steamgames.com/) integration by de

For a primer on how to generally build and export narrat games, see this page:

[building-and-exporting-your-game.md](building-and-exporting-your-game.md)
[building-and-exporting-your-game.md](building-and-exporting)

### How to build for Steam

Expand Down
4 changes: 0 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

[Getting Started](/guides/getting-started.md)

::: danger
This is the **new documentation website**. It is better than the old one but might be missing some pages or have issues. If you need to refer to the old docs please go to [docs-old.get-narrat.com](https://docs-old.get-narrat.com)
:::

## Introduction

Narrat is a game engine for making interactive narrative RPGs packed with features. Create your game by editing with a Simple scripting syntax. It supports Skills with skill check rolls, an Items inventory, and has a Quests System. The script system is very powerful and allows branching choices, functions, variables and conditions.
Expand Down

0 comments on commit abed47a

Please sign in to comment.