Windows [Tool] GMS2 Resource Importer (updated: 2019-05-01)

Mick

Member
Since there is no easy way of importing resources (sprites, sounds, scripts etc.) from other projects in Gamemaker Studio 2, I decided to create a tool for just that. The tool will let you import multiple resources of different types in one go. You can import resources from normal .yyp projects and .yyz exported project archives.

EDIT: I have updated this tool with the options to import external sprites and sounds (similar to my sprite loader tool for GMS1.4). This is especially helpful when wanting to replace multiple sprites or sounds in a project. You can import multiple sprites or sounds in one go, sprites or sounds already in the project will be replaced (if you want), settings for existing resources will be saved. Read more about this in the instructions.

Important: If you test this tool, please take backups of your projects or use projects under version control. I appreciate if you try it out and let me know of any issues, I have successfully tested it with a few of my own projects. If you want to support this tool, you can buy my game. :)

Notes and limitations
  • I have had the destination project open in GMS2 while importing resources and it has worked without problems, you should always save the project before doing an import with my tool.
  • To import resources from a GMS1.4 project you need to first import the project into GMS2 and then use the GMS2 version of the project as source.
Changelog
Version 1.0.1 (2020-03-31)
- Sprite export function added (export some or all of the sprites at once).
- Entire folders of external sprites can be imported (also recursively).
- Some convenience settings added.
- Updates to the user interface.
- Fixed a bug with gif format not working in the open file dialog for importing gifs.
Version 0.9.1 (2019-05-26)
- The tool should now run on Mac OS X and Linux using the Mono runtime.
Version 0.9.0 (2019-05-01)
- Added support for Notes.
- Select all / Deselect all resources.
- Fixed a bug with folder handling. (Earlier versions of GMS2 have been able to correct this)
- Fixed a bug with replacing existing resources.(Earlier versions of GMS2 have been able to correct this)
Version 0.8.0 (2019-01-23)
- Single tree view instead of separate views for different resource types.
- Folder support (entire folder structure of source resources are maintained).
- Option to replace existing resources.
Version 0.6.1 (2018-06-23)
- The resource lists are now sorted alphabetically.
Version 0.6.0
- Resources from a broken project (or resources copied to somewhere else on the hdd) can be imported.
Version 0.5.0
- Separate sprite and sound import to add / replace multiple sprites or sounds in one go.
Version 0.3.0
- First public version.

Download on itch.io
https://gamephase.itch.io/gms2-resource-importer

gms2-resource-importer-v101.png
*) The chance of GUIDs colliding is very small, almost astronomical.
 
Last edited:

Hyomoto

Member
I don't need it just yet, but this is definitely on a short list of things GM could really use. I know raw data is more valuable than praise, but this is definitely something I'll be back to give you feedback on.
 

Mick

Member
I fixed a bug regarding running an import with no successful imported resources (triggered when no resources were selected and doing an import or when all resources already existed in the destination project). The download link is still the same.
 

Mick

Member
You can now also import multiple external sprites and sounds quickly with this tool. Existing sprites and sounds will be replaced (saving the bounding boxes and other settings). This should make it much easier to work with external image editors. Default settings for new sounds and sprites can be edited via the json templates (read the instructions).

Making the sprite import feature was interesting due to all the GUIDs, it seems to be working fine according to my tests.
 

DukeSoft

Member
I've been working on that too, but for GMS1 :p Pretty much like Composer works for PHP packages and NPM for Node / JS packages;

 
D

Dene

Guest
Wow! Nice. But is there a possibility to import animated sprites? For example, I have multiple .png images each representing one frame of animation.
 
Last edited by a moderator:

Mick

Member
Wow! Nice. But is there a possibility to import animated sprites? For example, I have multiple .png images each representing one frame of animation.
At the moment it supports animated gifs and _strip# animations, it can't load multiple images as one sprite animation. Can I ask you why you have separate .png images for every frame of animation, some limitation with a graphics editor you use or?
 
D

Dene

Guest
At the moment it supports animated gifs and _strip# animations, it can't load multiple images as one sprite animation. Can I ask you why you have separate .png images for every frame of animation, some limitation with a graphics editor you use or?
That's because 1. Render from 3d-app (Blender) 2. Specifications of the project we're curently working on.
 
Just popping in to say thanks for this tool. I have a master project I keep all my reusable code in and it's a pain to create a private extension just to copy a single system over to a new project. The tool is very simple to use and it worked flawlessly for what I used it for. Until Studio has a better built in method for migrating resources between projects, I foresee myself using your tool rather frequently. Kudos and we'll done.
 

Mick

Member
I uploaded a new version (same download link). I added a feature to import resources from a broken project or resources that are "disconnected" from any project. To import objects (as an example) you would click the "Import Resources..." button (down left), browse to the "objects" folder of your old project, select all object folders and then click "Select folder".
 

ricardo1996

