xenoglyph Posted March 18, 2016 Share Posted March 18, 2016 (edited) Is there a publicly accessible method to get the ID or serial number of an object? Basically looking for a simple function I can use to tell if 2 objects are the same. I have a C# background, but no Java...and not entirely sure how the Lua interfaces with Java. Object equality can be dicey in C# depending on what's overridden, etc. is object == object going to cut it in mods, or do I need some kind of hash or serial? Edited March 18, 2016 by xenoglyph Link to comment Share on other sites More sharing options...
ShuiYin Posted March 18, 2016 Share Posted March 18, 2016 use the getType or getFullType i think for both object and compare them with == Link to comment Share on other sites More sharing options...
xenoglyph Posted March 18, 2016 Author Share Posted March 18, 2016 that will work for 2 different instances of the same item? Link to comment Share on other sites More sharing options...
ShuiYin Posted March 19, 2016 Share Posted March 19, 2016 6 hours ago, xenoglyph said: that will work for 2 different instances of the same item? No it will detect the same sadly. The only way to make it differentiate if you add a modData value to that specific item. So if you are looking for that exact item then check the get modData tag you placed and if return true than its the exact same item Link to comment Share on other sites More sharing options...
xenoglyph Posted March 19, 2016 Author Share Posted March 19, 2016 i'm just now digging in deeper and realizing a bit more how things work. makes sense, some of our saves would probably be 20GB without things the way they are. 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