Greasy Fork is available in English.

IntCyoaEnhancer

QoL improvements for CYOAs made in IntCyoaCreator

질문, 리뷰하거나, 이 스크립트를 신고하세요.
개발자
agreg
일일 설치수
2
총 설치수
1,238
평점
2 0 0
버전
0.5.3
생성
2022-01-22
갱신
2023-09-15
라이선스
MIT
동작 사이트

This little script has the purpose of enhancing your experience with CYOAs made in IntCyoaCreator.

Information about the dialog used for state editing.

Features

  • Detects when project.json is being downloaded and displays information on loading progress (unless it's been already added by the deployer)
    • New in v0.5.3: attempts to determine the date when project.json was updated (displayed as a tooltip for the scores bar)
  • Keeps track of the game state in the URL hash (using the internal format of IntCyoaCreator), offers to import the state when page is loaded; this allows you to bookmark or share your builds, and also prevents you from losing your state if you accidentally refresh the page
    • this import feature can be also invoked manually (via menu)
    • in some cases this import feature works better than builtin import dialog (less bugs)
    • New in v0.5.3: the URL changes are no longer added to browser history (also affects the back button)
  • New in v0.5: Can be switched into a Full Scan mode, in which it keeps track of all changes in app state; this overrides the default game state hash, including restoring the state on load and editing of the state string; this allows for storing state in apps where ids list import fails
    • this can be toggled on and off at any time, switching between IDs list and full scan snapshot
    • state of both backpack and cheat add-ons is stored (and restored on load) as well
    • New in v0.5.2: Implemented a multiline editor with JSON pretty-formatting (adjustable), highlighting and validation. (Also used for IDs list but without JSON features.)
  • Allows for altering page title (makes it easier to distinguish the browser tab/window with your build)
    • this is also retained in the URL hash, with the same benefits
    • can be removed at any time to revert to default title
  • Includes an overview/dice roll screen (toggleable from menu or with a button in bottom-left corner)
    • preview active items (choices/buttons), with description/cost & image displayed on hover
    • quick scroll navigation for visible rows (sections), additional information also shown on hover
    • also has a utilitary section which allows rolling for a random number
    • the dialog can be closed by clicking outside or hitting Escape
  • Has an option to enable backpack (dialog showing off selected choices) if not present already
    [also available as a set of standalone bookmarklets]
  • Allows for downloading project data (in current state)
  • Includes a cheat engine (doesn't affect save data)
    • supports point editing (for all point types, visible and hidden)
    • has a reset button which reverts all changes
  • Adds debug functions to the browser console (collected in a $dbg variable as well as globally)
    • store accessor ($store)
    • state accessors ($state, $pointTypes, $rows, $activated)
    • state aggregators ($items for all cards, $getItem to get a card by ID, $hiddenActivated lists activated multi-select & image cards – as they're excluded from the $activated list)
    • helper function ($clone makes a deep copy of state collection which makes it easier to examine)
    • Full Scan utils ($encode/$decode for data/compressed hash conversion, $slimStateCopy for obtaining state snapshot without image data, $diff for calculating snapshot diff, $initial for obtaining initial snapshot size – in bytes)
    • New in v0.5.3: $bugfix exposes fixes for some bugs in IntCyoaCreator
    • New in v0.5.3: Added (partial) support for the IntCyoaCreator site; this gives improved environment for tweaking/debugging, but if you prefer you can disable it by adding the site to User Excludes in script settings (TamperMonkey, applies on page load)

Usage notes

  • By default, the script is applied to websites hosted on neocities.org (and attempts to detect if it's running IntCyoaCreator player app); this can be adjusted in script settings (add CYOA URL into User Matches/Includes to have it work there, or add a website URL into User Excludes to prevent it from running there).
  • Large CYOAs take a long time to download; if reopening/refreshing a build takes too long for your liking, you can use CYOA compressor to download and serve it locally which is much faster (it would be available at http://localhost:8080 – add http://localhost:8080/* into User Matches to enable the userscript there).
  • Loading progress can't be detected if project.json is embedded in sourcefile (app.*.js).
  • The script keeps track of the exact same data that the app does (meaning that if something isn't exported by the app, it won't be stored by the script either – like image tooltips and some of multi-value fields, possibly depending on IntCyoaCreator version used in player app).
  • Modifying build state triggers an import (unless you hit cancel).
  • Entering an empty title resets it (same goes for the state).
  • Full Scan mode may cause increased CPU load (but it can be turned off until before saving the URL).
  • Full Scan mode is indicated by Overview button colour (inverted when Full Scan is on).
  • After CYOA state (version) update, a Full Scan snapshot is likely to become invalid (as it directly relies on exact in-memory structure). IDs list doesn't work on some CYOAs but is less reliant on internal structure (though major changes may affect it as well).
  • Full Scan snapshot is stored in the URL hash in compressed form, but Edit State presents it in uncompressed form. It still supports compressed input, however.
  • To support Full Scan, initial state is copied and stored at startup (without static image data); the copy may take up to several Mb in memory, depending on CYOA size.
  • In case IDs list reset fails (restores state incorrectly), whether from userscript or builtin one, you can use Full Scan mode to override it, by entering empty input or {} in Edit state dialog (you can also use it or $diff() in browser console to examine current changes).
  • Not all items/rows have readable names or even IDs, so you might have to tell them apart by hover information.
  • Dice roll state is retained when overview dialog is closed (including the result).
  • When enabling backpack, number of columns can be selected (1-4, default is 3); this setting can be changed at any time by selecting “Enable backpack” again.
  • Due to how points are implemented in IntCyoaCreator, cheat points are added independently of the state. (Meaning, if you do a reset/import – regardless whether through Enhancer or builtin import dialog – point changes done with cheats will stay.)
  • In similar vein, anything you do affects project data (which is actually just an exported app state), which means if you've selected any option this selection will be included in the data as well.
    On the other hand, this means you can use debug functions to fix problems with data my directly modifying it.

This script appears to work in every IntCyoaCreator app I've tried it on (or at least as well as builtin import dialog does), but I haven't checked it with every IntCyoaCreator version.