TrenchBroom / TrenchBroom

Cross-Platform Level Editor
kristianduske.com/trenchbroom
GNU General Public License v3.0
1.88k stars 224 forks source link

Optional automatic unique `targetname` generation #4376

Open jfaz1 opened 7 months ago

jfaz1 commented 7 months ago

I'm planning on adding this to my small TB fork, but curious if there's interest in this feature to attempt upstreaming it after since it probably helps in a lot of maps.

An issue I came across when making larger maps is keeping track of targetnames and ensuring they don't conflict. For instance, you might have 5 switches that open 5 different doors. If you name them door_1, door_2, etc. you can lose track pretty quickly, especially if you go back to the map after a while, and might end up having multiple doors opened by the same switch.

What I ended up doing was just running uuidgen and setting that as the targetname for everything to ensure no conflicts, and it works fine. I'm going to end up just automating it if an entity flag is set, but there's probably other ways to go around it too, for instance coming up with a unique identifier based off classname (e.g. door => door_1, door_2, etc.) in order to make it less verbose.

JafiMapping commented 7 months ago

Man, i've been waiting for this for years (but I didn't ask it :) ) . I would like to have a simpler targeting / target process with an increment function bindable to a key . Like it is in gtkRadiant.. Targetname Door_1, you duplicate it -> poof! Door_2 Is it what you mean? Because Trenchbroom do keep track of targets in the entities menu. There is a little scrolling menu at the value column. If you scroll it down, you'll see all targetnames in the map.

kduske commented 7 months ago

There is a similar issue here already: https://github.com/TrenchBroom/TrenchBroom/issues/1167

I'm not convinced that UUIDs are a good solution, as they are not easy to read / understand / memorize. They are also quite long and might not fit into the property editor columns. I think a numbering scheme would be preferable.