Hey all, for the previous few days ive been theorycrafting an RPG system for a game i want to make. I don’t actually have any of this written out in code yet, so here is my issue. I want to create a database of different “Skills” the player can use on their turn, such as healing powers, magic attacks, etc. And i thought of it working something along these lines:
-The player selects the skill to use and its target
-This would search the database for the skill in question and retrieve information on it, such as base damage, element, flavor text etc.
-All of this information would then be fed to a DamageCalc function, which would handle the rest of the calculations from there.
The problem comes in that second step. I can’t come up with a decent way to create a database. I thought of creating a class called “Skill” containing info about the skill in the form of variables and then making a Database script with an array of the skill class, and customizing each of those from within the editor. But i realized from making an array of custom classes a while ago that this would not work because while you can indeed make an array of custom classes in your script, you can not, to my knowledge, edit the contents of each individual class within the array, simply which classes are in the array.
as seen here: an array of a custom class named unit which contains several variables involving names, stats, etc. it does not allow for customization of each object within the array, but rather expects slots to be filled with pre-made objects of that class. Placing the script which makes the unit itself allows for customization, but an array will not. I don’t want to make an individual script inheriting from the skill class for each individual skill, because that would be cumbersome, and i am certain there is a better way to do this.