Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

BG - Tag system lacking a function to `Get Tag` from entity #6362

Open j-conrad opened 1 year ago

j-conrad commented 1 year ago

Description Writing this as a bug because the lack of this feature severely limits the usefulness of tags.

When using tags on entities, there is no node that allows you to Get a tag. I understand that there would need to be a way to specify by an index or something like that, which is not the most intuitive design pattern. However, in the common use case of using singular tags as a means of identification on entities, the default tag index of 0 would make this relatively simple to use.

For example, I might tag a whole bunch of playing cards by their descriptors: KH, QS, 7C, etc. Then, I might want to draw a card and display its value by getting the tag. In another use case, I could maybe even use 2 tags, so for Queen of Spades, tag 0 would be Q and tag 1 would be S That could be useful in different game contexts like solitaire where suit and value need to be derived for gameplay rules.

In some ways, tags would be a way to make an array.

Currently, the only way to check for a specific tag is to chain a whole lot of Branch nodes, checking each possible tag. This can quickly add up. For example, in a 16-card matching game, you must chain together 8 branches to check all possible card values.

Screenshots Existing tag-related nodes:

image