Jump to content

Is there a simple way to preserve prefab tags between server resets?


Recommended Posts

Whenever a server resets, tags I added to distinguish certain objects built using the mod from otherwise-identical naturally-spawning equivalents are removed. I know I can probably just iterate through every single entity with that tag and save the exact position in a file, then load said positions upon server restart and tag any entity within a very, very small radius of said positions. However, that's complicated, so I was wondering if there's a simple, easy way to permanently tag a prefab so that it stays tagged even after the server restarts?

Link to comment
Share on other sites

1 hour ago, Argonwolf said:

so I was wondering if there's a simple, easy way to permanently tag a prefab so that it stays tagged even after the server restarts?

Nope.

You'd have to do it through saving and loading.

 

Edited by penguin0616
  • Like 2
Link to comment
Share on other sites

18 hours ago, penguin0616 said:

Nope.

You'd have to do it through saving and loading.

 

Actually i think I'll leave this here for posterity, because I found another way to do it.

Since virtually every naturally-spawned object in the game always exists at a y-coordinate of 0, I can identify mod objects by encoding their "tags" in their y-coordinate values. Whenever the mod spawns an object, it places it at an infinitesimally higher y coordinate than most (I eventually settled on 0.008 after encountering some strange aberrations in the saving/loading of objects' y-coordinate). Not enough to even visually register, but enough to detect in code. Using that I can easily "mark" objects as mod-spawned by their altitude! Thought I'd post this solution on the off chance that anybody else has a similar problem.

Edited by Argonwolf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...