narrat 0.18.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ import { State } from 'vue';
2
+ import { ActionContext } from 'vuex';
3
+ import { NarratPlugin } from './plugins/NarratPlugin';
4
+ import { CommandPlugin, generateParser } from './vm/commands/command-plugin';
5
+ import type { CommandRunner } from './vm/commands/command-plugin';
6
+ export declare type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
7
+ declare type NarratPluginObject = {
8
+ onPageLoaded?: NarratLifecycleHook;
9
+ onNarratSetup?: NarratLifecycleHook;
10
+ onAppMounted?: NarratLifecycleHook;
11
+ onAssetsLoaded?: NarratLifecycleHook;
12
+ onGameSetup?: NarratLifecycleHook;
13
+ onGameStart?: NarratLifecycleHook;
14
+ onGameMounted?: NarratLifecycleHook;
15
+ onGameUnmounted?: NarratLifecycleHook;
16
+ customCommands?: CommandPlugin[];
17
+ };
18
+ declare function registerPlugin(plugin: NarratPluginObject): void;
19
+ declare function addCommand(command: CommandPlugin): void;
20
+ export declare type NarratActionContext = ActionContext<State, State>;
21
+ export { CommandRunner };
22
+ export { CommandPlugin, NarratPluginObject, NarratPlugin, registerPlugin, addCommand, generateParser, };
package/lib/store.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { InjectionKey, State } from 'vue';
2
2
  import { Store } from 'vuex';
3
- import { DialogKey, MachineStack } from './types/vuex';
4
3
  import { AppOptions } from '.';
4
+ import { DialogKey, MachineStack } from './types/state';
5
5
  export declare type AddDialogParams = Omit<DialogKey, 'id'>;
6
6
  export interface SetupStoreResult {
7
7
  store: Store<State>;
@@ -1,9 +1,12 @@
1
- import { ItemData } from "..";
1
+ import { ItemData } from '..';
2
2
  export interface ItemState {
3
3
  amount: number;
4
4
  id: string;
5
5
  }
6
6
  export interface InventoryState {
7
+ /** Note: Items are an object so that it's easy to access specific items in game scripts.
8
+ * One side effect of this is that the order items appear in isn't technicaclly guaranteed.
9
+ * It also means there can only be one "stack" of an item at a time */
7
10
  items: {
8
11
  [key: string]: ItemState;
9
12
  };
@@ -262,6 +262,21 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
262
262
  remove(item: import("./inventory-store").ItemState): void;
263
263
  deleteItem(id: string): void;
264
264
  }>;
265
+ quests: import("pinia").Store<"quests", import("./quest-log").QuestLogState, {}, {
266
+ getQuest(questId: string): import("./quest-log").QuestState;
267
+ getObjective(quest: string, objectiveId: string): import("./quest-log").ObjectiveState;
268
+ setupQuests(quests: {
269
+ [key: string]: import("..").QuestData;
270
+ }): void;
271
+ startQuest(questId: string): void;
272
+ startObjective(questId: string, objectiveId: string): void;
273
+ completeObjective(questId: string, objectiveId: string): void;
274
+ completeQuest(questId: string, ending?: string): void;
275
+ isQuestCompleted(questId: string): boolean;
276
+ removeQuest(id: string): void;
277
+ generateSaveData(): import("./quest-log").QuestLogState;
278
+ loadSaveData(data: import("./quest-log").QuestLogState): void;
279
+ }>;
265
280
  };
266
281
  overrideStates(override: any): void;
267
282
  }>;
