The git for the Python Story Utility Package library.

Overview

SUP

The git for the Python Story Utility Package library.

Installation:

Install SUP by simply running pip install psup in your terminal.

Check out our pypi page!!

Requirements:

Python 3.8+

Usage:

Here's a basic story:

from sup import Story

story = Story("story")
story.run()

That's all the code you have to type to make a terminal based text story / game. As for the actual story script, options paths and more that's all handled automatically from what you've written in your Story Utility Script (sus) file.

An example of a story

[STORY main]
Once upon a time a boy named Jack was strolling by the river.
Suddenly he heard something move in the bushes.
Jack was scared as he had no idea what the thing in the bushes could be.
- OPTION {{
	 Run away $$JUMP running-away,
	 Go towards the Bush $$STAY,
	 Do nothing $$SKIP 5
	 }}
As Jack slowly moved towards the Bush the sound became louder.
The Bush started shaking violently, Leaves scattered everywhere.
Jack grabs a stick from the ground to defend himself.
- ADDATTR stick
Suddenly, a giant boar emerged from the Bush.
The Boar started shouting, nearby birds started flying away and animals slowly emptied the area.
Even the fish in the river had become restless.
Upon hearing the Boar's shout Jack fell on his feet and started trembling.
The boar approached Jack.
- OPTION {{
	 Attack the Boar $$CHECKATTR stick $$JUMP fight,
	 Jump in the river $$STORY the-river
	 }}
Jack tried to attack the Boar with his fists but alas, it was useless.
The boar slowly approached Jack, it's shouts becoming louder and louder.
Jack started to shed tears of fear. 
The Boar rushed at Jack.....
...
It took the meat from Jack's bag and then left him alone.
Jack returned to his house while still trembling in fear.
- END
- TAG fight
Jack immediately started swinging his stick around, trying to get the Boar to run away.
The Boar was un-phased by Jack's attacks and started running towards him, now angrier than before.
The Boar attacked Jack...
Luckily a man with an axe appeared in the last moment and struck the Boar.
Jack saw the man and ran away to his house.
- END

[STORY running-away]
Jack ran away from the Bush.
As he ran away he bumped into a man with an axe.
- TAG hunter
That man was a hunter, he was looking for a Giant Boar that had escaped from him.
The hunter told Jack to stay safe and what the route out of the forest was.
Jack returned home safely. 
- END

[STORY the-river]
Jack jumped into the river.
The river swept Jack away.
Jack started to slowly drown but a man helped him get out of the river safely.
- JUMP hunter

more examples can be found in the atlas folder.

This might look like a bit too much to understand at once but I'll break it bit by bit.

The Syntax:

So there are a set of functions you can use in a sus file, being:

  • TAG Creates a tag at the line that it's on.
  • JUMP Jumps to a tag ignoring which sub-story it exists in.
  • SKIP Skips a provided amount of lines.
  • RETURN Goes back a provided amount of lines.
  • OPTION Makes options, each option has some text and the function ran when that option is selected separated by $$.
  • STAY Does nothing, used with other functions to do nothing.
  • END Ends the whole story.
  • ADDATTR Adds an attribute to the player.
  • DELATTR Deleted an attribute from the player.
  • CHECKATTR Checks if the played has an attribute, if so it runs the function supplied by $$.
  • CHECKNOTATTR does the opposite of CHECKATTR.

You can also specify sub stories by typing [STORY sub-story-name]. lines that are empty or start with # are regarded as comments and are treated as if they don't exist.

You might also like...
This utility lets you draw using your laptop's touchpad on Linux.
This utility lets you draw using your laptop's touchpad on Linux.

FingerPaint This utility lets you draw using your laptop's touchpad on Linux. Pressing any key or clicking the touchpad will finish the drawing

A small utility that sorts your files.

FileSorter A small utility that sorts your files. TODO: Scan directory to find files(thanks @corruptmemry for this!) Split extensions to determine fil

Utility to play with ADCS, allows to request tickets and collect information about related objects.

certi Utility to play with ADCS, allows to request tickets and collect information about related objects. Basically, it's the impacket copy of Certify

jfc is an utility to make reviewing ArXiv papers for your Journal Club easier.
jfc is an utility to make reviewing ArXiv papers for your Journal Club easier.

jfc is an utility to make reviewing ArXiv papers for your Journal Club easier.

Modest utility collection for development with AIOHTTP framework.

