explain current skills setup

This commit is contained in:
Matt Brockman 2021-01-15 20:44:31 -08:00
parent cfafc231d9
commit 236a2aa5dc
2 changed files with 37 additions and 0 deletions

View file

@ -57,6 +57,10 @@ The `state` variable can be used to store information that's persistent across f
* `state.inventory` takes an array of objects [{name, quantity}] which will be make the inventory option available in the adventure menu (right). For now, this just displays all items and thier quantities from the inventory. * `state.inventory` takes an array of objects [{name, quantity}] which will be make the inventory option available in the adventure menu (right). For now, this just displays all items and thier quantities from the inventory.
See https://github.com/latitudegames/Scripting/blob/master/examples/addSimpleInventory.js for an example. See https://github.com/latitudegames/Scripting/blob/master/examples/addSimpleInventory.js for an example.
* `state.evaluationBot` uses an evlation bot to assess latest actions and convert it to machine readable formats. The results of the `evaluationBot` are returned in `info.evaluation`. Different bots return a `reason` (description of their interpretation of the text) as well as various assessment such as `loot` or `health`. See https://github.com/latitudegames/Scripting/blob/master/examples/evaluationBots.js for usage and available bots. * `state.evaluationBot` uses an evlation bot to assess latest actions and convert it to machine readable formats. The results of the `evaluationBot` are returned in `info.evaluation`. Different bots return a `reason` (description of their interpretation of the text) as well as various assessment such as `loot` or `health`. See https://github.com/latitudegames/Scripting/blob/master/examples/evaluationBots.js for usage and available bots.
* `state.skills` is a dictionary {...values, skill(str):level(int)}. A value in state.skills will enable the skills overlay in the adventure menu. The skills overlay allows players to allocate `skillPoints` or learn `random skills` which can be set with the following parameters:
* `state.disableRandomSkill` disables the user from learning random skills in the screen
* `state.skillPoints` sets the number of skill points a player has available.
* You can set any variable on state to store and modify adventures throughout an adventure. * You can set any variable on state to store and modify adventures throughout an adventure.

33
examples/skills.js Normal file
View file

@ -0,0 +1,33 @@
//input modifiers to set up skills
//EXAMPLE 1
//creates skills with 0 skill points
const modifier = (text) => {
state.skills = {'turtle':1}
}
// Don't modify this part
modifier(text)
//EXAMPLE 2
//creates skills with 1 skill point
const modifier = (text) => {
state.skills = {'turtle':1}
state.skillPoints = 1
}
// Don't modify this part
modifier(text)
//EXAMPLE 3
//creates skills with 5 skill points and
const modifier = (text) => {
state.skills = {'turtle':1}
state.skillPoints = 1
state.disableRandomSkill = true
}
// Don't modify this part
modifier(text)