Member
bro i love you. thanks alot. this my first game ive been at it for awhile the code is basically finish just need the art work from a friend. ran into several corruption errors. saying i have a duplicate of a object and sprite but couldnt find it so i cleaned before running everytime but with your tools i saw the dups. i just unchecked one and it worked fine. same with the cant find a room even tho you have rooms errors.
 

The-any-Key

Member
It would be great if we could sort the lists. I am using it to move scripts and objects from one project to another. But the lists are unsorted and become a little hard worked (we are coders, we are lazy). It would be great if we could move a group of script and objects :) :) :) :) :)
 
this looks GREAT!! Thank you so much for the contribution.

1) Could you make a compiled version for Mac?

2) Could you add functionality just for scripts?! sometimes I use Visual Studio Code to make the scripting and save GML files with #define to create many functions on the same file. It would be great if the tool was able to just import *.GML files into (not having it inside a project)
 

Mick

Member
1) Could you make a compiled version for Mac?
The tool might work with mono framework on Mac alread, not sure. I will probably not make a separate version for Mac though, if some small changes are needed for it to run under the mono framework, then sure, I could fix that.

EDIT: Just tried using mono on an Ubuntu machine, it is not working, so won't work on the Mac either I assume.

2) Could you add functionality just for scripts?! sometimes I use Visual Studio Code to make the scripting and save GML files with #define to create many functions on the same file. It would be great if the tool was able to just import *.GML files into (not having it inside a project)
It might be possible to import "loose" scripts, but the #define functionality is not there though.
 
Last edited:

Mick

Member
It would be great if we could sort the lists. I am using it to move scripts and objects from one project to another. But the lists are unsorted and become a little hard worked (we are coders, we are lazy). It would be great if we could move a group of script and objects :) :) :) :) :)
The lists are now automatically sorted. You can use the old download link in the original post to get the updated version. The group thing would be nice, but currently I don't have the time to do it I'm afraid.
 

The-any-Key

Member
The lists are now automatically sorted
Thanks. This will help a lot. I can name my resources so I can better copy a specific part from an existing project.

The group thing would be nice, but currently I don't have the time to do it I'm afraid
Some rainy day. We will get an update for GMS2 where you can import and export resources locally.
 

GMpeaks

Member
thanks a lot for this importer!
Few issues: java exception is raised when a file(like dll) is not found and I need to close and reopen application(importer) after fixing.
Also in the above case when import fails some files would have got moved and on reattempt to import it says already exits(Java exception) and again I need to close application and there is no way it will not continue to import if some of the files already imported
 

Relic

Member
Argh! I’m 2 days too late discovering this. What a tedious slog it was to get all my resources into a fresh project.

Will use next time.
 
R

RagTagRadical

Guest
Just started using it. Wanted to say Thanks!
I had been building prototypes of systems in separate projects in the hopes of merging them later, without thinking about how I'd achieve that.
 

Hyomoto

Member
Well, I said I'd come back and give feedback eventually! It took a while but, first off, yes: this is quite useful. The major feature that it lacks, and that would make the biggest impact for me (beyond the current functionality) is folder support. I usually break up my project into folders pretty heavily, and being able to just select a folder of objects/scripts/etc... to import would be about the biggest improvement possible. Given the lack of this basic functionality in GM2 right now, thank you very much for your hard work here.
 

Mick

Member
Well, I said I'd come back and give feedback eventually! It took a while but, first off, yes: this is quite useful. The major feature that it lacks, and that would make the biggest impact for me (beyond the current functionality) is folder support. I usually break up my project into folders pretty heavily, and being able to just select a folder of objects/scripts/etc... to import would be about the biggest improvement possible. Given the lack of this basic functionality in GM2 right now, thank you very much for your hard work here.
I totally agree that folder support is the most important missing feature. I had limited time when I made this and folder support would have increased the scope quite a bit, due to how folders in the project files are stored. If I find the time, I will see if I can add folder support.
 
I for one would also greatly appreciate folder support. But either way, I'm happy with the tool and try to let as many people as I can know about it!
 
S

SanguisMalus

Guest
Great tool! Only missing 2 functions which are:
  1. Already mentioned folders sorting
  2. Possibility to replace already existing resources - example: Have room where I have played with new sprites/objects. However in the end I would like to take whole room with layers and objects inside those layers to already existing project. So I import sprites and object (because they are new -> no problem), but when importing room I face issue because room already exist. (I solved this problem by manually copying rooms folders, but I feel thats quite tricky solution and might bring some troubles in the future)
 
Great tool! Only missing 2 functions which are:
  1. Already mentioned folders sorting
  2. Possibility to replace already existing resources - example: Have room where I have played with new sprites/objects. However in the end I would like to take whole room with layers and objects inside those layers to already existing project. So I import sprites and object (because they are new -> no problem), but when importing room I face issue because room already exist. (I solved this problem by manually copying rooms folders, but I feel thats quite tricky solution and might bring some troubles in the future)
To your second point, an option to either keep existing files or overwrite would be the best solution I feel.
 

thaaks

Member
Hi Mick,
just gave your tool a test run and it worked like a charm! Thanks a million and awesome work! Just what I (and GMS:2 as a builtin feature!!!!) needed!

In fact I only can join the others in asking for adding folder support and replace feature for existing resources when importing from source project to destination project.

Otherwise your tool is brilliant! It helps me to stay sane when merging my own local assets/scripts/frameworks with my current game projects! What a time saver!
 

Mick

Member
I have been working on folder support, it's almost ready (with the reservation for some bugs). It required quite a lot of work due to the over-complex system for views/folders in GMS2 projects. Instead of separate windows for all resource types, I changed to a single tree view. I might be looking into an option to replace already existing resources later, but until then, you will need to delete the existing resources from the destination project and then import them with the tool.
 

Hyomoto

Member
This is going to be the most weirdly, and somewhat unintentionally, condescending thing I say all week: your game doesn't look awful and I'm happy to show my support for the work you've done here. When I'll get around to playing it, I have no idea. You really do deserve the compliments and praise for this tool. I can't speak for Yoyo, I have no idea what their plans are, but this is living proof that letting the community fill in the holes in GM functionality is worthwhile and I hope it helps them see that. I know that untangling the project format GM2 uses is no simple task, so it's more remarkable you've been able to do this.
 

zbox

Member
GMC Elder
I don't know if I mentioned this (I intended to a while ago but I must have never posted it) but I use this all the time. It's an essential tool for me now. Just realised it has an update too which is even better.

Thanks heaps!
 

JayR

Member
I'm encountering an error whenever I select my destination folder.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Windows.Forms.TreeNodeCollection.get_Item(Int32 index)
at GMS2ResourceImporter.frmMain.LoadSourceProject(String fileName)
at GMS2ResourceImporter.frmMain.btnImportFrom_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at MetroFramework.Controls.MetroButton.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
GMS2ResourceImporter
Assembly Version: 0.8.0.0
Win32 Version: 0.8.0.0
CodeBase: file:///D:/Downloads/Anim/GMS2ResourceImporter080/GMS2ResourceImporter/GMS2ResourceImporter.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3314.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
MetroFramework
Assembly Version: 1.4.0.0
Win32 Version: 1.4.0.0
CodeBase: file:///D:/Downloads/Anim/GMS2ResourceImporter080/GMS2ResourceImporter/MetroFramework.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2558.0 built by: NET471REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
Assembly Version: 1.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Newtonsoft.Json
Assembly Version: 11.0.0.0
Win32 Version: 11.0.2.21924
CodeBase: file:///D:/Downloads/Anim/GMS2ResourceImporter080/GMS2ResourceImporter/Newtonsoft.Json.DLL
----------------------------------------
System.IO.Compression.FileSystem
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2558.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.IO.Compression.FileSystem/v4.0_4.0.0.0__b77a5c561934e089/System.IO.Compression.FileSystem.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2558.0 built by: NET471REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 

Mick

Member
I'm encountering an error whenever I select my destination folder.
According to the error message the problem is with selecting the source project. I don't get that error message myself so at this time I don't know what the problem might be.
 

JayR

Member
According to the error message the problem is with selecting the source project. I don't get that error message myself so at this time I don't know what the problem might be.
Ahh... Silly me, I overlooked selecting the source project. Sorry!
 

thaaks

Member
Hey Mick, just wanted to let you know that the folder stuff is working fine for me. Will try replacing/updating existing resources in the next few days. Thanks again for your awesome tool!
And I just bought your game ;-) Didn't want to buy it while it was on sale...
 

Mick

Member
I have updated the tool once more. I fixed bugs with folder handling and replacing resources. Earlier GMS2 versions has been able to correct for these bugs, so it's important that you get the new version. Get it here: http://gamephase.net/files/linked/GMS2ResourceImporter090.zip

Version 0.9.0 (2019-05-01)
- Added support for Notes.
- Select all / Deselect all resources.
- Fixed a bug with folder handling. (Earlier versions of GMS2 have been able to correct this)
- Fixed a bug with replacing existing resources.(Earlier versions of GMS2 have been able to correct this)
 

Pizuar

Member
I can't count how many times I've been using this tool over the past year, thank you so much for creating this.
 

Japster

Member
Just to add that once again, @Mick 's awesome merge tool comes to the rescue - HUGE thanks mate - I'm currently trying to import YellowAfterLife's fantastic Steam Multiplayer example/extension into my project, and found that yes, GMS2 is a nightmare to bring in a 40+script, many resources project. :(

...after carefully and manually importing all of these, it just would NOT work - "Wrong number of parameters" and all sorts of errors...

Using this amazing tool I managed to import the lot in seconds, and well, it just all WORKED as expected, instantly!... :D

You have my utmost appreciation and massive thanks once again mate, and I hope that this tool gets more love and support - it certainly deserves it!
 

Amon

Member
Just found this on a Google search when I searched for merging two GMS2 projects. It worked flawlessly. Great tool, great design and easy to use.
 
Top