Giter Site home page Giter Site logo

ryan6578 / codewords Goto Github PK

View Code? Open in Web Editor NEW
28.0 7.0 16.0 405 KB

A LUA script for Codewords on Tabletop Simulator for Steam.

Home Page: https://ryan6578.com

License: GNU General Public License v3.0

tabletop tabletop-games tabletop-gaming tabletop-simulator scripting mod lua lua-script

codewords's Introduction

Codewords

This project is a LUA script written for Tabletop Simulator. Please note that this repository only contains the source code for the project and does not include the corresponding assets.

Getting Started

If you'd like to help contribute to the project, please ensure you have the following prerequisites:

Once you have everything set up, you can get started working on the project via the following guidelines:

  1. Subscribe to the Codewords workshop mod.
  2. Start Tabletop Simulator.
  3. Open up Atom (with the TTS plugin already installed).
  4. Create a new server.
  5. Load the workshop mod (Games > Workshop > Codewords).
  6. Open up Atom. The script should already be loaded in the editor. If not, use the CTRL + SHIFT + L key combination to get LUA scripts from the game.
  7. Clone the repository and copy the contents of the files from the repository into their respectively named files on your local instance.

Help

Feel free to join our Discord if you need help with getting started on the mod (or would just like to join the Codewords community on TTS). Hope to see you there! :)

codewords's People

Contributors

canonelis avatar celamai avatar platypuseggs avatar ryan6578 avatar xoxfaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

codewords's Issues

Codenames: Duet mode

Request to add the option to put the game into "Codenames: Duet" mode, with the mechanics of the "Codenames: Duet" game.

Would require:

  • Having two code grids (see the Codenames: duet rules for how the grid colours match)
  • Each side on separate teams.
  • A limit on the number of clues allowed.
  • A limit on mistakes.
  • Either randomising the mistakes/clues allowed. using the official "mission" maps or custom "mission" maps.

Updated Analytics

Update analytics to provide further insight into games played. Record player information, etc.

Game doesn't set the timer back on after a game has ended

I noticed that the variable timerOn doesn't reset back to 1 once you have started a new game after the previous game has ended. I believe this is because of my previous request to disable the timer once the game is over. So any new game that is started after that, the timerOn variable will remain as 0. I believe it's in the function onObjectdrop:

          -- Set the timer to 0 and disable
          timerOn = 0
          clockTimer.setValue(0)

Automated end turn doesn't always work

Another issue is with the automated end turn feature. I notice at times whenever a team places the opposite color card down or a white card, that it should automatically end their turn. But it doesn't. I couldn't figure out the cause of this either.

Announce Winning Team and Reset Timer

Upon placing either the black card or having a team using up all their agent cards, have the game broadcast who the winning team is and then also reset the timer on the clock to 00:00:00

Clue Validation

Add clue validation:

  • Maximum word length of 20 characters
  • Checking that the word is one word or hyphenated
  • Parsing clue to check for correct format

Possibly include clue number in turn ending, etc.

a way for spymasters to get a list of all their words

After a new round starts, the spymasters will each get a list of their words displayed to them somehow, so they can easily reference them. This makes it faster for them to connect their words and less likely to make mistakes.

Of course only the spymasters can see their list of words only.

Codemaster Queue Error Throwing

Under certain circumstances, players leaving the game throws the following error:

Error in Script (Custom Model - ) function : Could not find matching button index

Issue with latest update

When a code master wants to tell their team to avoid a word while giving them infinite guesses they use the number 0. The new update that relates to turns ending automatically by using the equation (number of guesses + the one bonus guess) works for well for every number of guesses listed except when the code master uses 0. It lets them have 1 guess and then turn ends.

Code Announcement Delay

Find a workaround for the limitations within the TTS tablet object to allow codes to be announced immediately, instead of having to introduce a delay to get it to work.

Separate Encoding Schemas for Codemasters

Each codemaster should have his/her own encoding platform in front of them in a hidden area. This includes a text box and an encoding button (possibly a counter to denote the clue number). Teams will not be able to view the clue until it has been encoded. The clue will be transformed to uppercase so that case does not matter.

Refactor Code

Refactor some of the codebase for efficiency - particularly when shuffling. Make redrawing control panels less expensive. Instead of redrawing the entire panel, just redraw the element that is being changed.

Tilt Codes After Revealing

I would like the script to be able to automatically tilt the codes after putting the agent cards on them.

Countdown Reminder

Broadcast a message to notify them that they have a certain amount of time remaining left before the round ends.

Hybrid Deck Loading

Have decks start in infinity bags and as they are called, move an instance outside. This will prevent lag when initially loading the table. The game will lag when calling a deck for the first time, but all subsequent calls to that deck will not lag.

Codenames UI

Explore the UI documentation. Add a custom UI element for turn tracking and other useful and helpful information.

Fix camera on player sit

Camera defaults to player's seat. When sitting, camera should default to the front of the game.

Feature to allow spymasters to see which cards on the table belong to which color group (Red, Blue, Black, White)

With the latest update of TTS (10.9) that just came out. I noticed some new scripting additions that could finally make this possible. I saw this from the changelog:

  • setHiddenFrom(players) Hides objects from a specific player/players. Uses "hand zone" hiding.
  • setInvisibleTo(players) Hides objects from a specific player/players. Uses "hidden zone" hiding.
  • attachHider(...) and attachInvisibleHider(...) are more advanced version of
  • setHiddenFrom and setInvisibleTo, there to help handle complex situations easily.

https://api.tabletopsimulator.com/object/#setinvisibleto

Perhaps with these new LUA scripting additions, it would be possible to show which color a particular word card belongs to (WHITE, BLACK, RED, BLUE) perhaps having a subtle border around the card that only the spymasters can see. This would be a great visual cue for the spymasters and decrease the likelihood in placing the wrong agent card over the incorrect word.

