MoreGames
Framework for mod creators to build custom gambling machines
About this mod Author’s original text
GWYF_MoreGames
Framework mod for making new casino games in "Game With Your Friends".
Installation
- Install BepInEx 5.x into your Gamble With Your Friends directory.
- Copy the MoreGames.dll and the stampsprefab asset bundle into: BepInEx/plugins/MoreGames/
How to make your own custom game
Note: The Fishing Game mod: is a good reference for how to build a game using this framework.
To build a compatible mod you will need to set up your file structure as such:
- YourModName/
- Games/
- YourGameName/
- YourGameName (Unity Asset Bundle)
- YourGameName.dll (C# class extending GameBase)
- gamemanifest.json
- YourGameName2/ (if you want multiple games in one mod you can add both to the games folder)
- YourGameName2 (Unity Asset Bundle)
- YourGameName2.dll (C# class extending GameBase)
- gamemanifest.json
As you can see there are 3 main things you need for a game to work properly:
- A compatible unity asset bundle
- A dll containing a class extending GameBase
- A json defining important things about your mod
In the next sections, I will go through how to set up each of these correcly.
Asset Bundle
To build a compatible unity asset bundle you must first set up a good Unity scene. I highly recommend using AssetRipper on the Gamble With Your Friends_data folder in steamapps\common\Gamble With Your Friends. Then, in AssetRipper, export the ripped files to a Unity project. In Unity Hub make sure to download Unity version 6000.3.6f1 and open the Unity project with this version. This will give you all of the materials, meshes, and prefabs that the game has. The major issue is that all of the scripts get disconnected, so you should delete all C# scripts in the folder. Then find a prefab that already exists in the game like Crash CasinoGame. You can edit this prefab and use it as a base to build what you want. Make sure to remove all dangling components that use scripts, as these will throw errors. Also, make sure to add the TextMeshPro package so that you can add TextMeshPro components to any text. To get the game's font, look for Assets/Font/Dangrek-Regular.ttf and use it to build Dangrek-Regular SDF.asset which you should place in Assets/Resources/fonts & materials/ then just select Dangrek-Regular in TextMeshPro.
If you look at a prefab for a preexisting casino game it will look something like this:
- Example CasinoGame
- GameName (This needs a TextMeshPro)
- Model
- (Any 3D model) (Make sure that the material has a shader used by the game, I know that 01_GWYF/ and AllIn1SpriteShader/ work correctly, however these shaders make the 3D model look flat so make sure to prebake some lighting)
- Play Button (This has a BoxCollider)
- Model
- Text (This needs a TextMeshPro)
- SM_button_1 (This uses mesh: Cube.002, a mesh renderer, a BoxCollider and a material)
- Feedbacks
- PressFB
- (Any other buttons)
- Feedbacks
- GameResultFB
- GameWinFB
- GameLoseFB
- FloatingText Spawner
- GameWinVFX
- (A whole bunch of particles)
- GameLoseVFX
- (A whole bunch of particles)
- GameTieVFX
- (A whole bunch of particles)
- KeypadPoint
- Keypad (This has a BoxCollider)
- SM_keypad_base (This uses mesh: Cube_4)
- NavMeshModifier (This has a nav mesh obstacle component)
If you set up your Unity scene to have these things and set up asset bundling, after you bundle just rename the bundle to your game name and drag it into your game folder.
C# script
Download Visual Studio and setup a new project using "Class Library (.Net Framework)".
Make a new C# script. In this file you will only need to add a new public class extending gamebase. For example:
public class ExampleGameName: GameBase {}
I highly recommend using dnSpy to look at the classes for the base casino games or looking at to understand how to do things.
Here are a few helpful things you should know:
void Start() {} This will run when the object gets instantiated.
public override
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: