documentation

This commit is contained in:
2026-05-18 13:49:35 +01:00
parent 051bfe46e4
commit 5f294cceb2
6 changed files with 728 additions and 652 deletions
+35 -85
View File
@@ -2,6 +2,8 @@
An interactive story telling software.
Read and write people's stories
For help with making a story, see [this documentation](/docs/MAKING_A_STORY.md)
For help with syntax, see [this documentation](/docs/SYNTAX.md)
## Install
@@ -9,11 +11,7 @@ This is not really out of development, but to run it, clone the repo, go into /s
## Technical Details
### Back-end server -- Rust
The server component of Happening will be written in Rust.<br/>
Parses the code and sends it via the API.<br/>
File layout:
### File layout
- animations/
- features/
@@ -29,14 +27,25 @@ File layout:
- features/
- scenes/
- images/
### Back-end server -- Rust
The variables are stored as a hashmap, characters are objects.<br/>
The server component of Happening will be written in Rust.<br/>
Parses the code and sends it via the API.<br/>
File layout:
The variables are stored as a hashmap, characters are structs in a hashmap.<br/>
### API
Using the network interface, port 20264.<br/>
Characters are sent to the frontend and stored there when the character is created on the frontend.<br/>
There are 4 endpoints.
#### /happening
GET Returns what is happening on the next cycle:
```
{
@@ -47,35 +56,41 @@ content: String,
character: String,
choice: [String,String,String,...]
}
```
#### /character/\<character name\>
GET Returns the struct of the character, ideally this should only be gotten when a new character is made or a character changes a feature.
#### /choice
POST the choice as a JSON formatting number, eg 1 to choose choice index 1, returns "ack" as acknowledgment.
#### /input
POST not yet fully implemented on the syntax side but allows client to send a user input to the server as text. returns "ack" as acknowlegment.
### Frontend -- Python
Things the frontend can do:
Things the frontend should be able to:
- Output text
- Display the character
- Move characters around
- Display a choice to the user that gets sent back to the server
### Syntax
### Files
#### Setup
For more info on these files see [Making a Story](/docs/MAKING_A_STORY.md)
This is done in the about.json file,
#### story.ha
```
{
This contains the code for the story, syntax for writing the code can be seen in [the syntax section](/docs/SYNTAX.md)
"title": "My Great Story",
#### about.json
"description": "please read!"
This file contains details about your story such as the title and description.
}
```
#### Characters
#### characters.json
See [Character documentation](/docs/CHARACTER.md) for more info
Referencing a character using the @, @NARRATOR is reserved for the Narrator.<br/>
@@ -85,72 +100,6 @@ Move a character with @CHARACTER to fr
> [!NOTE]
> fr means front-right for instance.
#### Outputs
```
@CHARACTER says "this string
is multi-line
and ends with a"
```
#### Variables
Variables are referenced with the \$, only integers will be supported.<br/>
#### Selection
Condition based:
```
if (condition) {
}
elif (condition) {
}
else
}
```
Choice based:
```
choice "choice 1" {
}
or "choice 2" {
}
or "choice 3" {
}
```
#### Positioning
```
@CHARACTER to position
PAN to position
```
#### Other
```
label:
GOTO label
```
#### Ending
`END` to exit out of the story
## Implemented stuff
### Commands
@@ -160,7 +109,7 @@ GOTO label
| END | Yes |
| CHOICE/OR/OR | Yes |
| IF/ELSE IF/ELSE | No |
| GOTO | No |
| GOTO | Yes |
| PAN | No |
### Character sub-commands
@@ -178,6 +127,7 @@ GOTO label
| ---------- | ----------- |
| Variables | No |
| about.json | No |
| INPUT | Partially |
## Error codes