When you have many scripts to share, and they all read notes from database items, how do you write your scripts so the methods that read the notes don't overwrite each other? With a normal class method, you'd just alias it each time. But if it's a new method that hasn't been defined in the RPG:: classes, there's nothing to alias.
I mean, when you write them in a way that the notes are loaded at the same time as the database is loaded, and save the data into variables, not so that they're looked at every time you want to check if an item has particular contents in its notes. Like a read_notes method that's called on each object after the $data_* classes are loaded.
I'm thinking of making a script that just defines the method for each class but leaves it empty, and calls them when the database is loaded. Then each script would alias the method. But that means when scripts are shared, the user would need to grab both - the script that they WANT, plus the one that defines the read_notes method.
Or do you just not do it that way, and have every script scan through the notes when and where it wants to know if the specified tag exists?
I mean, when you write them in a way that the notes are loaded at the same time as the database is loaded, and save the data into variables, not so that they're looked at every time you want to check if an item has particular contents in its notes. Like a read_notes method that's called on each object after the $data_* classes are loaded.
I'm thinking of making a script that just defines the method for each class but leaves it empty, and calls them when the database is loaded. Then each script would alias the method. But that means when scripts are shared, the user would need to grab both - the script that they WANT, plus the one that defines the read_notes method.
Or do you just not do it that way, and have every script scan through the notes when and where it wants to know if the specified tag exists?
Last edited by a moderator:
