Jump to content

Adding tags to Nodes


photo

Recommended Posts

One useful feature others engines have is the possibility to create tags on Nodes (or actors or gameobjects)

this is quite useful especially in large scene with several objects that do not necessarily have a component attached, like get all pickups in world, or find the nearest node of type vehicle,  and such.

I know you can use layers but this is limiting, as an object can have several tags while it can belong only to one layer, also I think layers are better suited for scenery composition.

From the engine point of view I believe it is not necessary to alter the Node structure itself just add an external list of pointers to nodes and tags you can then query with FindNodeWithTag and such.

Here's the links to the usage and implementation in Unity and Unreal

thanks

Fred

Link to comment
  • 7 months later...

After seeing this topic in link

https://developer.unigine.com/forum/topic/7033-world-nodes-searchfilter-by-id/?tab=comments#comment-35688

I wanted to create a topic about tags and noticed its already here.

Any progress on this "actor has tag" feature ? Because mutable tag can have benefits to work with and its different than immutable ID.

fred.naar gave examples from other engines if that is okay then that example is what i was thinking https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/ActorHasTag/index.html

Thanks

Link to comment
  • 1 year later...

Добрый день! Можно узнать как у вас обстоят дела по добавлению tag к нодам в движок? Спасибо!

Link to comment
  • 1 year later...
  • 2 weeks later...

You can get functionality similar to tags using node data. It's even more powerful than tags in some ways because it supports XML. 
 

MyNode.SetData("Tag1", $"""
               <facet1>
               	 <item-a val1="" val2="" />
                 <item-b val1="" val2="" />
               </facet1>
               """);
MyNode.SetData("Tag2", $"""
               <facet1>
               	 <item-a val1="" val2="" />
                 <item-b val1="" val2="" />
               </facet1>
               """);               
               
XElement read1 = XElement.Parse(MyNode.GetData("Tag1"));
XElement read2 = XElement.Parse(MyNode.GetData("Tag2"));

 

Link to comment
×
×
  • Create New...