Working with 3D Models in different GM versions

Introduction

Every game maker version is different compared to the others, sometimes this difference is small in other cases it's big. Especially when you look at something like loading and saving external models. This page will explain how to do that in different versions.

The following versions will be described:
- Game maker 8.1 and older
- Game maker studio v1.2 or higher
- Game maker studio v1.1058 or lower

Game maker 8.1 and older

The model loading and saving is pretty straight forward with Game maker 8.1 and older. Models get saved and loaded relative to the directory where your .gmk/.exe file is placed.

Loading and Saving

To load the model that's displayed in the image run this code:
glModelLightBulb = d3d_model_create();
d3d_model_load(glModelLightBulb,'gmmodLightBulb.gmmod');

If you want to save a model you can use:
d3d_model_save(glModelLightBulb,'gmmodLightBulb.gmmod');
*glModelLightBulb has to be an existing model

File format

Game maker 8.1 and the older versions use . (dots) in the model files. Some programs might export your model with , (comma's). When that happens just open the model file with a program like notepad++

Open the file and press Ctrl+F, click on Replace and fill in the correct values. Click Replace All and now your model is ready to be imported.

Game maker studio v1.2 and higher

In game maker studio it's quite difficult to load and save your external models. The models that you save with your game are placed in a completely different directory than the models that you load.

Loading models

The directory where you have to place your models is in your project directory. When you didn't choose a specific directory for your project it's probably in 'documents/GameMaker/Projects'

When you found this directory open up the datafiles directory. This is the folder where the models have to be placed.

An easy way to place your models is to drag the model into the 'Included Files' map (Your GMS project has to be opened).

Unfortunately this method has a few bugs in it, so every time you change the files using GMS you should check them with your file explorer. To easily find the file right-click your file and select 'Open in Explorer'.

Saving models

It took me quite some time to find directory where GMS saves its models. On windows you can find the directory in 'AppData/Local'. To get to this directory open the windows explorer, type %appdata% and press enter.

This will bring you to the folder Roaming, go up one directory level in order to get into the AppData directory. After that open the directory 'Local'.

In here you can find directories for all the projects you have made with GMS. When you open up a project map it should be pretty empty (unless you've saved a lot of models).

File format

Game maker studio 1.2 and newer versions use , (comma's) in the model files. Some programs might export your model with . (dots). When that happens just open the model file with a program like notepad++

Open the file and press Ctrl+F, click on Replace and fill in the correct values. Click Replace All and now your model is ready to be imported.

Game maker studio v1.1058 or lower

GMS version 1.1058 is the last version that supports Game Maker 8.1 files. This version works roughly the same as other GMS versions but the model format is different.

File format

Since it supports Game maker 8.1 it needs the same model format. Which means it has . (dots) in the model files. Some programs might export your model with , (comma's). When that happens just open the model file with a program like notepad++

Open the file and press Ctrl+F, click on Replace and fill in the correct values. Click Replace All and now your model is ready to be imported.