-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add TileProperties, generalize EditorPropertyResource #23864
Conversation
95426d4
to
d3a1510
Compare
Thank you so much!! :) this is a great addition to the tiles functionality!! the default script idea is neat and the dictionary to the tileset instead of per-tile makes way more sense!! :) Why is there still a non successful check in Travis?! the merge is near never the less, i wish I new more to contribute to this (godot) GuiHub project |
d3a1510
to
2503813
Compare
@xDGameStudios The unsuccessful check in Travis was because my Visual Studio, for whatever reason, replaced a whole bunch of |
@akien-mga the merge review will be made for godot 3.2?! |
Yes, we are in feature freeze for Godot 3.1. |
@xDGameStudios don't worry too much. There's a fair chance that this PR could be cherry-picked for 3.1.1. |
Thank you for implementing this. |
@TextusGames Yeah, there is an existing Issue for that (#9180). You'd have to create a contextual editor for TileMap so that it could see a list of placeable scenes/scripts and then have it add those. The difficulty would be where to add them. If you started placing the scenes/nodes as children of the TileMap, and you also have multiple TileMaps in your game, it would become almost impossible to properly keep track of which objects exist where when looking at a larger world map on a macro scale (instead of, "give me all of the Goblin scenes that are children of my Goblins node" ( In some cases, this distribution may be desired (maybe each TileMap is a self-contained level all on its own for a small-scale game) and it could work very well. In other cases though, with multiple TileMaps for different world layers, multiple configurations of scene/node placement options, etc., it wouldn't be ideal. I think the best way to handle it would be to use a new Resource that configures what things can be instanced by a TileMap in addition to tiles (a separate list entirely from the currently selected tileset), and then pair each option with a NodePath that specifies where to add the selected node to the scene tree, even if its global position is determined by the TileMap. If undefined, then it could just default to the TileMap itself, and if you wished to re-use a configuration for multiple TileMaps, that would be easy enough. Edit: I think, with this ^ implemented, you'd start having usability that begins to approximate GameMaker: Studio in terms of tile-based 2D games. |
You can close #9180 adding a virtual function to tile's script to be called on ready pass, something like:
|
Or even a property on TileProperties called "instance_on_startup" and instance it yourself if it exists, then you dont rely on the user to write it himself (because they would probably not know how to do this if dont find a guide or tutorial) |
What's the status of this? Would love to see this in the next release as it's really much needed...
... but will it be cherry picked, and if yes, when will 3.1.1 be released? EDIT: I don't mean to put pressure onto anybody, was just asking out of curiosity because this would be a really nice to have feature, being able to build fully-featured tilemaps as opposed to either totally static ones or hacky workarounds for tiles with special properties etc. |
Any update on this possibly being included in 3.2? |
@willnationsdev i think this PR have a lot of added value to tilesets and tilemaps if conflics are solved, Do you think you will have time to look at it? |
I can try to take a look at this in the coming days, although I'm pretty busy. I've been out of the Godot game for a few months due to work stuff taking priority. I'll try to rebase and clean up the PR though. |
I would love to have this implemented. |
3502783
to
155d555
Compare
Is there any chance we could get this feature also for GridMap and MeshLibrary? |
It would basically need to be re-implemented from scratch in both of those classes. I also know nothing about how those classes work and don't mess around with 3D much myself. Anyone is welcome to check out the changes made in this PR and see how to reproduce them for those types (I don't even think the changes would be all that different, probably). Nothing stopping anyone. ;-) I've got other things I'm working on though. |
Any update on this? |
I haven't bothered rebasing it until 3.2 is released. The fact that it is targeted for 4.0 is basically the only reason it hasn't been merged yet. It's already been marked as ready for a PR meeting to be discussed. Just a matter of them getting to it (there is a long list). Once it is approved, the feature freeze is lifted, and I rebase it, it will be ready to merge. If you are familiar with git, and building the Godot source, you could easily enough resolve the conflicts yourself and cherry-pick the commit from my fork's branch. |
77a5751
to
19f696f
Compare
is there a plan to have this change merged? would love to have this functionality! |
Hoping this gets merged sometime in the future. This would be extremely useful in my current project. |
@thegrumpybuffalo @PhoenixAran There are a lot of core refactorings going on right now, so if I rebased the pull request's branch on master as it is now, it would just break with more conflicts later as they continue to do core refactorings. I am waiting until that work is done before I rebase the PR and fix all the errors. And, because it looks like the clang-format rules have been updated since this was initially submitted, there is now a legion of "changes" in the diff that are completely unrelated to the content of the PR. I'm gonna have to sift through everything manually and figure out what should stay and what shouldn't. |
@willnationsdev The majority of the core refactoring work done by the core devs is finished, so anytime soon would be a good time to rebase this. |
b952275
to
7b0582c
Compare
This has all been rebased now, btw. |
tried building this, I crash when I try to add a new single tile to a newly created tileset in a blank project |
@abueide Thanks, I'll try to debug it as soon as I get a chance. |
@abueide That issue should now be resolved. |
Just an FYI for anyone looking at this: chances are, this PR will be closed with the work that groud is doing on the new TileSet/TileMap system. And I've mentioned it to him and he already has thoughts about how to allow properties for tiles (or something to that effect). Idk the details. |
Are there any news on this? This is such an important feature still missing in Godot :/ |
The TileMap and TileSet rework is happening here: #45278 |
This PR has been completely outdated by the work on the TileMap/TileSet refactor and therefore can be closed. |
This PR does several things.
meta_properties
Dictionary that is exported to the Inspector. It likewise can be edited from a TileMap just by expanding the sub-inspector.meta_properties
Dictionary just like in the TileMap. It also displays the script for the TileSet so that it can be assigned a value without having to open a separate Inspector.tiles_default_script
property has been added to the TileSet class and exposed to the Inspector. If one sets a script to this value, then all created tiles will automatically create an instance of a TileProperties sub-resource and assign that script to it, guaranteeing that all tiles have access to those properties.get_class_icon
method.This should take care of a great many different Issues:
meta_properties[str(id) + "/property"] = "value"
. I THINK we could close it with this PR.Here are some screenshots from my build, using the below scripts:
TileMap Inspector:
TileSetContextEditor:
Edit: I have just modified it so that the
meta_properties
value is displayed as "Meta Properties" in the TileSetContextEditor instead of as "Meta" (that was a mistake).