Sunday, 11 December 2011

Evolution of the code #9

Character creation window
This has to be the most annoying feature ive worked on as of yet - because im trying to do it as optimized / simple as possible and with no unnecessary code. This week ive got it semi-functional (as in the primary stats only can be manipulated so far). 


The problem i had was how to link the controls so that they would change the character statistics. Since all of the player statistics are stored into a dictionary (and dictionaries do not support indexes) I had to make use of the control names. So right now - to make a control manipulate a certain statistic (e.g. strength) you have to set the control name to that.

The upside to this system? 
Users who want to mod the game have complete control over the player statistics. For example you can replace or remove luck, intelligence or any other as well as add new statistics. Its just the simple process of adding the new statistic to the default player script file, then add a control using that statistic on the new game window and set it's name to manipulate it. After, make use of it using the lua script files.

I am sure this is better than using indexes or any other method, because the order of the statistics in the default script file or the order of the controls to manipulate them is irrelevant.

If there are any downsides im sure to find them soon. I really hope its done by next week as I want to continue work on other features.

No comments:

Post a Comment