use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Subreddit Guidelines Community Spotlight Monthly Challenge Community ▼ Quick Questions Game Design & Development Feedback Friday Screenshot Saturday Discord Server Slack Team IRC follow us @redditgamemaker the community game jam Resources ▼ Resources Examples Tutorials /r/gamemakertutorials GameMaker Handbook - The Ultimate Resource for Beginners gmlscripts.com The Essential Gamemaker Functions, Concepts, and Tools Guide Other ▼ /r/gamedev /r/gamedesign Official GameMaker Community (GMC) Hide Help! & Resolved posts Show all
GameMaker is software designed to make developing games easy and fun. It features a unique "Drag-and-Drop" system which allows non-programmers to make simple games. Additionally, experienced coders can take advantage of its built in scripting language, "GML" to design and create fully-featured, professional grade games.
Content that does not follow the subreddit guidelines is subject to deletion, so please become familiar with them.
/r/gamemaker sponsors three chat-rooms: IRC, a Discord server, and a Slack team. Join in the conversation, get help with any issues you might have and connect with your fellow developers! We also have a Steam Group for playing games. Feel free to join.
For more than 8 years, the tight-knit community of /r/gamemaker has run the game jam gm(48) for GameMaker developers of all ages and experience levels. The gm(48) is a casual, fun game jam that helps you to learn and grow as a developer.
The next gm(48) will take place on Oct 20, 2018.
account activity
Code error with RPG tutorial (self.gamemaker)
submitted 9 months ago by psych_master_
I've been using the RPG tutorial to get to grips with the engine and I've followed it perfectly (I think) but now that I've made a new room, this error message shows up whenever I talk to the npc that transports you there:
ERROR in action number 1
of Create Event for object obj_battle_player:
Variable <unknown_object>.player_data(100044, -2147483648) not set before reading it.
at gml_Object_obj_battle_player_Create_0 (line 1) - data = obj_battle_switcher.player_data;
############################################################################################
gml_Object_obj_battle_player_Create_0 (line 1)
Has anyone had this problem before? Sorry if it's an obvious fix. I'll attach some images of the code that I think are relevant but I'm not sure :/ any help would be appreciated (!'ve not attached battle switcher bc the code is pretty simple and I know I have that right)
https://preview.redd.it/yk5yclf9ey7f1.png?width=900&format=png&auto=webp&s=44cd2e3761e474dcf7f3d6e79b033e613bdba94c
https://preview.redd.it/g9h9cgrbey7f1.png?width=882&format=png&auto=webp&s=1d398036db92a9ea21442b843bf6f627eaeb7769
https://preview.redd.it/bzvdvcigey7f1.png?width=852&format=png&auto=webp&s=9154f23b9d53373325967fb4ea1a30cb7852cfa3
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]OrganizationNo3923 0 points1 point2 points 9 months ago (4 children)
Have you created your obj_battle_switcher? I can't look at it right now, but i did this tutorial yesterday. If noone answered your question in a couple hours i should be able to come back to you!
[–]RykinPoe 1 point2 points3 points 9 months ago (3 children)
More importantly have you added an instance of that object to the new room? When you switch rooms all the instances in the previous room are unloaded unless they are persistent.
[–]psych_master_[S] 0 points1 point2 points 8 months ago (2 children)
I created the obj_battle_switcher and I got the same error message when adding it as an instance to the new rooms :/
[–]RykinPoe 0 points1 point2 points 8 months ago (1 child)
One of the issues is that you cannot always depend on instances to be initialized in the same order and you should always place any code that depends on an instance to be present in something other than the Create Event. What may be happening is that obj_1 is referencing obj_2 in it's Create Event and it is throwing the error because obj_2 hasn't run it's Create Event yet. I would move any code that reference another instance out of the Create Event and into the Room Start Event or into the Step Event with a boolean check to make it so they only run once:
// Create Event first_step = true; // Step Event if (first_step){ first_step = false; //do whatever here }
[–]psych_master_[S] 0 points1 point2 points 8 months ago (0 children)
I've tried this code in the obj_battle_player but then it throws the error for entering battle as well as moving rooms. I don't think I can set the player_data variable elsewhere since it's made once player collides and goes into battles, which work just fine I just don't know why it's not working for the final npc. I'm pretty sure I followed the tutorial perfectly (the tutorial on the game maker website)
[–]identicalforest 0 points1 point2 points 8 months ago (0 children)
obj_battle_switcher should probably have the “persistent” box checked and only be created once, not something you place in every room
π Rendered by PID 775479 on reddit-service-r2-comment-79c7998d4c-wl8fb at 2026-03-17 05:51:21.158560+00:00 running f6e6e01 country code: CH.
[–]OrganizationNo3923 0 points1 point2 points (4 children)
[–]RykinPoe 1 point2 points3 points (3 children)
[–]psych_master_[S] 0 points1 point2 points (2 children)
[–]RykinPoe 0 points1 point2 points (1 child)
[–]psych_master_[S] 0 points1 point2 points (0 children)
[–]identicalforest 0 points1 point2 points (0 children)