aiohttp-things Modest utility collection for development with AIOHTTP framework. Documentation https://aiohttp-things.readthedocs.io Installation Inst

Collection of code auto-generation utility scripts for the Horizon `Boot` system module

boot-scripts This is a collection of code auto-generation utility scripts for the Horizon Boot system module, intended for use in Atmosphère. Usage Us

Build capture utility for Linux

CX-BUILD Compilation Database alternative Build Prerequisite the CXBUILD uses linux system call trace utility called strace which was customized. So I

MongoDB utility to inflate the contents of small collection to a new larger collection

MongoDB Data Inflater ("data-inflater") The data-inflater tool is a MongoDB utility to automate the creation of a new large database collection using

A utility tool to create .env files

A utility tool to create .env files dump-env takes an .env.template file and some optional environmental variables to create a new .env file from thes

Comments
  • Format Python code with black

    Format Python code with black

    There appear to be some python formatting errors in 2711e4576fffbe5d0a141cdfa4163642537a8447. This pull request uses the black formatter to fix these issues.

    enhancement 
    opened by github-actions[bot] 0
  • SKIP function skips 1 lins less than it's supposed to.

    SKIP function skips 1 lins less than it's supposed to.

    Bug Description

    The SKIP function skips one line less then it's meant to.

    ie.

    SKIP 1
    some text
    some other text
    

    here it jumps to "some text".

    Reproduction Steps

    Type SKIP 1 Type 2 more lines after it. behold the result

    Expected Result

    SKIP entirely ignores the first text line.

    Actual Result

    SKIP does nothing leading it to end at line 1.

    Attachments

    Additional Info

    bug 
    opened by EnokiUN 0
  • Add a @custom_function decorator to the Story class

    Add a @custom_function decorator to the Story class

    Add a @custom_function decorator to the Story class that works by adding the function to the Story object's local function_dict to be more flexible and help with customization.

    enhancement 
    opened by EnokiUN 0
  • TODO

    TODO

    TODO v0.5.0

    No Current Ideas for what to do

    TODO v0.4.0

    Features:

    • [x] Adding a function function and a function system

    • [ ] Expanding Utils & Math

    • [ ] Adding Something Like UTILS ADD {{arg1, arg2}} while UTILS ADD arg1, arg2 can still be used

    Bug Fixes:

    • [x] Fixing Chain Functions

    • [x] Make Utils Work Better and Properly "how utils works is bad and sometimes errors out because it doesn't properly run the functions if supplied functions that is"

    bug documentation enhancement help wanted good first issue question 
    opened by VincentRPS 2
