Board Games package

Name: Board Games
By AdamO on Discord

This package includes 3 board games that you can easily add into any game, for two players to play!

  • Chess
  • Checkers
  • Tic Tac Toe

Prerequisites
You will need some standard packages already in your game for the board games to work fully. Install Prompts package, Notifications package, Local Handler package and add the relevant script folders to the User template.

How to set up

  • Install the Board Games package.
  • Drag the UserBoardgame template onto your User template.
  • Open the Prompts script and modify lines 60 and 66 to also send self:GetEntity() as an argument, like so:
		if interactEntity then
			interactEntity:SendToScripts("GetInteractPrompt", prompts, self:GetEntity())
			-- if the thing we're looking at has calls bound to onInteract
			-- then find the scripts involved and try calling GetInteractPrompt
			-- on them.
			if interactEntity.onInteract:HasBindings() then
				for _, binding in ipairs(interactEntity.onInteract:GetAllBindings()) do
					binding.script:SendToScript("GetInteractPrompt", prompts, self:GetEntity())
				end		
			end
		end
  • Drag a Boardgame template into your world - Base (which is Tic Tac Toe), Checkers or Chess. Note that Boardgame_Base is the root template - changes here, like the table mesh, will affect the other two games as well.
  • If you’re previewing the game on your own, you can tick “DebugOneUser” on the Boardgame entity’s properties, at the bottom of the BoardgameScript’s properties. This allows you to control both players. It may have some issues in Checkers and Chess that need to be addressed with checking valid moves, but works for Tic Tac Toe. Remember to turn it off when you publish!
  • Preview, and play your board game!

How to set up - alternative method

  • Remix the game "Board Games Showcase.
  • Preview and play the games (games require 2 players).

Some things to note

  • There are references to “XsAndOs” - this was the original name for TicTacToe, so all of the Lua logic references XsAndOs.
  • All board games have a “BoardgameScript” at their root, which handles the general functionality like joining and quitting a game, and a script specific to that game, e.g. “MinigameChess”.
  • All board game logic is contained within the board game entity. The User doesn’t have any game-specific logic on it.
  • The 3 games provided are grid-based games. If you want to make your own board game, a good start might be something like Go, which is also grid-based. To make a non-grid-based game like Backgammon, you could try adjusting the grid logic, e.g. having a board with 2 columns (representing each side) and 12 rows (representing the triangular play areas).
5 Likes

Thank you for the package :heart: It will come in handy for a future update of Chill Place.

1 Like