-
Notifications
You must be signed in to change notification settings - Fork 1
Theyr
Twine does not support multiplayer by default. Theyr is an addon that allows multiple players to sync up their game states.
Contains code for syncing up users' gamestates together
To ensure users' game states are synced, sockets are used to broadcast one player's new game state to all others.
- difference: the signify a player has set a variable in the game state, will broadcast the difference to all other users
- fullReset: To fully reset the game for all users
Webstack runs additional code whenever the game is shutdown. This is to preserve a backup of the game's state to restore the game to the last played state when restarting.
Runs code from GitApiIO.js on startup, and shutdown.
GitApiIO.js takes a github repo url, a github authentication token, a json file name, and a json. It has three methods:
- setupFileApi: creates a new json file on the repo to store the current game state
- retrieveFileApi: Retrieves the game state store on the json file in the repo
- initVar.json: If the repo does not contain an existing game state, the game state will be pulled from this file instead
- uploadFileApi: updates the game state stored on the repo
Contains code intended to run in tandem with the webpage produced by Twine
A proxy is used to detect every time a user makes a change to their game state. It will then send out a message to all other players alerting them of the change.
Upon Twine initalizing in the initTwine() section of Aztec.twee, Sugarcube.state.varibles is replaced with a proxy of itself. This makes it so that whenever a varibale is Sugarcube.State.varibles is changed, the coed in createHandler() is run instead of just setting or getting the variable.
This function is used to create the proxy the system is based on.
- Set: Whenever a variable is set, it's full path will be found. This path will be used to post a message to other users about the update.
- Get: Will return part of its path for set's use
<<TheyrException _varName>> is a macro used to set a varibale as a TheyrException. This means that even if a user modfies the given variable, it will not be transmitted to other users. Use this for sensitive data.
Produces the blur effect at the start of the game
Used to create stat setting widgets
Creates an instance of Webstack.js and starts hosting
Starts running index.js, uses environment variables and saves game state on github
Starts running index.js, uses config.json as environment variables, and saves game state on loginDiscord/testVars.json
- TweeGaze.js Used to restart twine automatically whenever a file is updated. For testing locally