A downloadable tool for Windows
GMOC is a stand-alone tool that lets you create Game Maker Studio objects that are automatically wired up to scripts whose default content you can define for yourself.
I created this tool because I have a convention of how I set up new objects in Game Maker and what their default "Create", "Step", or "Draw" code looks like. Creating new objects and wiring up their respective events to scripts is a repetitive task that's time consuming and not very fun—especially when you participate in a game jam or just want to get coding right away. Also, I don't like to have code inside my objects.
- Open GMOC
- Browse for your GameMaker project (the .gmx file). If you create a few objects in a row, you don't have to re-open the GameMaker project each time.
- Enter the desired name of the new object
- Set prefixes for scripts and objects or leave them blank if you don't need them.
- Tick the boxes for each event you want scripted
- Click "Create Object"
How does it work?
GMOC opens a Game Maker project (.gmx) which is by itself an XML describing and referring to the files in your game. GMOC edits this XML accordingly and creates files for the scripts and objects you create with it.
How can I edit the template scripts?
GMOC will look for template files in its own directory when creating an object. The filenames for these templates can be set and edited in the settings.ini file which will be created when you first run GMOC. If no template files are present, GMOC will use the hard-coded default scripts and will also automatically save them as user-editable template files in its directory.
The template files are simple UTF-8 text files which you can fill with your GML code. Additionally, there are two keywords:
- $SCRIPTNAME$ will be replaced with the name of your script, which can be useful to refer to the script by name in debugging or logging
- $NICENAME$ will be replaced with the "nice" name of the event, e.g. "Step" or "Draw GUI". You can edit these "nice name" values in settings.ini for each event.
I've been using GMOC for my own projects for almost two years now and it's pretty robust. However, if there are already objects or scripts with the same name as those to be created, things get bad. In either case:
Don't panic: GMOC creates a backup of your original GameMaker project -gmx file before each object you create with it. These are stored in the directory of the .gmx file.
"Object/Script already exists"
Currently it is not possible to overwrite existing objects or scripts. Also, if you go back and forth between creating object and scripts, there might remain remnants of previously created script or object files in the file hierarchy of your Game Maker project that are not reflected in the .gmx file.
In this case you have to manually delete the existing objects and scripts before you can create new ones with GMOC. This is how you do it:
- Navigate to the root of your Game Maker project
- In the "objects" folder, delete the conflicting .gmx files.
- In the "scripts" folder, delete the conflicting .gml files.
Click download now to get access to the following files:
Leave a comment
Log in with your itch.io account to leave a comment.