Releases(v1.0-rc1)
  • v1.0-rc1(Jan 11, 2022)

  • v0.4.0-rc1(Dec 13, 2021)

    Candidate

    Since this is a candidate you have to install it abnormally:

    pip install -U git+https://github.com/EnokiUN/psup/tree/v0.4.0-rc1
    

    What's Changed

    • SUP - > PSUP (Review it) by @GreenArron in https://github.com/EnokiUN/psup/pull/25
    • discord logo by @GreenArron in https://github.com/EnokiUN/psup/pull/26
    • Ehm by @VincentRPS in https://github.com/EnokiUN/psup/pull/28
    • We aren’t alpha males by @VincentRPS in https://github.com/EnokiUN/psup/pull/29
    • Mam I use pycharm by @VincentRPS in https://github.com/EnokiUN/psup/pull/30
    • minimal changes to text by @GreenArron in https://github.com/EnokiUN/psup/pull/33
    • Adding Typed by @VincentRPS in https://github.com/EnokiUN/psup/pull/37
    • MANIFEST by @VincentRPS in https://github.com/EnokiUN/psup/pull/36
    • Resuning To change by @VincentRPS in https://github.com/EnokiUN/psup/pull/35
    • proudly show our discord server at top by @GreenArron in https://github.com/EnokiUN/psup/pull/39
    • logos hermanos by @GreenArron in https://github.com/EnokiUN/psup/pull/40
    • PSUP v0.4.0 by @VincentRPS in https://github.com/EnokiUN/psup/pull/41
    • Adding Contributing Guidelines by @VincentRPS in https://github.com/EnokiUN/psup/pull/27
    • Fix API Docs by @VincentRPS in https://github.com/EnokiUN/psup/pull/42
    • New Docs Theme by @VincentRPS in https://github.com/EnokiUN/psup/pull/44
    • Format Python code with black by @github-actions in https://github.com/EnokiUN/psup/pull/45
    • v0.4.0-rc1 by @VincentRPS in https://github.com/EnokiUN/psup/pull/46

    New Contributors

    • @github-actions made their first contribution in https://github.com/EnokiUN/psup/pull/45

    Full Changelog: https://github.com/EnokiUN/psup/compare/v0.2a...v0.4.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v0.2a(Nov 21, 2021)

    Added a cli for quick use Added doccumentation at readthedocs.io Added some new features.

    What's Changed

    • adding logo.png by @GreenArron in https://github.com/EnokiUN/sup/pull/16
    • adding placeholder main.py by @GreenArron in https://github.com/EnokiUN/sup/pull/17
    • Adding CLI to the package by @GreenArron in https://github.com/EnokiUN/sup/pull/18
    • changing "--online-story" to "-online" by @GreenArron in https://github.com/EnokiUN/sup/pull/19
    • Pollos Hermanos by @GreenArron in https://github.com/EnokiUN/sup/pull/20

    Full Changelog: https://github.com/EnokiUN/sup/compare/v0.1.1a...v0.2a

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1a(Nov 19, 2021)

    The first release

    Added all the basic SUP and SUS functionality including the functions.

    read the README.md file for more info

    v0.1.2a release & features planned.

    What's Changed

    • endorsement by @sexnine in https://github.com/EnokiUN/sup/pull/1
    • yes by @GreenArron in https://github.com/EnokiUN/sup/pull/2
    • sussy story for testing added by @GreenArron in https://github.com/EnokiUN/sup/pull/3
    • Rename sup.py to main.py by @VincentRPS in https://github.com/EnokiUN/sup/pull/4
    • Totally not stealing discord’s.pys setup by @VincentRPS in https://github.com/EnokiUN/sup/pull/5
    • Finished the sussystory + minor changes to main by @GreenArron in https://github.com/EnokiUN/sup/pull/6

    New Contributors

    • @sexnine made their first contribution in https://github.com/EnokiUN/sup/pull/1
    • @GreenArron made their first contribution in https://github.com/EnokiUN/sup/pull/2
    • @VincentRPS made their first contribution in https://github.com/EnokiUN/sup/pull/4

    Full Changelog: https://github.com/EnokiUN/sup/commits/v0.1.1a

    Source code(tar.gz)
    Source code(zip)
Owner
Enoki
Just a weeb who has a gaming addiction and likes to code stuff.
Enoki
Automatic generator of readmes for git repositories (Includes file' listing)

Readme Generator We are bored of write the same things once and once again. We trust in the comments made inside of our files, and we decided to autom

Natalia Vera Duran 6 Jul 20, 2021
Find version automatically based on git tags and commit messages.

GIT-CONVENTIONAL-VERSION Find version automatically based on git tags and commit messages. The tool is very specific in its function, so it is very fl

null 0 Nov 7, 2021
Spacegit is a .git exposed finder

Spacegit Spacegit is a basic .git exposed finder Usage: You need python3 installed to run spacegit use: python3 spacegit.py (url) Disclaimer: **This i

null 2 Nov 30, 2021
A Python utility belt containing simple tools, a stdlib like feel, and extra batteries. Hashing, Caching, Timing, Progress, and more made easy!

Ubelt is a small library of robust, tested, documented, and simple functions that extend the Python standard library. It has a flat API that all behav

Jon Crall 638 Dec 13, 2022
Python utility for discovering interesting CFPreferences values on iDevices

Description Simple utility to search for interesting preferences in iDevices. Installation python3 -m pip install -U --user cfprefsmon Example In this

null 12 Aug 19, 2022
This is Cool Utility tools that you can use in python.

This is Cool Utility tools that you can use in python. There are a few tools that you might find very useful, you can use this on pretty much any project and some utils might help you a lot and save so much time since it’s a simple function.

Senarc Studios 6 Apr 18, 2022
Yet another retry utility in Python

Yet another retry utility in Python, avereno being the Malagasy word for retry.

Haute École d'Informatique de Madagascar 4 Nov 2, 2021
A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

BlueDynamics Alliance 6 Jun 8, 2022
A collection of utility functions to prototype geometry processing research in python

gpytoolbox This repo is a work in progress and contains general utility functions I have needed to code while trying to work on geometry process resea

Silvia Sellán 73 Jan 6, 2023
Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft

uvtt2fgu Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft This program wo

Andre Kostur 29 Dec 5, 2022