SphereCommunity
Region.uid - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Region.uid (/Thread-Region-uid)



Region.uid - XuN - 08-20-2013 08:15 AM

Hello, I'm doing some scripts relating to Regions, storing their UIDs on files, and noticed that every Region changes UID after a restart, is there a way it can be fixed? or does it have it's logic to work this way, i can do a workaround asigning tags when i run my script but... if a player always have same uid, why can't also regions?


RE: Region.uid - darksun84 - 08-20-2013 08:33 AM

I think it happens because regions uid aren't "saved", so everytime you restart the server, sphere re-assign the uid to them.


RE: Region.uid - Rattlehead - 08-20-2013 08:39 AM

its becus regions are created and assigned at server startup, unlike items and characters which are stored in save files, regions arent saved. therefore once the server is shutdown the regions cease to exist, when you load the server back up, the regions are made again and placed at their specified locations.

the only regions that are saved and retain their uids are multi regions, and then only becus they have an item associated with them which gets saved, the multi region will use the multi items uid as its region uid

i myself have been heavily scripting region related things and have noticed that tags you assign in the actual areadef will reset to whats been assigned in the areadef if they have been altered in game when you resync but not when u restart the server, tags that you place on a region in game that have not been defined in the areadef will not reset and will retain their information.

so if you are going to use tags on the actual regions keep this in mind.


RE: Region.uid - XuN - 08-20-2013 04:32 PM

What I meant was if could be done to have always the same UID for each region, by adding a OptionFlag or whatever, but thinking more about it I don't really need it since I can use region.defname to identify them and some functions to get to wich I want. Anyways, thanks for help Smile