question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Entity Tag System

See original GitHub issue

Summary

This feature introduces a tag system for entities that can be used to make decisions.

Goals

  1. Simple straight forward API for working with tags.
  2. Simple JSON serialization types.
  3. Existing systems (status effects, item condition, etc) should participate in to tag system to allow decision marking.

Use Cases

  1. A breakable that only breaks when hit with a weapon with a specific tag. A boulder is only broken by a mattock. The mattock would be a weapon with the tag rock-breaker.
  2. Triggers only fire when the encroaching entity has a specific tag. A special door only opens if the player is poisoned.
  3. Monster only takes damage from certain tags. A ghost might only be hurt with magical tagged weapons.

Proposed JSON

{
  "id": "MyEntity",
  "tags": "poisoned,broken,unique"
}

Proposed Data Structure

public interface TagCollection {
    void add(String value);
    void add(TagCollection values);
    
    void remove(String value);
    void remove(TagCollection values);
    
    void toggle(String value);
    void toggle(TagCollection values);
    
    void contains(String value);
    void containsAny(TagCollection values);
    void containsAll(TagCollection values);
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joshuaskellycommented, Oct 12, 2020

Why would that be difficult? It would look like:

Trigger t;
Player p;
p.tags.remove(t.tags);

Mock example of a trigger that removes a set of tags

0reactions
evrimoztamurcommented, Oct 12, 2020

Completely forgot about the editor, you’re right!

Is there a way to add an ‘editor representation’? As in, have the internal data structure be an array but be represented as string array (or other complex form) in the editor. Not too involved with editor param pane code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is entity tag (ETag)? | Definition from TechTarget
An entity tag (ETag) is an HTTP header used for Web cache validation and conditional requests from browsers for resources.
Read more >
HTTP ETag - Wikipedia
The ETag or entity tag is part of HTTP, the protocol for the World Wide Web. It is one of several mechanisms that...
Read more >
webDEALER | eTAG | TxDMV.gov
The webDEALER|eTAG system is designed to make processing dealer tags fast and easy for dealerships throughout the state while making temporary tag information ......
Read more >
Tag component - Game Torrahod
A system DistanceToNearestShop where it is able to ensure all entities with Home component, will have an up to date ShopDistance with a...
Read more >
Entity Tags - S&box Wiki
Entities can be tagged with string tags. These tags are networked, so are also available for query on the client. Entity tags are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found