Argonwolf Posted January 9, 2021 Share Posted January 9, 2021 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 More sharing options...
penguin0616 Posted January 9, 2021 Share Posted January 9, 2021 (edited) 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 January 9, 2021 by penguin0616 2 Link to comment Share on other sites More sharing options...
Argonwolf Posted January 9, 2021 Author Share Posted January 9, 2021 Well that sucks. Thank you. Link to comment Share on other sites More sharing options...
Argonwolf Posted January 9, 2021 Author Share Posted January 9, 2021 (edited) 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 January 9, 2021 by Argonwolf Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now