- Home /
Simplest way for some stat presets for RPG classes?
So let's say that the game has three classic RPG character classes like Figher,Archer and Wizard. Which is the easiest way to make some stat presets for them? And by stat presets i mean for example entering the character creation screen and to have 3 GUI Buttons and each one of them creates a character with a certain preset of stats. For example:
Figher:
Strength:12 Vitality:10 Dexterity:9 Wisdom:8
Healer:
Strength:8 Vitality:9 Dexterity:8 Wisdom:12
Archer:
Strength:9 Vitality:10 Dexterity:12 Wisdom:10
I read somewhere about a simple way which was to make a txt file outside of Unity with the stats you want and then import it into Unity using the TextAsset or something like that.
I might be misunderstanding the question, but wouldn't the usage of a simple int array for data storage be enough? If you want to save and load the stats to and from somewhere, i can write an answer with some exemplary code.
To be honest i don't really know exactly what's that you are talking about but from the name of it.."data storage" i think it might be what i am looking for. Well, imagine that you enter a game and you press the "Create Character" button and then the classes show up and you choose the one you want to play with. But the only thing you can edit at that time is the name of the character. The stats are different presets for each class. The only time you will be able to spend some "attribute points" will be when you level up and you will have let's say 5 of them to spend. Like the Diablo series. Diablo 1 and 2 you know :)
Answer by BerggreenDK · Mar 12, 2013 at 11:26 AM
I usually create a "class" with properties/variables.
You could easily make a "class Character" as stated.
Just add a private variable for each property of the class + a variable to control what type this character is, or you will need a character class pr. type.
Regarding presets, if these arent supposed to be edited ever, you can just build a function that based on a parametre, initializes the variables on your class instance.
Your answer
Follow this Question
Related Questions
How do you make RPG class stat presets? 1 Answer
Creation of RPG Class Stat Presets? 1 Answer
Character Attributes Question 1 Answer
Multiple Cars not working 1 Answer
Question about classes C# 1 Answer