• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved How to check if "storageID" is free

Ochman

Veteran OT User
Joined
Feb 27, 2016
Messages
350
Solutions
5
Reaction score
251
Hello,
I'm coding more and more custom content, and this one gives me a trouble.
How do I know if any different quest/talkaction/whatever uses storageID I'm about to use?

I do not mean how to check if player has storageID. This I know.
I'm asking what's your suggestion on how to prevent overwriting storage ID by the different quest etc. If I can use it freely, or if I should change my storageID number.

Also,
I came to a "max" storageID which is 65535 in my scenario.
I can extend that. But would it be safe to do? I couldn't find any disturbing dependencies, but I'd rather ask than change it freely.
 
Solution
you have to keep track of it yourself
best way i can think of to check all that are used is to use a program to check all your server files with the words storageValue and look at each one for the key
another option would be to use debug.sethook and write to a file with the storage key each time setStorageValue gets called, but that requires you to run every quest/talkaction/whatever file and make it give the storage value at least once so it writes to the file
you have to keep track of it yourself
best way i can think of to check all that are used is to use a program to check all your server files with the words storageValue and look at each one for the key
another option would be to use debug.sethook and write to a file with the storage key each time setStorageValue gets called, but that requires you to run every quest/talkaction/whatever file and make it give the storage value at least once so it writes to the file
 
Solution
Not the answer that makes me happy, but answer that I expected
I wrote a python scripts that regexp me all "setStorageValues".
Few manual work needed, but suddenly I got all used storage_ids...
 
Not the answer that makes me happy, but answer that I expected
I wrote a python scripts that regexp me all "setStorageValues".
Few manual work needed, but suddenly I got all used storage_ids...
hey mate, i know its a bit late and u wont probably have bit but right now im going thru the same rabbit whole, would you mind sharing the list of all used storages ids ?
 
hey mate, i know its a bit late and u wont probably have bit but right now im going thru the same rabbit whole, would you mind sharing the list of all used storages ids ?
I don't think a 6 year old server with probably a bunch of custom content is going to help you....

Every server's storage id pool is going to be different (unless its a default). If done well, the storages file in data/lib/miscellaneous is the bulk, and then make sure you factor in any source ranges, and any Lua systems that use ranges (base storage id and incrementations).
 
Last edited:
coming to this thread made me realize making storages for ots datapacks should follow same criteria so it will make it easier for us to downgrade/upgrade e.g make storages X reserved from to and then all quests of those storages to match every rl map we have since people like to host variationts of ot servers this will help everyone and make it smoother in the host side. as far as we can tell its more than just the map/server that brings players but the content server has to offer
 
I don't think a 6 year old server with probably a bunch of custom content is going to help you....

Every server's storage id pool is going to be different (unless its a default). If done well, the storages file in data/lib/miscellaneous is the bulk, and then make sure you factor in any source ranges, and any Lua systems that use ranges (base storage id and incrementations).
yeah thats what i thought as well, do you know if i can use any random number or it has to be one available? i was able to find a couple of "empty" storages id but im not sure if i should use them or not, ill trying to look for tutorials on how to properly create a quest but i a havnt been lucky enought, with the things i have tried it gives me an error saying it couldnt index the quest or something like that so maybe im missing something somwhere else.
 
yeah thats what i thought as well, do you know if i can use any random number or it has to be one available? i was able to find a couple of "empty" storages id but im not sure if i should use them or not, ill trying to look for tutorials on how to properly create a quest but i a havnt been lucky enought, with the things i have tried it gives me an error saying it couldnt index the quest or something like that so maybe im missing something somwhere else.
basically every number from 2000-65000 is available.

I typically start at 45001 and start counting up from there, since nobody else uses that range except me. lol
 
Back
Top