Hi there. In this post I want to collect a few pearls I have seen over time in the forum, some generic algorithms and tools that people may use in a variety of situations. (Note this is a Wiki and not all edits are mine).
The table below (by @cup_half_empty) has links you can follow to find code examples and information on usage. You will find some common algorithms (sorting, shuffling) and some interesting ChoiceScript extensions, useful to develop and debug your game.
Feel free to contribute to this thread with other examples. Have fun!
@choicehacker’s note: this thread is now a wiki and the content may be edited by any forum member. I double-check the entries occasionally (but not very often).
General algorithms in Choicescript
Name | Description | Credits |
---|---|---|
Insertion Sorting | Sorting algorithm. It can be used to sort arrays, find the max/min of several values and more. | @stainedofmind |
Array Shuffle | Creates a random shuffle of a sequence of values. It can be used to make your game different every time. | @Lan |
Library for strings and arrays | String manipulation and list simulation. Functions: substring, indexOf, contains, replaceFirst, replaceAll | @Twiger_Fluff |
CSLIB | String manipulation, math functions, arrays, menu creation and more. | @cjw @cup_half_empty @choicehacker |
Plugins, Hacks & Mods (using Javascript)
These extensions modify the Choicescript engine and/or use *script. As such, they may not be fully supported.
Name | Description | Credits |
---|---|---|
Game Transcription | A modified version of the ChoiceScript engine that will output a transcript of the game, based on the player’s choices. | @Sargent |
Game Statistics | A modified version of the ChoiceScript engine that will output statistics of the game. | @Sargent |
Multi-player library | Implement multiplayer in ChoiceScript, by sending requests to a 3rd-party server. | @Twiger_Fluff |
Debugging tool | Debugging plugin which offers choice recording and playback . | @Twiger_Fluff |
Text tool | Present fancy text by using custom images from an external server | @Flurrywinde11 |
Development environments
Name | Description | Credits |
---|---|---|
CSIDE | ChoiceScript development environment. Edit and run your game in a very flexible environment | @CJW |
Visual Studio extension | Develop your game in Visual Studio | @Sargent |
Notepad++ And Syntax highlighters | Notepad++ Text Editor and some community “Syntax Highlighters” |
Other
Name | Description | Credits |
---|---|---|
Gender and Pronoun Sample Code | Sample code for setting variable MC and NPC pronouns | @HarrisPS |
Inventory | Code to present items from an inventory | CS Wiki |
General rounding | Rounds a number to a given precision. Uses the elusive ‘power’ operator. | @annwu23 |
Master List: Links for Beginners | Master list of links for beginners. | @FairyGodfeather |
Softly | A soft save system generator tool for ChoiceScript. | @cup_half_empty |
24h Clock Routine | Pass the minutes as a parameter or just use it to update the timestamp. | @cup_half_empty |
Fancy Fonts | Change text font. | @cup_half_empty |
Yet another inventory system | Inspired by Twiger_Fluff’s Implementation of Lists this module gives the writer the ability to create inventories with number quantities for their game! | @nocturno |
Due to the limit of citations allowed per post, new entries won’t link the user handler to their profile.