I'm also sure these updated scripting functions can also help in hiding things with greater control from certain players or playercolor without using those ugly hidden zones.

Encoding Round Robin

Currently, clues are positioned on a position basis. Implement a more robust round robin style encoding schema. Clues will be positioned in chronological order with shifting upwards (if necessary). Old clues at the If more than 8 clues are given, older clues at the top of the list will be replaced with the new clues.

Player-Level Statistics

Expand the functionality of the analytics to support more detailed statistics (at the player level). Possibly implement a ranking system to give a rough estimate of the player's skill level (codemaster and player).

Player AFK Detection

Implement functionality to detect whether a player is AFK and perform certain actions when they have been AFK for a specified amount of time.

Player Switch CP

Create a control panel that allows players, at the click of a button, to switch their color without having to switch to grey first.

Additional Game Settings: Auto Start next round option (togglable) / Random Deck (togglable)

I was thinking to add an "Auto Start Next Round" option to the settings control panel with ability to set the time in seconds on when it should initiate. This way you can specify a time that will initiate a new game to start. This should be a togglable on/off option.

Example, you can set the amount of time in seconds that will initiate a new game to automatically start. I think this will better help the flow of the game.


Random Deck should also be a togglable option to allow every new round to start with a random deck if enabled.

Allow codemasters start a new game

I wouldn't call it a issue but more of a feature request. Rather than letting promoted players do it, let Codemasters who are sat on Red & Blue to start a new game. The control for a new game is particularly on 624, but I don't really see a problem in giving control of the panel to the codemasters.

583, 591, 599, 607 and 615

User Blacklist

Curated list of Steam64 IDs that are known trolls. Upon joining, notifies the host and promoted players that this person is on the black list. Include a toggleable function to autokick players on the blacklist.

Revamp voting process

I have a few ideas on how we can improve on this:

  1. We can either have each player have infinite voting chips in their color, and they can use that to place over the word card to vote. Once the script detects all the players on the team have voted on a word, it will check which agent card is suppose to go over that word and move it there and then destroy the chips.

or

  1. We can attach transparent buttons over the 25 word cards on the board using the alpha channel. It won't show up at all. But they are there for players to click on. So a player who wants to vote will physically click on the button, and the script will register the click and set a message in the note area (lower right side) showing which player has voted on which word, and which player hasn't voted yet, all dynamically. Once the script detects that all players on the team have settled on 1 word, it will go to the next logical step.

Rework of word tiles

So, we turn the cards to mark the words and we either flip the cards upside down/to it's back to mark out some word tiles.

Some of the card decks have an opaque background with a standard image. Proposal is to:

  1. Either change the cards to a transparent background (trust me, human minds can read the inverted words very easily)
    OR
  2. The back of the card has the word but in a more marked down state (like a word on a red background or word on a greyscaled background). I know Platy made a deck, but the back of the card wasn't distinctive enough.

If someone has the text file and can share it with me, I'm quite happy to see if I can spawn a deck with the above suggestions.

OR ALTERNATIVELY

Instead of rotating the cards to select a word, is it possible to change the state of the word tile by clicking on it? That way, we can change the background to something like
State 1 - Normal
State 2 - Green (to highlight the words we are going to pick next)
State 3 - Red (to highlight the words not part of our clue)

I'm not sure how easy/difficult is to implement the second suggestion but I believe that needs some work on Unity.

Add "RESET TABLE" button

This is to reload the table back to default, great for when the host/admin is AFK, and a promoted player can press this button to reload the table back to default incase there are any glitches.

Broadcast Clue verbally and audibly

Needs some sort of indication via audio and verbally to let the team know that a clue is ready for them. I get a lot of people not paying attention sometimes because they're unaware and it would make the game flow much better.

Save State

On a rewind, load the previous game's save state. This is so that the script doesn't completely break on rewinding.

Clean up "ClueMaker9000"

  • Remove the board altogether. Hide all assets within the table.
  • Get rid of deck bags and have the actual decks within the table. Use copy() and paste() so the decks don't have to be loaded in each time they are called. This lags the table and makes things unpleasant.
  • Get rid of clue tile bags and do the same as the deck bags. When a clue is made, copy() and paste() them onto the board.

Game breaks when you attempt to shuffle keymap after game is over

Once all the agent cards are placed over the words and no longer in their original spawn positions. You'll get an 'attempt to index a nil value' error when somebody goes and hits the Shuffle Keymap button.

function doubleToRed and function doubleToBlue is causing this, because it detects no double agent card being there, so it spits out that error.

Clue box keeps focus after the clue is entered

The box where Codemasters type the clue holds focus even after the clue is entered. If they don't notice and press C to talk, the box is filled with C's. If they want to chat, the box throws an error every time a space is entered due to validation rules. It is a slight annoyance to remember to click outside after entering the clue.

Wondering if there a way to do it automatically

Turntracker bug

Not sure if it was meant to be this way but while looking for something else, I came across the line 394 in the latest commit:

if (playerColor == "Blue" and turnTracker == 0) or (playerColor == "Red" and turnTracker == 1) then

Does it mean, Red can add a code when the turn tracker is 1 but Blue can't do so?

endGame function doesn't always work

I notice that the endGame function isn't always working. I can't seem to pinpoint what the exact cause is. It doesn't always happen.

Sometimes when either all the red or blue agents card are placed on the word board, it doesn't execute the endGame function. Or when a black card is placed.

written clues don't show up when you rewind and fastfoward

I notice that the clue tokens remain blank after you rewind and then fast forward again. This only happens with the latest version. Old version shows up fine.

New versions is the one where you have finishedClue assigned to a button and not separate like it was before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.