├── LICENSE.txt
├── README.md
├── contextModifier.js
├── inputModifier.js
├── outputModifier.js
└── shared.js
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Attribution-NonCommercial 4.0 International
2 |
3 | =======================================================================
4 |
5 | Creative Commons Corporation ("Creative Commons") is not a law firm and
6 | does not provide legal services or legal advice. Distribution of
7 | Creative Commons public licenses does not create a lawyer-client or
8 | other relationship. Creative Commons makes its licenses and related
9 | information available on an "as-is" basis. Creative Commons gives no
10 | warranties regarding its licenses, any material licensed under their
11 | terms and conditions, or any related information. Creative Commons
12 | disclaims all liability for damages resulting from their use to the
13 | fullest extent possible.
14 |
15 | Using Creative Commons Public Licenses
16 |
17 | Creative Commons public licenses provide a standard set of terms and
18 | conditions that creators and other rights holders may use to share
19 | original works of authorship and other material subject to copyright
20 | and certain other rights specified in the public license below. The
21 | following considerations are for informational purposes only, are not
22 | exhaustive, and do not form part of our licenses.
23 |
24 | Considerations for licensors: Our public licenses are
25 | intended for use by those authorized to give the public
26 | permission to use material in ways otherwise restricted by
27 | copyright and certain other rights. Our licenses are
28 | irrevocable. Licensors should read and understand the terms
29 | and conditions of the license they choose before applying it.
30 | Licensors should also secure all rights necessary before
31 | applying our licenses so that the public can reuse the
32 | material as expected. Licensors should clearly mark any
33 | material not subject to the license. This includes other CC-
34 | licensed material, or material used under an exception or
35 | limitation to copyright. More considerations for licensors:
36 | wiki.creativecommons.org/Considerations_for_licensors
37 |
38 | Considerations for the public: By using one of our public
39 | licenses, a licensor grants the public permission to use the
40 | licensed material under specified terms and conditions. If
41 | the licensor's permission is not necessary for any reason--for
42 | example, because of any applicable exception or limitation to
43 | copyright--then that use is not regulated by the license. Our
44 | licenses grant only permissions under copyright and certain
45 | other rights that a licensor has authority to grant. Use of
46 | the licensed material may still be restricted for other
47 | reasons, including because others have copyright or other
48 | rights in the material. A licensor may make special requests,
49 | such as asking that all changes be marked or described.
50 | Although not required by our licenses, you are encouraged to
51 | respect those requests where reasonable. More considerations
52 | for the public:
53 | wiki.creativecommons.org/Considerations_for_licensees
54 |
55 | =======================================================================
56 |
57 | Creative Commons Attribution-NonCommercial 4.0 International Public
58 | License
59 |
60 | By exercising the Licensed Rights (defined below), You accept and agree
61 | to be bound by the terms and conditions of this Creative Commons
62 | Attribution-NonCommercial 4.0 International Public License ("Public
63 | License"). To the extent this Public License may be interpreted as a
64 | contract, You are granted the Licensed Rights in consideration of Your
65 | acceptance of these terms and conditions, and the Licensor grants You
66 | such rights in consideration of benefits the Licensor receives from
67 | making the Licensed Material available under these terms and
68 | conditions.
69 |
70 |
71 | Section 1 -- Definitions.
72 |
73 | a. Adapted Material means material subject to Copyright and Similar
74 | Rights that is derived from or based upon the Licensed Material
75 | and in which the Licensed Material is translated, altered,
76 | arranged, transformed, or otherwise modified in a manner requiring
77 | permission under the Copyright and Similar Rights held by the
78 | Licensor. For purposes of this Public License, where the Licensed
79 | Material is a musical work, performance, or sound recording,
80 | Adapted Material is always produced where the Licensed Material is
81 | synched in timed relation with a moving image.
82 |
83 | b. Adapter's License means the license You apply to Your Copyright
84 | and Similar Rights in Your contributions to Adapted Material in
85 | accordance with the terms and conditions of this Public License.
86 |
87 | c. Copyright and Similar Rights means copyright and/or similar rights
88 | closely related to copyright including, without limitation,
89 | performance, broadcast, sound recording, and Sui Generis Database
90 | Rights, without regard to how the rights are labeled or
91 | categorized. For purposes of this Public License, the rights
92 | specified in Section 2(b)(1)-(2) are not Copyright and Similar
93 | Rights.
94 | d. Effective Technological Measures means those measures that, in the
95 | absence of proper authority, may not be circumvented under laws
96 | fulfilling obligations under Article 11 of the WIPO Copyright
97 | Treaty adopted on December 20, 1996, and/or similar international
98 | agreements.
99 |
100 | e. Exceptions and Limitations means fair use, fair dealing, and/or
101 | any other exception or limitation to Copyright and Similar Rights
102 | that applies to Your use of the Licensed Material.
103 |
104 | f. Licensed Material means the artistic or literary work, database,
105 | or other material to which the Licensor applied this Public
106 | License.
107 |
108 | g. Licensed Rights means the rights granted to You subject to the
109 | terms and conditions of this Public License, which are limited to
110 | all Copyright and Similar Rights that apply to Your use of the
111 | Licensed Material and that the Licensor has authority to license.
112 |
113 | h. Licensor means the individual(s) or entity(ies) granting rights
114 | under this Public License.
115 |
116 | i. NonCommercial means not primarily intended for or directed towards
117 | commercial advantage or monetary compensation. For purposes of
118 | this Public License, the exchange of the Licensed Material for
119 | other material subject to Copyright and Similar Rights by digital
120 | file-sharing or similar means is NonCommercial provided there is
121 | no payment of monetary compensation in connection with the
122 | exchange.
123 |
124 | j. Share means to provide material to the public by any means or
125 | process that requires permission under the Licensed Rights, such
126 | as reproduction, public display, public performance, distribution,
127 | dissemination, communication, or importation, and to make material
128 | available to the public including in ways that members of the
129 | public may access the material from a place and at a time
130 | individually chosen by them.
131 |
132 | k. Sui Generis Database Rights means rights other than copyright
133 | resulting from Directive 96/9/EC of the European Parliament and of
134 | the Council of 11 March 1996 on the legal protection of databases,
135 | as amended and/or succeeded, as well as other essentially
136 | equivalent rights anywhere in the world.
137 |
138 | l. You means the individual or entity exercising the Licensed Rights
139 | under this Public License. Your has a corresponding meaning.
140 |
141 |
142 | Section 2 -- Scope.
143 |
144 | a. License grant.
145 |
146 | 1. Subject to the terms and conditions of this Public License,
147 | the Licensor hereby grants You a worldwide, royalty-free,
148 | non-sublicensable, non-exclusive, irrevocable license to
149 | exercise the Licensed Rights in the Licensed Material to:
150 |
151 | a. reproduce and Share the Licensed Material, in whole or
152 | in part, for NonCommercial purposes only; and
153 |
154 | b. produce, reproduce, and Share Adapted Material for
155 | NonCommercial purposes only.
156 |
157 | 2. Exceptions and Limitations. For the avoidance of doubt, where
158 | Exceptions and Limitations apply to Your use, this Public
159 | License does not apply, and You do not need to comply with
160 | its terms and conditions.
161 |
162 | 3. Term. The term of this Public License is specified in Section
163 | 6(a).
164 |
165 | 4. Media and formats; technical modifications allowed. The
166 | Licensor authorizes You to exercise the Licensed Rights in
167 | all media and formats whether now known or hereafter created,
168 | and to make technical modifications necessary to do so. The
169 | Licensor waives and/or agrees not to assert any right or
170 | authority to forbid You from making technical modifications
171 | necessary to exercise the Licensed Rights, including
172 | technical modifications necessary to circumvent Effective
173 | Technological Measures. For purposes of this Public License,
174 | simply making modifications authorized by this Section 2(a)
175 | (4) never produces Adapted Material.
176 |
177 | 5. Downstream recipients.
178 |
179 | a. Offer from the Licensor -- Licensed Material. Every
180 | recipient of the Licensed Material automatically
181 | receives an offer from the Licensor to exercise the
182 | Licensed Rights under the terms and conditions of this
183 | Public License.
184 |
185 | b. No downstream restrictions. You may not offer or impose
186 | any additional or different terms or conditions on, or
187 | apply any Effective Technological Measures to, the
188 | Licensed Material if doing so restricts exercise of the
189 | Licensed Rights by any recipient of the Licensed
190 | Material.
191 |
192 | 6. No endorsement. Nothing in this Public License constitutes or
193 | may be construed as permission to assert or imply that You
194 | are, or that Your use of the Licensed Material is, connected
195 | with, or sponsored, endorsed, or granted official status by,
196 | the Licensor or others designated to receive attribution as
197 | provided in Section 3(a)(1)(A)(i).
198 |
199 | b. Other rights.
200 |
201 | 1. Moral rights, such as the right of integrity, are not
202 | licensed under this Public License, nor are publicity,
203 | privacy, and/or other similar personality rights; however, to
204 | the extent possible, the Licensor waives and/or agrees not to
205 | assert any such rights held by the Licensor to the limited
206 | extent necessary to allow You to exercise the Licensed
207 | Rights, but not otherwise.
208 |
209 | 2. Patent and trademark rights are not licensed under this
210 | Public License.
211 |
212 | 3. To the extent possible, the Licensor waives any right to
213 | collect royalties from You for the exercise of the Licensed
214 | Rights, whether directly or through a collecting society
215 | under any voluntary or waivable statutory or compulsory
216 | licensing scheme. In all other cases the Licensor expressly
217 | reserves any right to collect such royalties, including when
218 | the Licensed Material is used other than for NonCommercial
219 | purposes.
220 |
221 |
222 | Section 3 -- License Conditions.
223 |
224 | Your exercise of the Licensed Rights is expressly made subject to the
225 | following conditions.
226 |
227 | a. Attribution.
228 |
229 | 1. If You Share the Licensed Material (including in modified
230 | form), You must:
231 |
232 | a. retain the following if it is supplied by the Licensor
233 | with the Licensed Material:
234 |
235 | i. identification of the creator(s) of the Licensed
236 | Material and any others designated to receive
237 | attribution, in any reasonable manner requested by
238 | the Licensor (including by pseudonym if
239 | designated);
240 |
241 | ii. a copyright notice;
242 |
243 | iii. a notice that refers to this Public License;
244 |
245 | iv. a notice that refers to the disclaimer of
246 | warranties;
247 |
248 | v. a URI or hyperlink to the Licensed Material to the
249 | extent reasonably practicable;
250 |
251 | b. indicate if You modified the Licensed Material and
252 | retain an indication of any previous modifications; and
253 |
254 | c. indicate the Licensed Material is licensed under this
255 | Public License, and include the text of, or the URI or
256 | hyperlink to, this Public License.
257 |
258 | 2. You may satisfy the conditions in Section 3(a)(1) in any
259 | reasonable manner based on the medium, means, and context in
260 | which You Share the Licensed Material. For example, it may be
261 | reasonable to satisfy the conditions by providing a URI or
262 | hyperlink to a resource that includes the required
263 | information.
264 |
265 | 3. If requested by the Licensor, You must remove any of the
266 | information required by Section 3(a)(1)(A) to the extent
267 | reasonably practicable.
268 |
269 | 4. If You Share Adapted Material You produce, the Adapter's
270 | License You apply must not prevent recipients of the Adapted
271 | Material from complying with this Public License.
272 |
273 |
274 | Section 4 -- Sui Generis Database Rights.
275 |
276 | Where the Licensed Rights include Sui Generis Database Rights that
277 | apply to Your use of the Licensed Material:
278 |
279 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right
280 | to extract, reuse, reproduce, and Share all or a substantial
281 | portion of the contents of the database for NonCommercial purposes
282 | only;
283 |
284 | b. if You include all or a substantial portion of the database
285 | contents in a database in which You have Sui Generis Database
286 | Rights, then the database in which You have Sui Generis Database
287 | Rights (but not its individual contents) is Adapted Material; and
288 |
289 | c. You must comply with the conditions in Section 3(a) if You Share
290 | all or a substantial portion of the contents of the database.
291 |
292 | For the avoidance of doubt, this Section 4 supplements and does not
293 | replace Your obligations under this Public License where the Licensed
294 | Rights include other Copyright and Similar Rights.
295 |
296 |
297 | Section 5 -- Disclaimer of Warranties and Limitation of Liability.
298 |
299 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
300 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
301 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
302 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
303 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
304 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
305 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
306 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
307 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
308 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
309 |
310 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
311 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
312 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
313 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
314 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
315 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
316 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
317 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
318 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
319 |
320 | c. The disclaimer of warranties and limitation of liability provided
321 | above shall be interpreted in a manner that, to the extent
322 | possible, most closely approximates an absolute disclaimer and
323 | waiver of all liability.
324 |
325 |
326 | Section 6 -- Term and Termination.
327 |
328 | a. This Public License applies for the term of the Copyright and
329 | Similar Rights licensed here. However, if You fail to comply with
330 | this Public License, then Your rights under this Public License
331 | terminate automatically.
332 |
333 | b. Where Your right to use the Licensed Material has terminated under
334 | Section 6(a), it reinstates:
335 |
336 | 1. automatically as of the date the violation is cured, provided
337 | it is cured within 30 days of Your discovery of the
338 | violation; or
339 |
340 | 2. upon express reinstatement by the Licensor.
341 |
342 | For the avoidance of doubt, this Section 6(b) does not affect any
343 | right the Licensor may have to seek remedies for Your violations
344 | of this Public License.
345 |
346 | c. For the avoidance of doubt, the Licensor may also offer the
347 | Licensed Material under separate terms or conditions or stop
348 | distributing the Licensed Material at any time; however, doing so
349 | will not terminate this Public License.
350 |
351 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
352 | License.
353 |
354 |
355 | Section 7 -- Other Terms and Conditions.
356 |
357 | a. The Licensor shall not be bound by any additional or different
358 | terms or conditions communicated by You unless expressly agreed.
359 |
360 | b. Any arrangements, understandings, or agreements regarding the
361 | Licensed Material not stated herein are separate from and
362 | independent of the terms and conditions of this Public License.
363 |
364 |
365 | Section 8 -- Interpretation.
366 |
367 | a. For the avoidance of doubt, this Public License does not, and
368 | shall not be interpreted to, reduce, limit, restrict, or impose
369 | conditions on any use of the Licensed Material that could lawfully
370 | be made without permission under this Public License.
371 |
372 | b. To the extent possible, if any provision of this Public License is
373 | deemed unenforceable, it shall be automatically reformed to the
374 | minimum extent necessary to make it enforceable. If the provision
375 | cannot be reformed, it shall be severed from this Public License
376 | without affecting the enforceability of the remaining terms and
377 | conditions.
378 |
379 | c. No term or condition of this Public License will be waived and no
380 | failure to comply consented to unless expressly agreed to by the
381 | Licensor.
382 |
383 | d. Nothing in this Public License constitutes or may be interpreted
384 | as a limitation upon, or waiver of, any privileges and immunities
385 | that apply to the Licensor or You, including from the legal
386 | processes of any jurisdiction or authority.
387 |
388 | =======================================================================
389 |
390 | Creative Commons is not a party to its public
391 | licenses. Notwithstanding, Creative Commons may elect to apply one of
392 | its public licenses to material it publishes and in those instances
393 | will be considered the “Licensor.” The text of the Creative Commons
394 | public licenses is dedicated to the public domain under the CC0 Public
395 | Domain Dedication. Except for the limited purpose of indicating that
396 | material is shared under a Creative Commons public license or as
397 | otherwise permitted by the Creative Commons policies published at
398 | creativecommons.org/policies, Creative Commons does not authorize the
399 | use of the trademark "Creative Commons" or any other trademark or logo
400 | of Creative Commons without its prior written consent including,
401 | without limitation, in connection with any unauthorized modifications
402 | to any of its public licenses or any other arrangements,
403 | understandings, or agreements concerning use of licensed material. For
404 | the avoidance of doubt, this paragraph does not form part of the
405 | public licenses.
406 |
407 | Creative Commons may be contacted at creativecommons.org.
408 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple Context 2 - BETA
2 |
3 |
4 |
5 |
6 | ### **NOTE: THIS REPO WILL NO LONGER MAINTAIN SC2. ALL FUTURE WORK ON SC2 HAS MOVED TO SHEL'S REPO [HERE](https://github.com/MagicShel/aid-simple-context).**
7 |
8 |
9 |
10 | ## Main Features
11 | - [x] **Keep the AI on track of your story automatically**
12 |
13 | - [x] **Create, edit, and format world info entries all without leaving the input field**
14 |
15 | - [x] **Define relationships, change scenes, build factions or entire worlds**
16 |
17 | - [x] **Track which and where entries show up in the context**
18 |
19 | - [x] **Easily place notes or entry data *anywhere* in the context**
20 |
21 | - [x] **Compatible with any popular format and optionally converts entries on injection**
22 |
23 | - [x] **Customize everything from the user interface to scene breaks and paragraph spacing**
24 |
25 | - [x] **Designed from the ground up to be flexible and user-friendly**
26 |
27 | - [x] **Custom titles, automatic pronoun matching, character point of view swapping, and much more!**
28 |
29 |
30 |
31 | More info at the official discord [here](https://discord.com/channels/653773513857171475/717764081058185316/828113500827811890).
32 |
33 | Want to jump right in?
34 |
You can play a Harry Potter themed example world info with everything already setup [here](https://discord.com/channels/653773513857171475/717764081058185316/833599529554018364).
35 |
36 |
37 |
38 | ## Usage
39 |
40 | ### Input Commands
41 | ###### Script and Menu Control
42 | Commands for tweaking functionality of the script itself and its graphical display.
43 | * `/config` toggles display of the configuration menu (enable/disable signposts, paragraph spacing etc).
44 | * `/debug` toggles debugging mode which outputs modified context to a menu above the input field.
45 | * `/enable` allows script to modify context (default).
46 | * `/disable` disables context modification and hides the menus.
47 | * `/show` makes the menus visible (default).
48 | * `/hide` hides the menus.
49 | * `/min` minimizes the menus.
50 | * `/max` maximizes the menus.
51 |
52 | ###### Menu Navigation
53 | Commands for moving through the graphical display menus.
54 | * `!` exits any menu. If changes were made, a `y/n` prompt will appear to confirm saving of changes made.
55 | * `>` and `<` moves the current selection forward (down) or back (up) the list of menu options.
56 | * `>>` and `<<` moves the current selection to the next or previous menu page.
57 | * `#0` will move the current selection to the label option, or first (top) of the list of menu options.
58 |
Entering any number except 0 will move the current selection to the nth option in the list counting from the top.
59 |
60 | ###### Context Definition
61 | Commands for creating and tweaking of context-related content, with examples. Each has a graphical menu to guide you through the process.
62 | * `/e` or `/entry John` creates or loads the world info [entry](#entries) with the label "John".
63 | * `/r` or `/rel John` opens the [relationship](#relationships) menu for "John".
64 | * `/t` or `/title ex wife` creates or loads the [title](#titles) with the label "ex wife".
65 | * `/f` or `/find Mary` searches and displays all [scenes](#scenes), [entries](#entries) and [titles](#titles) with the label "Mary".
66 | * `/b` or `/ban John, Mary` prevents the entries "John" and "Mary" from being injected into context.
67 | * `/b` or `/ban` with no entries specified will clear all previous bans.
68 | * `/k` or `/kill John` updates [entry](#entries) "John" and sets their status to dead.
69 | * `/revive Mary` updates [entry](#entries) "Mary" and sets their status to alive.
70 |
71 | ###### Scene and Perspective
72 | Commands for loading different scenes and switching control over the player character, with examples.
73 | * `/y` or `/you John` switches the user POV and control to the character "John" (only use with 2nd person perspective).
74 | * `/s` or `/scene Chapter 1` opens the [scene](#scenes) creation/editing menu for the scene with the label "Chapter 1".
75 | * `/l` or `/load Chapter 1` loads the [scene](#scenes) and executes any text to prompt as per configuration in the scene menu.
76 | * `/n` or `/notes` will display all currently active [custom notes](#custom-notes) (see next).
77 | * `+💭#500: You think this will be an easy victory` creates/updates a [custom note](#custom-notes) labeled `💭` and injected before 500 characters into the context.
78 |
79 | ###### Advanced Usage
80 | Commands tailored towards power users, with examples.
81 | * `/flush` will clear state.displayStats in the rare case that it bugs out.
82 | * `@`, `#`, `$`, `%`, or `^` are [quick entry creation](#quick-entry-access) symbols that correspond with each entry type. Left to right, they are `Character`, `Location`, `Thing`, `Faction`, and `Other`.
83 | * `#Hogwarts: is a school for wizards: is a large castle: is a place of great mystery` creates the location entry with the label "Hogwarts" and fills in each of the entry's fields with the corresponding information, separated by `:`s.
84 | * `#Hogwarts+2: with tall gothic spires` appends the included information to the second field of the entry labeled "Hogwarts" such that it now reads `is a large castle with tall gothic spires`.
85 | * `@convert!: John Smith, Jane Smith, Mary` will add all vanilla WIs with the keys "John Smith", "Jane Smith", and "Mary" as SC2 character entries.
86 |
87 |
88 |
89 | ### Details
90 | #### Navigation of the User Interface
91 | Simple Context 2 features an emoji-based menu for ease of use.
92 | ```
93 | ➰ : King John ∙∙ Character (1/3)
94 | 🔍 : /King John/g
95 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
96 | 📑 : King John is a terrible and cruel ruler who XYZ.
97 | 👁️ : King John is wearing XYZ.
98 | 🔉 : King John never likes to XYZ.
99 | 🔅 💬 : ❔
100 | ```
101 | An example of a SC2 menu
102 |
103 | Navigation of SC2's menus is done through [quick input commands](#menu-navigation).
104 |
105 | The 🔅 emoji marks the current selection in the menu. Simply type `>` to move the current selection to the next field or `>>` to move to the next page.
106 |
107 | ```
108 | 🔅 📑 : ❔
109 | 👁️ : ❔
110 | 🔉 : ❔
111 | 💬 : ❔
112 | ```
113 | Entry menu with MAIN selected
114 |
115 | ...from here, inputing `>` results in...
116 |
117 | ```
118 | 📑 : ❔
119 | 🔅 👁️ : ❔
120 | 🔉 : ❔
121 | 💬 : ❔
122 | ```
123 | Entry menu with SEEN selected
124 |
125 | At the top of the menu is the Label field, which refers to the subject of this menu. The entry and title menus also have a field for Keys, which functions exactly as it does in vanilla world info entires with the exception that regex is also accepted.
126 |
127 | ```
128 | 🔱 : Snape ∙∙ New Character
129 | 🔍 : /Snape/g
130 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
131 | ```
132 | The top of the menu, showing Label and Keys fields for a new entry
133 |
134 | Typing `#` and a number will select that numbered option in the list starting from 0 at the top. The exception is the Keys field in Entry and Title menus, which can only be navigated to by inputting `#0` to select the label and then `>` to selet Keys.
135 |
136 | If the menu has multiple pages, they will be shown next to the label in parentheses:
137 |
138 | ```
139 | 🔱 : Snape ∙∙ Character (1/3)
140 | ```
141 | First page of a menu
142 |
143 | ...from here, inputting `>>` results in...
144 |
145 | ```
146 | 🔱 : Snape ∙∙ Relations (2/3)
147 | ```
148 | Second page of a menu
149 |
150 | Typing `!` when in a menu will exit the menu. A y/n (yes / no) prompt for saving any changes made in the menu will appear just above the input field.
151 |
152 | ```
153 | ✔️ Do you want to save these changes? (y/n)
154 | ```
155 | A prompt above the input bar for save confirmation of changes made
156 |
157 | You can also skip this confirmation prompt by instead typing `y!` or `n!` to exit the menu with saved or discarded changes respectively.
158 |
159 |
160 |
161 | #### Entries
162 | Entries are effectively the nouns of your story (people, places, things, etc). "Entry" is short for World Info Entry as in the optional data that AI Dungeon uses to flesh out scenarios.
163 |
164 |
165 |
166 | World info entries (or WIs for short) are incredibly useful and when used well can greatly enhance the AI's storytelling ability. However, writing them is cumbersome and tweaking them to function most effectively even more so. That's where Simple Context 2 comes in.
167 |
168 | Creating entries in SC2 is as easy as typing
169 | ```
170 | /entry Snape
171 | ```
172 | From there, all you need to do is choose what type of entry this will be (for example, type `character`)
173 |
174 | ```
175 | 🎭🗺️📦👑💡 Enter the CATEGORY for this entry: (c/l/t/f/o)
176 | ```
177 | A prompt above the input bar for selecting the category type for a newly created entry
178 |
179 | and a [graphical interface](#navigation-of-the-user-interface) where you can input more details will appear at the top right of the screen.
180 |
181 | ```
182 | 🔱 : Snape ∙∙ New Character
183 | 🔍 : /Snape/g
184 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
185 | 🔅 📑 : ❔
186 | 👁️ : ❔
187 | 🔉 : ❔
188 | 💬 : ❔
189 | ```
190 | The Entry creation menu
191 |
192 | Each emoji represents a different field where you can add details about the entry. The most common fields are `MAIN`, `SEEN`, `HEARD`, and `TOPIC`. Note that not all entry types have all of these fields.
193 |
Let's go over each of these:
194 | * `📑 MAIN` describes the absolute basics of your entry. If it is a character, it might include gender, race, height, etc. This always appears alongside any mention of the entry's label. Comparible to the Zaltys format `DESC` category.
195 | * `👁️ SEEN` captures the appearance of your entry: A character's eyes or hair, a location's hills or structures, etc. This triggers when an entry has been seen by a character or when its visual features have been noted in the story. Comparible to the Zaltys format `APPEAR` category.
196 | * `🔉 HEARD` involves how an entry sounds but also how it acts. This is triggered when an entry has made a sound or spoken a line and is comparible to the Zaltys format `MIND` category.
197 | * `💬 TOPIC` is for any other details that either don't fit in the previous fields or are too broad to single out into just one, such as history or favorite food. Triggered when an entry has been referenced and is comparible to the Zaltys format `SUMMARY` category.
198 |
199 |
200 |
201 |
202 | ##### Character
203 |
204 |
205 |
206 |
207 | ##### Location
208 |
209 |
210 | ##### Thing
211 |
212 |
213 | ##### Faction
214 |
215 |
216 | ##### Other
217 |
218 |
219 |
220 |
221 | #### Relations
222 |
223 | Relations is the second page of the [Entry](#entries) menu and refers to the various relationships the given entry has with other entries.
224 |
225 | ```
226 | 🧟: Voldemort ∙∙ Relations (2/3)
227 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
228 | ✔️ : ➰ Harry [🤬🥊👎] ∙∙ 👑 Death Eaters [🤩💍👍]
229 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
230 | 👋 : Harry:1E-
231 | 🧬 : ❔
232 | 🧸 : ❔
233 | 💰 : Death Eaters:5M+
234 | 🙏 : ❔
235 | ```
236 | Voldemort's Relations menu
237 |
238 | Just beneath the Label and first set of wavy lines is a list of the entry's different relationships that SC2 recognizes. Each one has a set of emojis which, when read together, represent the nature of that relationship at a glance.
239 |
240 | For example we can see above that Voldemort hates Harry and considers him an enemy:
241 |
242 | ```
243 | ➰ Harry [🤬🥊👎]
244 | ```
245 | Voldemort's relationship to Harry
246 |
247 | as well as that Voldemort is the leader of the Death Eaters faction which he very much likes:
248 |
249 | ```
250 | 👑 Death Eaters [🤩💍👍]
251 | ```
252 | Voldemort's relationship to the Death Eaters
253 |
254 | Check out [the Relationship Mapping section](#relationship-mapping) below for more information on interpreting these specific emojis.
255 |
256 | Moving further down past the second set of wavy lines, we see a few different fields. These fields are the data that SC2 reads in order to interpret the relationships that were outlined above.
257 |
258 | One at a time, they are:
259 | ```
260 | 👋 CONTACTS : The entries that are known to this one
261 | 🧬 PARENTS : This entry's parents
262 | 🧸 CHILDREN : This entry's children
263 | 💰 PROPERTY : The entries that are owned by this one
264 | 🙏 OWNERS : The entries that own this one
265 | ```
266 | The Relations menu fields
267 |
268 | Any numbers or letters following a `:` next to any entries in a field represent [relationship mapping](#relationship-mapping) details for that entry.
269 |
270 | ###### Relationship Mapping
271 | ```
272 | DISPOSITIONS
273 | 🤬 1 : Hate
274 | 😒 2 : Dislike
275 | 😐 3 : Neutral
276 | 😀 4 : Like
277 | 🤩 5 : Adore
278 |
279 | MODIFIERS
280 | 👍 + : More
281 | 👎 - : Less
282 | 💥 x : Ex
283 |
284 | TYPES
285 | 🤝 F : Friends/Extended Family
286 | 💞 L : Lovers
287 | ✊ A : Allies
288 | 💍 M : Married/Member of Faction
289 | 👎 E : Enemies
290 |
291 | FORMAT
292 | [1-5][FLAME][-+x]
293 |
294 | EXAMPLES
295 | Jill:1
296 | Jack:4F
297 | Mary:2Lx, John:3A+
298 | ```
299 | A list of the various emojis used in the FLAME relationship mapping system
300 |
301 | Most of the emojis in the relationship mapping chart above are self-explanatory except for the `MODIFIERS` which tend to cause a bit of confusion. In short, `MODIFIERS` are *relative* symbols that can be used to enhance or decrease the value of a given `TYPE`.
302 |
303 | For example, `M` in relation to a `Faction` would normally mean "Member" of that faction, however `M+` would mean "Leader or high-ranking member" of that faction, whereas `M-` might mean temporary member or intern. The `x` modifier means "used to be `TYPE` but is no longer", such as with a divorced spouse (`Mx`) or enemy turned ally (`Ex`).
304 |
305 | However, it is important to remember that the `MODIFIERS` are *relative* to how the other types are being used, meaning `M` could just as easily be represented as "Co-Leader" of a faction if `M-` are how normal members are represented. It all depends on how the [Titles](#titles) being used are defined.
306 |
307 | Furthermore, much of this system can be completely customized, especially the FLAME `TYPES`. Check out the Configuration section of the SC2 script to see how.
308 |
309 |
310 |
311 | #### Titles
312 | Titles are one of the most powerful features of SC2, but are also one of the most complex.
313 |
314 | A title represents how one entry perceives another. This can mean anything from familial relationships such as Sister or Uncle to official titles like High King to even personal feelings like My Idiot Neighbor.
315 |
316 | To create a title, simply type `/title` followed by a name for your new title into the input field.
317 |
318 | ```
319 | 🏷️ : You-Know-Who ∙∙ New Title ∙∙ Target Entry (1/2)
320 | 🔍 : /You-Know-Who|He Who Must Not Be Named/g
321 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
322 | 🔅 🎭 : ❔
323 | 🤩 : ❔
324 | 🥊 : ❔
325 | 💥 : ❔
326 | 💀 : ❔
327 | 🔱 : ❔
328 | 📌 : ❔
329 | 🧑🤝🧑 : ❔
330 | ```
331 | The Title creation menu
332 |
333 | It may look a little intimidating a first, but once you grasp the basics it becomes quite easy to create and use titles.
334 |
335 | To get the most out of titles, you must first understand three important things:
336 | 1. [Who the `Target` and `Source` pages refer to](#target-and-source)
337 | 2. [How titles are applied to an entry (ie. automatically)](#how-titles-are-applied)
338 | 3. [What a title's fields represent both individually and together](#the-title-fields)
339 |
340 | ###### Target and Source
341 | Let's start by taking a look at the top of each page of the title menu:
342 |
343 | ```
344 | 🏷️ : You-Know-Who ∙∙ Target Entry (1/2)
345 | ```
346 | The top of the title menu, showing the Target of the title
347 | ```
348 | 🏷️ : You-Know-Who ∙∙ Source Entry (2/2)
349 | ```
350 | The top of the title menu, showing the Source of the title
351 |
352 | As with most of SC2's menus, the top shows the Label and an indication of which page of the menu is currently displayed. The first page is for the `Target` of the title and the second is for its `Source`.
353 |
354 | The `Target` of a title is any entry this title will apply to. For our example of You-Know-Who / He Who Must Not Be Named, it's Voldemort.
355 |
356 | The `Source` of a title is any entry that perceives the target in the way that the title represents. In our example that's every witch and wizard except Harry and Dumbledore (who see him simply as Tom Riddle) or anyone in the Death Eaters faction (who see him as The Dark Lord).
357 |
358 | Another way to look at the distinction between a title's target and source is to consider two people in a room:
359 |
Imagine yourself from the perspective of one of those people (the `Source`) looking at the other person (the `Target`) and say: "How do *I* consider *you*? Who *are* you to me? What do I *call* you?"
360 |
361 | When you think of it this way, a title is just a one-way perspective with a name.
362 |
363 | ###### How Titles are Applied
364 | Keep in mind that a title is applied to an entry *automatically* based on [how a title's fields are defined](#the-title-fields). That said, there is still a bit of setup that needs to be done first in order for a title to actually be applied to entries.
365 |
366 | Since titles involve the relationships between entries, it is important that a given entry's relations page is filled out accurately as this is the data SC2 uses to automatically apply titles to entries.
367 |
368 | ```
369 | 🧟: Voldemort ∙∙ Relations (2/3)
370 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
371 | ✔️ : ➰ Harry [🤬🥊👎] ∙∙ 👑 Death Eaters [🤩💍👍]
372 | 〰️〰️〰️〰️〰️〰️〰️〰️〰️〰️
373 | 🔅 👋 : Harry:1E-
374 | 🧬 : ❔
375 | 🧸 : ❔
376 | 💰 : Death Eaters:5M+
377 | 🙏 : ❔
378 | ```
379 | Voldemort's Relations menu page
380 |
381 | A title's fields function as a list of conditions, all of which must match with an entry's `Relations` data in order for it to be applied to that entry. This goes for both `Target` and `Source` pages.
382 |
383 | It is important to only fill out the *minimum necessary* fields in each page of a title: broad enough to match the intended entries without needing to change them just for the title, but also specific enough to *only* match the intended entries.
384 |
385 |
386 |
387 | ###### The Title Fields
388 |
389 |
390 |
391 | ...
392 |
393 |
394 |
395 | #### Scenes
396 |
397 | ...
398 |
399 | ##### Changing Perspective
400 |
401 | for example in the above screenshot, if I used /you Snape it would change all the entries to:
402 | ```
403 | 📑 : You are a dour man.
404 | 👁️ : You have greasy hair and a hooked nose.
405 | 🔉 : You talks about the dark arts.
406 | 💬 : You were a follower of the Dark Lord.
407 | ```
408 |
409 | ...
410 |
411 | ##### Loading Scenes
412 | ...
413 | Note that `/l!` or `/load! Chapter 1` with that exclaimation point loads the [scene](#scenes) WITHOUT executing any text to prompt.
414 |
415 | ...
416 |
417 | Multiple scenes can be loaded at once, combining their effects
418 | ```
419 | /load Intro Scene, Cloudy Weather, Jack's POV, badly hurt, fluff prompt
420 | ```
421 | All notes get accumulated and overwritten in order of scene load. The SCENE BREAK text only appears for the very first scene loaded.
422 | Of course you can bypass prompt like usual.
423 | ```
424 | /load! healthy, sunny weather
425 | ```
426 |
427 | ...
428 |
429 | ##### Custom Notes
430 | This command is a catchall that allows you to not only set as many notes to inject into context as you want, but it also allows you to specify WHERE you inject the note. Syntax is as follows:
431 | ```
432 | +LABEL#POSITION:TEXT
433 | ```
434 |
435 | Where:
436 | * `LABEL` is the unique label to give the note (ie, `think` or `🧠`).
437 | * `POSITION` is the distance back from the user input (front of context) the note should be injected and is measured in total characters (rounded to whole sentences).
438 | * `TEXT` is the actual text to inject into context itself.
439 |
440 | Examples:
441 | ```
442 | +🧠:100:This is my focus text
443 | +think:This is my think text
444 | +☁ Cloudy:600:This is some weather text
445 | +🎬 Chapter 1:This is some scene text
446 | ```
447 |
448 | Editing the position of an existing note is easy. Simply call the command again with a different POSITION:
449 | ```
450 | +🧠:234
451 | +🎬 Chapter 1:675
452 | ```
453 |
454 | Same with changing the content of a note:
455 | ```
456 | +🧠:This is my NEW focus text
457 | ```
458 |
459 | Removing a note is quick and easy:
460 | ```
461 | +🧠
462 | +think
463 | +🎬 Chapter 1
464 | ```
465 |
466 | You can hoist the injected note to the very top of the context.
467 | ```
468 | +🧠#-1:This will be at the top.
469 | +☁ Cloudy#-20:This will be above the -1 entry (the very very top).
470 | ```
471 |
472 | Or automatically append a prefixed label to it
473 | ```
474 | ++Weather:This note will begin with Weather as a prefix
475 | ```
476 |
477 | You can set as many notes on a scene as you want. Open the scene with /s My Scene and navigate to Page 2. From here you can enter notes as you normally would from outside the menus.
478 |
479 | Hiding notes is also possible. Add a note that is hidden by default:
480 | ```
481 | +my_note#500!: This is my test note
482 | +my_other_note!:Some note text.
483 | ```
484 |
485 | To hide a visible note:
486 | ```
487 | +my_note!
488 | ```
489 |
490 | To show a hidden note:
491 | ```
492 | +my_note!
493 | ```
494 |
495 |
496 |
497 | #### Quick Entry Access
498 | (in progress...)
499 | `@`, `#`, `$`, `%`, or `^` are quick entry creation symbols.
500 |
Each symbol corresponds with an entry type. Left to right, they are `Character`, `Location`, `Thing`, `Faction`, and `Other`.
501 | * When placed left of a label, they allow for quick entry creation. Fields are separated by `:`.
502 |
For example, `$Hogwarts Castle: is a school for wizards: has tall gothic spires: is a place of great mystery`
503 | or `@Snape: is a dour man: has greasy hair and a hooked nose: talks about the dark arts: was a follower of the Dark Lord`.
504 | * When placed left of label along with a plus or equals symbol, they allow for quick appending/overwriting of individual fields on an existing entry. Examples:
505 |
`@Harry+1: this is appended to the MAIN entry`
506 |
`@Harry+main: same thing as ^`
507 |
`@Harry=3: this will overwrite the contents of the HEARD entry`
508 |
`@Harry=heard: same thing as ^`
509 |
`$Stargate=1: Stargate is a device used to travel to other planets`
510 | * When placed left of the `convert` keyword and an exclaimation point, they convert existing vanilla world info entries in bulk.
511 |
For example, `@convert!: John Smith, Jane Smith, Mary` will add all vanilla WIs with those keys as SC2 character entries.
512 | If used *without* an exclaimation point, it will do a dry run without converting anything instead returning what *would* have been converted.
513 | If used with two exclaimation points, it will *overwrite* the existing entries.
514 |
It also works great with regex. For example: `#convert!!: /.*Town/gi`
515 |
516 |
517 |
518 |
519 | #### Configuration
520 |
521 |
522 |
523 | ### License
524 |
525 | Simple Context (c) by OnePunchVAM
526 |
527 | Simple Context is licensed under a
528 | Creative Commons Attribution 4.0 International License.
529 |
530 | You should have received a copy of the license along with this
531 | work. If not, see .
532 |
--------------------------------------------------------------------------------
/contextModifier.js:
--------------------------------------------------------------------------------
1 |
2 | const modifier = (text) => {
3 | let modifiedText = text
4 |
5 | // Add custom code here
6 |
7 | // Plugins
8 | modifiedText = simpleContextPlugin.contextModifier(modifiedText)
9 |
10 | return { text: modifiedText }
11 | }
12 |
13 | // Don't modify this part
14 | modifier(text)
15 |
--------------------------------------------------------------------------------
/inputModifier.js:
--------------------------------------------------------------------------------
1 |
2 | const modifier = (text) => {
3 | let modifiedText = text
4 |
5 | // Add custom code here
6 |
7 | // Plugins
8 | modifiedText = simpleContextPlugin.inputModifier(modifiedText)
9 | if (!modifiedText) return { text: "", stop: true }
10 |
11 | return { text: modifiedText }
12 | }
13 |
14 | // Don't modify this part
15 | modifier(text)
16 |
--------------------------------------------------------------------------------
/outputModifier.js:
--------------------------------------------------------------------------------
1 |
2 | const modifier = (text) => {
3 | let modifiedText = text
4 |
5 | // Add custom code here
6 |
7 | // Plugins
8 | modifiedText = simpleContextPlugin.outputModifier(modifiedText)
9 |
10 | return { text: modifiedText }
11 | }
12 |
13 | // Don't modify this part
14 | modifier(text)
15 |
--------------------------------------------------------------------------------