• 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...
 
Back
Top