@@ -0,0 +1,36 @@
1
+ import { QuestData } from '..';
2
+ export interface QuestLogState {
3
+ quests: {
4
+ [key: string]: QuestState;
5
+ };
6
+ }
7
+ export interface QuestState {
8
+ id: string;
9
+ state: 'hidden' | 'unlocked' | 'completed';
10
+ ending?: string;
11
+ /** Note: Objectives are an object so that it's easy to access specific objectives in game scripts.
12
+ * One side effect of this is that the order objectives appear in isn't technicaclly guaranteed. */
13
+ objectives: {
14
+ [key: string]: ObjectiveState;
15
+ };
16
+ }
17
+ export interface ObjectiveState {
18
+ id: string;
19
+ state: 'hidden' | 'unlocked' | 'completed';
20
+ }
21
+ export declare type QuestLogSave = QuestLogState;
22
+ export declare const useQuests: import("pinia").StoreDefinition<"quests", QuestLogState, {}, {
23
+ getQuest(questId: string): QuestState;
24
+ getObjective(quest: string, objectiveId: string): ObjectiveState;
25
+ setupQuests(quests: {
26
+ [key: string]: QuestData;
27
+ }): void;
28
+ startQuest(questId: string): void;
29
+ startObjective(questId: string, objectiveId: string): void;
30
+ completeObjective(questId: string, objectiveId: string): void;
31
+ completeQuest(questId: string, ending?: string): void;
32
+ isQuestCompleted(questId: string): boolean;
33
+ removeQuest(id: string): void;
34
+ generateSaveData(): QuestLogSave;
35
+ loadSaveData(data: QuestLogSave): void;
36
+ }>;
@@ -3,6 +3,7 @@ import { DialogSave } from '@/stores/dialog-store';
3
3
  import { HudSave } from '@/stores/hud-stats-store';
4
4
  import { InventorySave } from '@/stores/inventory-store';
5
5
  import { MainSaveData } from '@/stores/main-store';
6
+ import { QuestLogSave } from '@/stores/quest-log';
6
7
  import { ScreenSave } from '@/stores/screens-store';
7
8
  import { SkillsSave } from '@/stores/skills';
8
9
  import { VMSave } from '@/stores/vm-store';
@@ -16,4 +17,5 @@ export declare type GameSave = {
16
17
  audio: AudioSave;
17
18
  hud: HudSave;
18
19
  inventory: InventorySave;
20
+ quests: QuestLogSave;
19
21
  };
@@ -8,4 +8,7 @@ export declare function getModifiableDataPinia(): {
8
8
  items: {
9
9
  [key: string]: import("@/stores/inventory-store").ItemState;
10
10
  };
11
+ quests: {
12
+ [key: string]: import("@/stores/quest-log").QuestState;
13
+ };
11
14
  };
