wow that looks really good
I’ve not really done anything with the UI, I’m more interested in the code at the moment. Your UI does bring it to life though
I have a little tidying up to do then I’ll upload the code, I think I will create a GitHub repository for this as it is growing and losing anything would be quite frustrating. You can just as easily copy/paste from GitHub, or grab it as a downloadable .zip file if you are not familiar with Git itself yet.
Might be worth having a nose through the code and then giving me a shout if there’s anything in there which isn’t straight forward etc.
that sounds great. i think this might be a little me of a cosmetic thing i have been trying to figure out how to link a text to the race and class dropdown to let the players know about the race and classes. right now this is just a text with the info pasted in.
Should be a feature / task on your list!
There are a few ways you could handle that, but the one that would make the most sense would be to load in the data as a resource, either when needed, or once and cache it, most likely the former.
This applies to a lot of the magic numbers that we are currently hard-coding also, for example the number of dice to roll for the abilities. Whilst it’s unlikely these would ever change, it makes a lot more sense to read that in from a config file. That way, when it comes to balancing your game, you can make minor tweaks via the config rather than trawling through code.
With the specific item you have raised, I would have perhaps these descriptions for each race and class as resources.
You have two typos in your abilities by the way, “Strenght” and “Consititution” (I keep doing the same with the latter).
i was having a problem with the race ability score mod not adding up so i looked it up in the code and saw the todo Refactor. lol but everything is working and it looks great.
They are only displayed at the moment not added to the base scores. The refactor comment is actually for tidying up the switch statement where it contains the creation of the AbilityBonuses.
Also need to allow for the manual selection of an ability to support the “Your choice” bonuses.
how did you get the race stats to show up? i have been trying to get them to show on my scene.
Update:
-
ability modifiers are now correctly based on the sum of ability score and ability bonus
-
ability modifiers update based on re-roll of ability scores
-
ability modifiers update based on re-selection of character race
-
ability modifiers are now present within the generated character
-
significant refactoring of character creation code
-
completion of comments
Next:
- implement player selection of ability to apply Your Choice ability bonus to for specific character race’s
there is a Pathfinder program called Hero Lab for races that have Your Choice a selection box comes up for them to use
That was pretty much the way I was going to go, I will trigger an additional dropdown to appear on the UI and re-use the code which populates the list of abilities.
The ability bonuses are driven by a list, so it will just be a case of then adding one list item for the selected ability and the value of 2, and call the existing method to update the display.
If the player changes the race to a non Your Choice race, the dropdown will disappear again, and the bonuses updated to reflect the current race choice.
Hoping to have that done this evening.
Current mini board of tasks/features (done very quickly);
Very nice.
Are the skills being driven from code, or hard-coded in the scene for now?
the set up is hard coded but the total, ranks and mods will come from code. Each skill is based off a stat mod. eg perception is a wisdom based skill so if your wisdom has a +2 mod the its total is rank + 2. for ranks the player cant go over their level in ranks. the number of skill points comes from the characters class and their intelligence mod. also i still need to add if the skill is class based if it is then they get a + 3 to the total
Very nice. If you continue to expand on the complexity like this I would strongly suggest investing a little time in creating some code to read in your configuration values, e.g. from XML to objects in the game, this will definitely be beneficially going forwards.
btw - I’ve moved all of our discourse to a new topic, I will close the original one.
lol i just saw that i was confused for a sec
Sorry, just thought it made more sense as our replies were specific to this rather than the previous game idea, also popped it under the Unity RPG category, you mentioned you were taking that course and again it seems appropriate.
its understandable. the new scripts are character, character creator, and character creator UI right
Depends when you took a copy of the code last, those have been updated today. There are also the following;
- Player
- Dice
- StringExtensions
- AbilityBonus
…and of course the scene, project files for Unity.
Might be easier to just download the whole thing as a .zip file and open the project up in Unity, you can have more than one instance of Unity open at once if necessary.