Skip to content

Commit fc5b6ae

Browse files
Updated documentation and removed redundant steps in scripts (#2)
1 parent bf6fbb9 commit fc5b6ae

4 files changed

Lines changed: 16 additions & 62 deletions

File tree

docs/HowToBuild.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Before you begin, ensure you have the following installed and configured:
1919

2020
- **Node.js 22+** - Download from [nodejs.org](https://nodejs.org/)
2121
- **GameMaker** - Any recent 2024.1400.3 Beta release (or newer), which you can download from [the release notes site](https://releases.gamemaker.io/) and must have also configured already for GX.games YYC development by following [its setup guide](https://github.com/YoYoGames/GameMaker-Bugs/wiki#platform-setup-guides)
22+
- You may use older versions of GameMaker but will need to use the [GMEXT-Reddit Extension](https://github.com/YoYoGames/GMEXT-Reddit/) which includes the example project and requires you to build your game with the gx.games target rather than the reddit target. Further details can be found in the extension repository.
2223
- **Reddit Developer Account** - Sign up at [developers.reddit.com](https://developers.reddit.com/)
2324

2425
---
@@ -163,6 +164,9 @@ When you're ready to test your changes:
163164

164165
![Screenshot: GameMaker Run button highlighted](_screenshots/gamemaker-run-button.png)
165166

167+
> [!IMPORTANT]
168+
> If not running on Windows, ensure that execute permissions are enabled on the `setup-gamemaker-devvit.sh` script within your devvit project
169+
166170
GameMaker will:
167171
- Build your game to WebAssembly
168172
- Automatically copy the necessary files to your Devvit project directory (specified in Game Options)
@@ -308,6 +312,13 @@ export type SaveScoreRequest = {
308312
- Run `node --version` to check your version
309313
- Update Node.js if necessary: [Download latest version](https://nodejs.org/)
310314

315+
### setup-gamemaker-devvit.sh Permissions Issue
316+
317+
**Solution**
318+
- Ensure that execute permissions are enabled on the `setup-gamemaker-devvit.sh` script
319+
- Run `ls -l setup-gamemaker-devvit.sh` to verify permissions
320+
- Run `chmod +x setup-gamemaker-devvit.sh` to grant execute permissions
321+
311322
---
312323

313324
## Additional Resources
@@ -319,6 +330,7 @@ export type SaveScoreRequest = {
319330
- [GameMaker Manual](https://manual.gamemaker.io/)
320331
- [GameMaker Reddit Template Repository](https://github.com/YoYoGames/GameMakerRedditTemplate)
321332
- [GameMaker Reddit Demo Project](https://github.com/YoYoGames/GM-RedditDemo)
333+
- [GameMaker Reddit Extension - For older versions of GameMaker](https://github.com/YoYoGames/GMEXT-Reddit)
322334

323335
---
324336

-5.04 KB
Loading

setup-gamemaker-devvit.bat

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,17 @@ echo Devvit project: %cd%
5353
echo Copying GameMaker files to game directory...
5454
xcopy "%RUNNER_DIR%\*" "%CLIENT_PUBLIC%\" /Y /Q
5555

56-
:: Replace template placeholders with project name
57-
echo Replacing template placeholders...
58-
59-
:: Replace in package.json
60-
if exist "package.json" (
61-
echo Updating package.json...
62-
powershell -Command "(Get-Content 'package.json') -replace '<%%\s*name\s*%%>', '%PROJECT_NAME%' | Set-Content 'package.json'"
63-
)
64-
65-
:: Replace in devvit.json
66-
if exist "devvit.json" (
67-
echo Updating devvit.json...
68-
powershell -Command "(Get-Content 'devvit.json') -replace '<%%\s*name\s*%%>', '%PROJECT_NAME%' | Set-Content 'devvit.json'"
69-
powershell -Command "(Get-Content 'devvit.json') -replace '<%%\s*subreddit\s*%%>', '%SUBREDDIT_NAME%' | Set-Content 'devvit.json'"
70-
)
71-
72-
:: Replace in server post.ts
73-
if exist "src\server\core\post.ts" (
74-
echo Updating post.ts...
75-
powershell -Command "(Get-Content 'src\server\core\post.ts') -replace '<%%\s*name\s*%%>', '%PROJECT_NAME%' | Set-Content 'src\server\core\post.ts'"
76-
)
77-
7856
echo.
7957
echo GameMaker game setup complete!
8058
echo.
8159
echo Project configured:
8260
echo - Name: %PROJECT_NAME%
8361
echo - GameMaker files: Copied
84-
echo - Template placeholders: Replaced
8562
echo.
8663
echo Next steps:
87-
echo 1. Run "npm install" if you haven't already
88-
echo 2. Run "npm run dev" to start the development server
89-
echo 3. Your GameMaker game should now load in the Devvit app
64+
echo 1. Run "npm run dev" to start the development server
65+
echo 2. Your GameMaker game should now load in the Devvit app
9066
echo.
9167
echo Files copied:
92-
echo - All GameMaker files → src\client\public\game\
9368
echo - Core runtime files → src\client\public\ (root level)
9469
echo.

setup-gamemaker-devvit.sh

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -47,50 +47,17 @@ echo "Devvit project: $(pwd)"
4747
echo "Copying GameMaker files to game directory..."
4848
cp -r "$RUNNER_DIR"/* "$CLIENT_PUBLIC/"
4949

50-
# Replace template placeholders with project name
51-
echo "Replacing template placeholders..."
52-
53-
# Function to replace template placeholders
54-
replace_template() {
55-
local file="$1"
56-
if [ -f "$file" ]; then
57-
echo "Updating $file..."
58-
# Use sed with backup for compatibility across platforms
59-
if [[ "$OSTYPE" == "darwin"* ]]; then
60-
# macOS
61-
sed -i '' "s/<% *name *%>/$PROJECT_NAME/g" "$file"
62-
sed -i '' "s/<% *subreddit *%>/$SUBREDDIT_NAME/g" "$file"
63-
else
64-
# Linux
65-
sed -i "s/<% *name *%>/$PROJECT_NAME/g" "$file"
66-
sed -i "s/<% *subreddit *%>/$SUBREDDIT_NAME/g" "$file"
67-
fi
68-
fi
69-
}
70-
71-
# Replace in package.json
72-
replace_template "package.json"
73-
74-
# Replace in devvit.json
75-
replace_template "devvit.json"
76-
77-
# Replace in server post.ts
78-
replace_template "src/server/core/post.ts"
79-
8050
echo ""
8151
echo "GameMaker game setup complete!"
8252
echo ""
8353
echo "Project configured:"
8454
echo "- Name: $PROJECT_NAME"
8555
echo "- GameMaker files: Copied"
86-
echo "- Template placeholders: Replaced"
8756
echo ""
8857
echo "Next steps:"
89-
echo "1. Run \"npm install\" if you haven't already"
90-
echo "2. Run \"npm run dev\" to start the development server"
91-
echo "3. Your GameMaker game should now load in the Devvit app"
58+
echo "1. Run \"npm run dev\" to start the development server"
59+
echo "2. Your GameMaker game should now load in the Devvit app"
9260
echo ""
9361
echo "Files copied:"
94-
echo "- All GameMaker files → src/client/public/game/"
9562
echo "- Core runtime files → src/client/public/ (root level)"
9663
echo ""

0 commit comments

Comments
 (0)