@@ -0,0 +1,8 @@
1
+ export declare const everyObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => boolean;
2
+ export declare const someObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => boolean;
3
+ export declare const mapObject: <T, U>(object: T, mapper: (value: T[keyof T]) => U) => {
4
+ [key: string]: U;
5
+ };
6
+ export declare const filterObject: <T>(object: T, predicate: (value: T[keyof T]) => boolean) => {
7
+ [key: string]: T[keyof T];
8
+ };
@@ -0,0 +1,5 @@
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const startQuestPlugin: CommandPlugin;
3
+ export declare const startObjectivePlugin: CommandPlugin;
4
+ export declare const completeObjectivePlugin: CommandPlugin;
5
+ export declare const completeQuestPlugin: CommandPlugin;
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "narrat",
3
- "version": "0.18.0",
4
- "description": "narrat narrative engine",
5
- "main": "lib/index.js",
6
- "module": "lib/index.esm.js",
7
- "files": [
8
- "lib/"
9
- ],
10
- "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "start": "snowpack dev",
13
- "version": "npm run build",
14
- "build": "cross-env NODE_ENV=production rollup -c",
15
- "build-demo": "snowpack build",
16
- "lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
17
- "preversion": "npm run build && npm run lint",
18
- "postversion": "git push && git push --tags"
19
- },
20
- "keywords": [
21
- "game"
22
- ],
23
- "author": "Liana Pigeot <liana.pigeot@protonmail.com>",
24
- "license": "MIT",
25
- "devDependencies": {
26
- "@babel/core": "^7.12.10",
27
- "@babel/preset-env": "^7.12.11",
28
- "@rollup/plugin-commonjs": "^16.0.0",
29
- "@rollup/plugin-node-resolve": "^10.0.0",
30
- "@rollup/plugin-typescript": "^8.2.5",
31
- "@snowpack/plugin-postcss": "^1.4.3",
32
- "@snowpack/plugin-sass": "^1.4.0",
33
- "@snowpack/plugin-typescript": "^1.2.1",
34
- "@snowpack/plugin-vue": "^2.6.2",
35
- "@types/howler": "^2.2.3",
36
- "@typescript-eslint/eslint-plugin": "^4.28.3",
37
- "@typescript-eslint/parser": "^4.28.3",
38
- "@vue/compiler-sfc": "^3.0.4",
39
- "babel-loader": "^8.2.2",
40
- "babel-plugin-syntax-dynamic-import": "^6.18.0",
41
- "babel-preset-vue": "^2.0.2",
42
- "cross-env": "^7.0.3",
43
- "css-loader": "^5.0.1",
44
- "es6-promise": "^4.2.8",
45
- "eslint": "^7.30.0",
46
- "eslint-config-airbnb-base": "^14.2.1",
47
- "eslint-config-prettier": "^8.3.0",
48
- "eslint-config-standard": "^16.0.3",
49
- "eslint-import-resolver-typescript": "^2.4.0",
50
- "eslint-plugin-import": "^2.23.4",
51
- "eslint-plugin-node": "^11.1.0",
52
- "eslint-plugin-promise": "^5.1.0",
53
- "eslint-plugin-vue": "^7.13.0",
54
- "postcss": "^8.2.1",
55
- "postcss-cli": "^8.3.1",
56
- "prettier": "2.3.2",
57
- "rollup": "^2.35.1",
58
- "rollup-plugin-analyzer": "^4.0.0",
59
- "rollup-plugin-inject-process-env": "^1.3.1",
60
- "rollup-plugin-paths": "^0.0.4",
61
- "rollup-plugin-peer-deps-external": "^2.2.4",
62
- "rollup-plugin-postcss": "^4.0.0",
63
- "rollup-plugin-typescript2": "^0.30.0",
64
- "rollup-plugin-version-injector": "^1.3.0",
65
- "rollup-plugin-vue": "^6.0.0-beta.11",
66
- "snowpack": "^3.8.6",
67
- "tailwindcss": "^2.0.2",
68
- "typescript": "^4.2.3",
69
- "vue": "^3.2.37",
70
- "pinia": "^2.0.14"
71
- },
72
- "peerDependencies": {
73
- "es6-promise": "^4.2.8",
74
- "vue": "^3.2.37",
75
- "pinia": "^2.0.14"
76
- },
77
- "dependencies": {
78
- "autoprefixer": "^10.2.6",
79
- "deepmerge": "^4.2.2",
80
- "fuse.js": "^6.6.2",
81
- "howler": "^2.2.3",
82
- "svelte-jsoneditor": "^0.3.58",
83
- "vue3-mq": "^3.0.0"
84
- }
85
- }
1
+ {
2
+ "name": "narrat",
3
+ "version": "1.2.0",
4
+ "description": "narrat narrative engine",
5
+ "main": "lib/index.js",
6
+ "module": "lib/index.esm.js",
7
+ "files": [
8
+ "lib/"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "start": "snowpack dev",
13
+ "version": "npm run build",
14
+ "build": "cross-env NODE_ENV=production rollup -c",
15
+ "build-demo": "snowpack build",
16
+ "lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
17
+ "preversion": "npm run build && npm run lint",
18
+ "postversion": "git push && git push --tags"
19
+ },
20
+ "keywords": [
21
+ "game"
22
+ ],
23
+ "author": "Liana Pigeot <liana.pigeot@protonmail.com>",
24
+ "license": "MIT",
25
+ "devDependencies": {
26
+ "@babel/core": "^7.12.10",
27
+ "@babel/preset-env": "^7.12.11",
28
+ "@rollup/plugin-commonjs": "^16.0.0",
29
+ "@rollup/plugin-node-resolve": "^10.0.0",
30
+ "@rollup/plugin-typescript": "^8.2.5",
31
+ "@snowpack/plugin-postcss": "^1.4.3",
32
+ "@snowpack/plugin-sass": "^1.4.0",
33
+ "@snowpack/plugin-typescript": "^1.2.1",
34
+ "@snowpack/plugin-vue": "^2.6.2",
35
+ "@types/howler": "^2.2.3",
36
+ "@typescript-eslint/eslint-plugin": "^4.28.3",
37
+ "@typescript-eslint/parser": "^4.28.3",
38
+ "@vue/compiler-sfc": "^3.0.4",
39
+ "babel-loader": "^8.2.2",
40
+ "babel-plugin-syntax-dynamic-import": "^6.18.0",
41
+ "babel-preset-vue": "^2.0.2",
42
+ "cross-env": "^7.0.3",
43
+ "css-loader": "^5.0.1",
44
+ "es6-promise": "^4.2.8",
45
+ "eslint": "^7.30.0",
46
+ "eslint-config-airbnb-base": "^14.2.1",
47
+ "eslint-config-prettier": "^8.3.0",
48
+ "eslint-config-standard": "^16.0.3",
49
+ "eslint-import-resolver-typescript": "^2.4.0",
50
+ "eslint-plugin-import": "^2.23.4",
51
+ "eslint-plugin-node": "^11.1.0",
52
+ "eslint-plugin-promise": "^5.1.0",
53
+ "eslint-plugin-vue": "^7.13.0",
54
+ "postcss": "^8.2.1",
55
+ "postcss-cli": "^8.3.1",
56
+ "prettier": "2.3.2",
57
+ "rollup": "^2.35.1",
58
+ "rollup-plugin-analyzer": "^4.0.0",
59
+ "rollup-plugin-inject-process-env": "^1.3.1",
60
+ "rollup-plugin-paths": "^0.0.4",
61
+ "rollup-plugin-peer-deps-external": "^2.2.4",
62
+ "rollup-plugin-postcss": "^4.0.0",
63
+ "rollup-plugin-typescript2": "^0.30.0",
64
+ "rollup-plugin-version-injector": "^1.3.0",
65
+ "rollup-plugin-vue": "^6.0.0-beta.11",
66
+ "snowpack": "^3.8.6",
67
+ "tailwindcss": "^2.0.2",
68
+ "typescript": "^4.2.3",
69
+ "vue": "^3.2.37",
70
+ "pinia": "^2.0.14"
71
+ },
72
+ "peerDependencies": {
73
+ "es6-promise": "^4.2.8",
74
+ "vue": "^3.2.37",
75
+ "pinia": "^2.0.14"
76
+ },
77
+ "dependencies": {
78
+ "autoprefixer": "^10.2.6",
79
+ "deepmerge": "^4.2.2",
80
+ "fuse.js": "^6.6.2",
81
+ "howler": "^2.2.3",
82
+ "svelte-jsoneditor": "^0.3.58",
83
+ "vue3-mq": "^3.0.0"
84
+ }
85
+ }
package/CHANGELOG.md DELETED
@@ -1,336 +0,0 @@
1
- # Narrat changelog
2
-
3
- ## 1.1.0
4
-
5
- ### Inventory system
6
-
7
- There is a new inventory system.
8
-
9
- Possible items can be defined in the config:
10
-
11
- ```json
12
- "items": {
13
- "bread": {
14
- "name": "Bread",
15
- "description": "A bread in the game.",
16
- "icon": "img/items/bread.png"
17
- }
18
- }
19
- ```
20
-
21
- Then items can be added/removed in scripts:
22
-
23
- ```
24
- main:
25
- add_item bread 15
26
- remove_item bread 10
27
- $if this.items.bread.amount > 0:
28
- talk helper idle "You have %{items.bread.amount} bread"
29
- else:
30
- talk helper idle "You have no bread"
31
- ```
32
- ## 1.0.0
33
-
34
- ### State management rewrite
35
-
36
- Rewrote the state management of the engine using [pinia](https://pinia.vuejs.org/) instead of Vuex for state management.
37
-
38
- This allows the state to be more modular, easy to use and better compatible with Vue.js devtools for development of the engine, as pinia is now the official vue state management library.
39
-
40
- The version has been bumped to 1.0.0 as it's a major rewrite. No bugs have been found when testing though.
41
-
42
- ### Save files breaking change
43
-
44
- The save file format has changed, so saved games from previous versions would break. As no one is using this engine in production for now, this isn't an issue.
45
-
46
- A new `version` string has been added to save files, so that in the future it will be possible to add migrations from older save files to newer ones if needed
47
-
48
- ## Updated Vue version
49
-
50
- The Vue dependency version has been updated to the current latest (3.2.37)
51
-
52
- ## Vuex peer dependency deleted
53
-
54
- Vuex is no longer a peer dependency, and has been replaced with pinia.
55
-
56
- ## 0.11.1
57
-
58
- Fixed an error in how the narrat packaged is exported
59
-
60
- ## 0.11.0
61
-
62
- ### New Plugin system!
63
-
64
- There is now a plugin system developers can use to add new functionality to narrat (more documentation soon). See the [narrat-bitsy](https://github.com/liana-pigeot/narrat-bitsy) plugin for an example.
65
-
66
- ## 0.10.0
67
-
68
- ### New XP System
69
-
70
- - XP can be accumulated to level
71
- - config option: `skillOptions.xpPerLevel`
72
- - Use `add_xp` in script tso add xp, just like adding levels
73
- - XP now displayed in skills menu
74
-
75
- ### Other improvements
76
-
77
- - Improvements in skill checks display and difficulty
78
- - Bug fixes to skill check edge cases
79
- - Fixed a bug when not having a default title screen music
80
- - Added a new `hideAfterRoll` option to skill checks to hide their choice after they've happened once
81
- - Refactored skill check code for internal consistency between the different ways they're run
82
- - New CSS variables and classes to customise the look of skill check prompts
83
-
84
- ## 0.9.4
85
-
86
- - Fixed a bug when going back to the main menu and reloading the save without refreshing the page
87
- - New `defaultMusic` option in audio options for title screen music
88
-
89
- ## 0.9.3
90
-
91
- - Fixed a bug when loading a saved game
92
-
93
- ## 0.9.2
94
-
95
- - Added new CSS variables and id/classes to make it easier to theme games
96
-
97
- Current CSS variables list (Look at [main.css](https://github.com/liana-pigeot/narrat/blob/main/src/sass/main.css) in the narrat repo for up to date version):
98
-
99
- ```css
100
- :root {
101
- --bg-color: #131720;
102
- --text-color: #d9e1f2;
103
- --primary: hsl(255, 30%, 55%);
104
- --focus: hsl(210, 90%, 50%);
105
- --secondary: #42b983;
106
- --border-color: hsla(0, 0%, 100%, 0.2);
107
- --light-1: hsl(210, 30%, 40%);
108
- --light-2: hsl(255, 30%, 50%);
109
- --light-background: linear-gradient(to right, var(--light-1), var(--light-2));
110
- --shadow-1: hsla(236, 50%, 50%, 0.3);
111
- --shadow-2: hsla(236, 50%, 50%, 0.4);
112
- --hud-background: rgba(0, 0, 0, 0.4);
113
- --hud-text-color: var(--text-color);
114
- --notifications-bg: darkslateblue;
115
-
116
- --skills-text-background: rgba(0, 0, 0, 0.5);
117
- --skills-text-color: var(--text-color);
118
- --skills-level-background: rgba(0, 0, 0, 0.5);
119
- --skills-level-color: orange;
120
- }
121
- ```
122
-
123
- Can be edited in a game's CSS file by overriding those variables in a more specific selector. For example:
124
-
125
- ```css
126
- #app {
127
- --bg-color: white;
128
- --text-color: black;
129
- }
130
- ```
131
-
132
- would override the background and text colors of the game
133
-
134
- ## 0.9.1
135
-
136
- - Fixed a file capitalisation error in 0.9.0
137
-
138
- ## 0.9.0
139
-
140
- ### Breaking Changes
141
-
142
- New config options for skills:
143
-
144
- - `icon`: Path to the image to use for the skill's icon (currently the skill widget is 200x300, but you can override the CSS if needed)
145
- - `hidden`: Optional boolean to make the skill hidden until it is "obtained". A skill that is configured to be hidden will only start appearing in the skills menu once it's above level 0
146
-
147
- Example skills config:
148
-
149
- ```json
150
- "skills": {
151
- "agility": {
152
- "name": "Agility",
153
- "description": "How good you are at moving around.",
154
- "startingLevel": 0,
155
- "icon": "img/skills/agility.jpg",
156
- "hidden": true
157
- },
158
- "logic": {
159
- "name": "Logic",
160
- "description": "How good you are at solving problems",
161
- "icon": "img/skills/logic.jpg",
162
- "startingLevel": 0
163
- }
164
- },
165
- ```
166
-
167
- ### Bug Fixes
168
-
169
- - Music could play multiple times at once when replaying the same music
170
-
171
- ### New Features and improvements
172
-
173
- #### Development and debug
174
-
175
- - Improved debug menu with a **variable editor** to view and edit values in the `data` object.
176
- - Also added a separate editor for the entire engine/app state. Can be useful for debugging complex bugs by exploring the state of the app.
177
- - New **Quick label jump** feature to easily jump to specific labels for testing. Press **J** to open and type the name of a label then select a result with up/down arrows and press Enter
178
- - New keyboard shortcut to open debug menu (**d**)
179
- - Added a debug info panel on the main starting screen of the game with info on the shortcuts
180
-
181
- #### Engine improvements
182
-
183
- - Menu modal improved to be more compact with a cleaner design
184
- - Added fade in and fade outs when changing music (configurable in config)
185
- - **Improved the default UI** to be more pleasing to look at
186
- - Added a **return to Main Menu** button to the main menu for resetting the game
187
- - New **Skills Menu** allowing players to view their skills:
188
- - It only appears if the game has skills configured
189
- - It shows skill icons, name and current level on a grid
190
- - Clicking on a skill opens a skill page with more detailed info and the skill description
191
- - The skill menu button is next to the usual menu button
192
-
193
- ## 0.8.5
194
-
195
- - Fixed a bug with `clear_dialog` that was disabling all interaction upon use
196
-
197
- ## 0.8.4
198
-
199
- - Fixed many issues with save being broken (it didn't properly save the name of the last label the player was on, effectively restarting the game from scratch every time)
200
- - Added new things to the save function so their state gets reloaded properly on game launch:
201
- - Current music now gets saved and restarts when reloading the game, if any is active
202
- - Stats (the ones in the HUD) now get saved
203
- - Current screen is also saved
204
- - Removed many useless spammy `console.log` and added a `Logger` in the code so that most logs (outside of errors/important logs) will only appear in debug mode.
205
-
206
- ## 0.8.3
207
-
208
- - Fixed bug where menu button would move up as more text gets added to the game
209
-
210
- ## 0.8.2
211
-
212
- - Added css to hide scrollbars in the game UI
213
- - Added a new Menu button with the options to quit and change volume
214
- - Removed volume slider from the HUD and moved it to the new menu
215
-
216
- ## 0.8.1
217
-
218
- - Fixed a bug in accessing values inside conditions caused by changed in 0.7.2
219
-
220
- ## 0.8.0
221
-
222
- - Changed the `set` method to access things without caps (`data`, `skills`, `buttons` instead of `DATA`, `SKILLS`, `BUTTONS`) for consistency.
223
- - Changed string interpolation to have more accessible objects, now values in `data` need to be accessed with `%{data.something}` instead of just `%{something}`
224
- - Now possible to access skill levels in string interpolation with `%{skills.someSkill.level}`
225
- - Improvements to how skill checks are printed to be less awkward
226
-
227
- ## 0.7.1
228
-
229
- - Added `stop` and `pause` functions which work similarly to play for stopping or pausing audio.
230
-
231
- ## 0.6.5
232
-
233
- - Audio and music options from the config now get passed to howler
234
- - Renamed `path` to `src` in audio config (to be consistent with howler)
235
-
236
- ## 0.6.0
237
-
238
- Added stats feature for tracking numbers and displaying them in the hud
239
-
240
- Example config:
241
-
242
- ```
243
- "hudStats": {
244
- "money": {
245
- "icon": "img/ui/money.png",
246
- "name": "Money",
247
- "startingValue": 0,
248
- "minValue": 0
249
- },
250
- "energy": {
251
- "icon": "img/ui/energy.png",
252
- "name": "Energy",
253
- "startingValue": 10,
254
- "minValue": 0,
255
- "maxValue": 10
256
- }
257
- }
258
- ```
259
-
260
- ## 0.5.4
261
-
262
- - Improved responsive layout and fixed some issues in it
263
-
264
- New config keys required in the layout part of the config (to be documented):
265
-
266
- ```
267
- "layout": {
268
- "backgrounds": {
269
- "width": 880,
270
- "height": 720
271
- },
272
- "dialogBottomPadding": 70,
273
- "minTextWidth": 475,
274
- "mobileDialogHeightPercentage": 60,
275
- "verticalLayoutThreshold": 1000,
276
- "portraits": {
277
- "width": 100,
278
- "height": 100
279
- }
280
- },
281
- ```
282
-
283
- ## 0.4.0
284
-
285
- Added responsive layout for mobile and small screens. Still in progress, but functionnal enough to be better than before so I'm releasing it.
286
-
287
- ## 0.3.4
288
-
289
- - Improved string templating to work with deep nesting and also inside choice text
290
-
291
- ## 0.3.3
292
-
293
- - Now detects indentation size and can support any indentation size
294
-
295
- ## 0.3.2
296
-
297
- - Added a new `add_level` function for increasing the level of a skill. Example: `add_level someSkill 1` will increase the player's level in `someSkill` by 1
298
- - Added a new `notify` function for displaying a notification toast that disappears after a few seconds (duration configurable in `config.json`). Example: `notify "Hello, this is a notification"`.
299
-
300
- ## 0.3.1
301
-
302
- Added new config options for controlling how skill rolls are done and the display of their difficulty
303
-
304
- ## 0.3.0
305
-
306
- Breaking changes around renaming data access from scripts
307
-
308
- ### New Add Command
309
-
310
- New `add` command, works the same way as `set` but increments the value based on the existing value, ie. `set SKILLS.someSkill.level 2` will increment `someSkill.level` by 2.
311
-
312
- ### Skills
313
-
314
- - Now possible to set the starting value of a skill (in the config)
315
- - Now possible to edit a skill's value with `set SKILLS.someSkill.level 2` for example
316
- - Skillcheck command renamed to roll (`if this.roll("someSkillCheck", "testSkill", 40);`)
317
-
318
- ### General
319
-
320
- The `set` and `$if` command now refer to data in caps and have access to more data:
321
-
322
- - `set SKILLS.someSkill.level [value]` Sets the value of a skill
323
- - `set DATA.someData [value]` Sets a value in the data object (data is for any game-created variables)
324
- - `$if this.SKILLCHECKS.someSkillCheck.passed` now available for checking if a skillcheck has already been passed
325
-
326
- ## 0.0.14
327
-
328
- - Added the changelog (manually made for now)
329
-
330
- ## 0.0.13
331
-
332
- - Added debug menu for jumping to labels (currently doesn't support production builds disabling it)
333
- - Added saving and loading of the game (works by storing data, skills, skillchecks etc. When the game is reloaded, it is brought back at the last label visited)
334
- - Fixed a bug where conditional choices would play the wrong result if a choice is removed due to a condition
335
- - Made script loading and compilation happen during the initial loading, so everything is ready to play when pressing start game
336
- - Skill checks now also save and load their data, so a failed check becomes impossible to choose, and a succeeded skill check can be skipped if shown again