docs: added Option object

This commit is contained in:
Bram Dingelstad 2021-11-27 17:22:09 +01:00
parent da3401a508
commit 640f40298e
2 changed files with 43 additions and 6 deletions

View file

@ -53,6 +53,7 @@ __meta__ = {
[node name="Background" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0.96, 0.95648, 0.9408, 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -12,6 +12,8 @@ Write your conversations in *Yarn*, a simple programming language that's designe
Yarn's similar in style to [Twine](http://twinery.org), so if you already know that, you'll be right at home! If you don't, that's cool - Yarn's syntax is extremely minimal, and there's not much there to learn.
Wol is actively maintained by [Bram Dingelstad](https://bram.dingelstad.works), if you need a programmer or designer for your next (Godot) project, you can [hire him!](https://hire.bram.dingelstad.works)
## Getting Started
This repo contains the source code for the Wol compiler. If you want to use it in a game engine other than Godot, you should get the appropriate package for your game engine. Check out [YarnSpinner-Unity](https://github.com/YarnSpinnerTool/YarnSpinner-Unity) for a Unity version of this project.
@ -28,7 +30,6 @@ Unfortunately, this option isn't available yet. Stay tuned!
5. Enable the plugin in your Project Settings.
6. Setup the Wol node using the [documentation](README.md#Documentation) or [tutorial](README.md#Tutorial)!
## Roadmap
There are few things that need to be ironed out to be 100% feature compatible with the original YarnSpinner.
@ -37,16 +38,21 @@ There are few things that need to be ironed out to be 100% feature compatible wi
- [ ] Full support for [format functions](https://yarnspinner.dev/docs/syntax/#format-functions).
- [ ] In-editor dialogue editor with preview.
- [ ] Fully extend the documentation of this project.
- [ ] Document the `Option` object.
- [ ] Write the method descriptions for the `Wol` node.
- [x] Document the `Option` object.
- [x] Write the method descriptions for the `Wol` node.
- [ ] Write a basic "Hello World"-esque tutorial.
- [ ] Write a more advanced "Custom `Wol` Node" tutorial.
- [ ] Perhaps write a little bit about the internals 🤷 (?).
- [ ] Provide helpful anchors in the documentation.
- [x] Porting to usable signals in Godot.
- [x] Providing helpful errors when failing to compile.
- [x] Having a working repository with example code.
### On request
If for whatever reason a lot of people want more documentation or certain features, here's some additional stuff I'll do:
- [ ] Write a more advanced "Custom `Wol` Node" tutorial.
- [ ] Perhaps write a little bit about the internals 🤷 (?).
## Getting Help
There are several places to get help with Wol, and stay up to date with what's happening.
@ -238,6 +244,36 @@ The `Line` object is _the_ object that you're gonna be interacting with the most
Currently unimplemented.
## `Option`
_Inherits from [Object](https://docs.godotengine.org/en/stable/classes/class_object.html)_
An object holding information of an option in your dialogue.
### Description
The `Option` object is anoter object that you're gonna be interacting with a lot. This object holds the information of a choice in your dialogue.
It has a reference to a `Line` with it's `line` property so you can show the appropriate text to your player!
### Properties
| Type | Property |
|-------------------------------------------------------------------------------------------|---------------|
| [int](https://docs.godotengine.org/en/stable/classes/class_int.html#class-int) | id |
| `Line` | line |
| [String](https://docs.godotengine.org/en/lastest/classes/class_string.html#class-string) | destination |
### Property Descriptions
* [int](https://docs.godotengine.org/en/stable/classes/class_int.html#class-int) id
A unique identifier that you can use to communicate your option choice with `select_option ( id )`.
* `Line` line
A line of dialogue that's been processed by Wol. See `Line` for more details.
* [String](https://docs.godotengine.org/en/lastest/classes/class_string.html#class-string) destination
The node that you will jump to when this option is selected. (Only relevant for jump questions, not inline ones).
# Tutorial