Hi all: I'm trying to figure out the least disruptive way to add a totally new attribute, one just like "name", "weight", and so on, to items. This would potentially apply to many of the items in the database, both equipment, usable and generic items, and have one of several values. A string-type variable would be ideal. I would like to be able to access this value from within scripts, and without disrupting anything else.
It seems like one way to do this without much violence to the server code itself would be to create a pseudo bonus (i.e., there's no real status effect, it just acts as a label), enter that in as part of the item script, and check for the presence or absence of the bonus (https://github.com/rathena/rathena/wiki/Adding-New-Bonuses), maybe just the substring itself.
But at the same time, that seems pretty hacky and not especially intuitive and could come with other disadvantages (and might not work for generic items?).
Alternatively, is there any chance that this could be as simple as adding another nested key-value pair ("INREMsSpecialAttribute") to the YML entry for each item I want to modify? Would there be a supported way to retrieve that value through scripts, or would I need to add my own accessor function? Assuming it's a relevant concern, would doing this risk screwing up code that accesses item properties through arrays instead of by a dictionary and expects to find any values in a certain order?
Not sure if this is more of a "database support" question, a scripting question or a "source" question, but I figured I'll toss it out here first - if different subforum would be more appropriate, please let me know.
Question
INREM
Hi all: I'm trying to figure out the least disruptive way to add a totally new attribute, one just like "name", "weight", and so on, to items. This would potentially apply to many of the items in the database, both equipment, usable and generic items, and have one of several values. A string-type variable would be ideal. I would like to be able to access this value from within scripts, and without disrupting anything else.
It seems like one way to do this without much violence to the server code itself would be to create a pseudo bonus (i.e., there's no real status effect, it just acts as a label), enter that in as part of the item script, and check for the presence or absence of the bonus (https://github.com/rathena/rathena/wiki/Adding-New-Bonuses), maybe just the substring itself.
But at the same time, that seems pretty hacky and not especially intuitive and could come with other disadvantages (and might not work for generic items?).
Alternatively, is there any chance that this could be as simple as adding another nested key-value pair ("INREMsSpecialAttribute") to the YML entry for each item I want to modify? Would there be a supported way to retrieve that value through scripts, or would I need to add my own accessor function? Assuming it's a relevant concern, would doing this risk screwing up code that accesses item properties through arrays instead of by a dictionary and expects to find any values in a certain order?
Any advice would be appreciated. Thanks.
Not sure if this is more of a "database support" question, a scripting question or a "source" question, but I figured I'll toss it out here first - if different subforum would be more appropriate, please let me know.
Edited by INREMLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.