New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set origin coordinate for objects for GameMaker room export #1427
Comments
Hmm, I guess this could be implemented by supporting two custom tiles properties, And rather than having them as custom properties, it would be nice to actually support setting the origin for each tile in Tiled as well of course. This partly covered by #1323 (it still needs to be finished, and there's no convenient way to set it). |
The missing originX and originY parameters for objects is the only reason why I'm not using Tiled for placing objects in Tiled for my current game project. It would be really great to ditch the build in level editor and use Tiled for everything realted to level building. My work flow now is:
Regarding the originX and originY parameters. Wouldn't it be possible to select the .gmx project file and read in all the already set values from the GM project and use them? Just a spontaneous idea. Thanks for the great work! |
@TrunXGIT That workflow is so totally unacceptable. :-( Reading in the existing object and sprite definitions from the GameMaker project would of course be ideal, but it won't be trivial since Tiled currently has no similar functionality. I think the closest thing would be to implement it as custom tileset format. And then of course, the origin stuff still needs to be done as well. In any case, I do hope to get around to it eventually. And contributions in code are welcome too of course! |
@TrunXGIT If it can help : use "select-all" (ctrl+a) in the original room copy and then paste them all at once into the new room. But yeah, there's several steps between Tiled and GM. |
Thx for the tip kevintrepanier. In some cases it might be helpful, in others there would be still a lot of adjustments to do. By the way, before somebody is thinking the GM exporter needs to be changed for the origin points. |
Can you elaborate on what kind of adjustment? I noticed there are quite a bit of additional features in GameMaker rooms, like repeating image backgrounds and other options. Do you mean setting those up? I'd like to support as many of them as possible in a meaningful way in Tiled, to avoid the need for repeating setup in GameMaker after each export.
Right, most of the work for supporting this will be to finish #1323, which is the equivalent of setting up the origin on a sprite in GameMaker. |
Settings I usually have to change when importing or creating a new room :
There are also physics properties that can be set for the room for those who use it. |
This seems to be solved now with the next update? :) |
For now the implemented solution to this is to support two additional custom properties, It's not ideal, but in combination with 1524072, which allows those properties to be specified on tiles or templates, you can at least avoid having to set up these properties for each instance.
@kevintrepanier I guess you have found out in the meantime that most of those settings can actually be specified in Tiled using custom properties. All except the backgrounds, which are still not supported (I think it would make sense to export the image layers as backgrounds). You can now also find these properties documented at http://doc.mapeditor.org/en/latest/manual/export/#gamemaker-studio-1-4. And now of course the new properties added in 9e1023e should still be documented... |
Documentation added in a70489a! It will be live soon at the above link. |
I've downloaded the Alpha 4 snapshot (Version 2017.09.13) and tested the originX and originY custom properties for GameMaker but it does not seem to work properly. In GameMaker, the X is equal to the X in Tiled and the Y is offsetted by -32 pixels (32 being my object's height). The originX and originY does not seem to affect the X and Y at all (I've tried changing their value but it does not change the result). Side note : I also have an object that I've long ago deleted in Tiled but that keeps appearing in my imports in GameMaker. I can't reproduce that bug but it makes me wonder if there is other residual informations that might cause the origin problem? |
That is because the release date of the Alpha 4 snapshot is before this functionality was implemented (6 days ago). These custom properties will be supported starting with the Alpha 5 snapshot, which I plan to release today.
I have no idea how something like that could happen. What is deleted in Tiled doesn't show up in the exported file, so maybe this object was coming from somewhere else? Or maybe you missed a hidden object? |
Ok, thanks for the info. Looking forward to test it in the new snapshot! You are right about the other "residual" object. It was individually hidden in a layer I didn't expect to find it. So no problems here. |
And it's out! https://thorbjorn.itch.io/tiled/devlog/11050/tiled-11-alpha5-and-documentation :-) |
Tested and it's working perfectly! Thanks a lot! |
It is frequent in GameMaker to use the center of an object as it's origin for easy placement and collisions. However in Tiled the origin seems to always be the top-left corner of the object.
Being able to set an origin point would be very useful.
The text was updated successfully, but these errors were encountered: