Quantcast
Channel: [Don't Starve Together] Suggestions and Feedback Latest Topics
Viewing all articles
Browse latest Browse all 7901

Some Mod API QoL additions

$
0
0

Entities that have data on the C-side are hard to get at.  Animation, Tags, etc.

I propose some LUA proxy functions to output the appropriate datums being hidden but are exposed using the ent.entity:GetDebugString().

 

Currently to get a networked entity ID, useful for uniquely identifying an entity as a client, a table of tags, an animation, or an animation frame number you have to use the GetDebugString function.

It's not efficient and could be done more directly without having to dump a blob of data to parse.

 

ent.Network:GetID() -> Returns either the number index or a string holding the unique identifier.  It's not used anywhere else in the code base but it is useful for client mods to keep track of unique entities.  Having it as a number or string doesn't matter.

ent.AnimState:GetAnimation() -> Returns the currently playing animation string if it is, else nil.

ent.AnimState:GetAnimationFrame() -> Returns the currently playing animation's frame number if it is playing an animation, else nil.

ent.entity:GetTags() / ent:GetTags() -> Returns a table of all of the entity's tags that it has, or an empty table if there are none.


Viewing all articles
Browse latest Browse all 7901

Trending Articles