.:: Alex Erne :: PHP/MySQL & Unity3D/C# projects ::.
Recent news
Categories
Like me on Facebook
* advertisement *
  04 June 2016 - Languages fully implemented :: Posted in d20 project

After having created all code for the talents, I figured that with the Smart Hero's Linguest skill I might as well work on the language implementation first, and as written earlier this week, I decided that languages would get their own class because of a fundamental difference with them in d20 Modern compared to d20 Fantasy (Dungeons & Dragons 3.5).

Entering the code for about the 50 languages named in the d20 Modern system was easy enough after I figured out how to get this working. Coding the use of the languages in the demo I'm making was a bit harder though. While coding the demo I also found out that there were certain calls to the main d20project plugin that I still had to make.

 photo d20project 20160604_zpsyjqvji2k.png

One of the most challenging issues at hand was the use of a prefab that uses 2 dropdown UI menu items. While it might look easy from the user's poitn of view, the Unity engine has a terrible flaw here that resets the 'Label' object to that name back again when you've made it a prefab. And while not overly important, the 'Label' field is used to show the 1st entry of the options list when the prefab is loaded.
The easy way around this would be by making 2 small pieces of code that would control the 2 different dropdown UI menu items, but that would kinda screw the interaction with the 2 toggle UI items and 2 UI buttons I also have in this prefab. So instead I've had to be very creative to work around this issue and as you can see (in the above picture) I managed to get it working.

An other technical issue I bumped into was that the dropdown UI menu options are converted to the string type, while the languages values are stored in an enum type. Though this might not sound too significant, it did give me a lot of problems when coding the OK button, where the language selected would be added. Unlike when adding an option from a single menu dropdown, where you can simply point to the field in the list with [dropdownmenu.value], using 2 dropdown menus where one selection (language groups) changes the list of the other (languages itself), this direct approach is not available. Instead I had to compare the string type of the current selected language with one the values in the enum type. And eventhough C# is very flexible with casting one value to an other, it is impossible to cast a string type to an enum type As a final option I had to write an extension class that's much like the ToString() one to convert the string holding the selected language into an enum type from the language list.

Now "all there's left" to code for the d20 project is the implementation of adding talents for the basic hero classes, of which I have already done most of the work and a simple popup like the one used for languages is required to get it working (and test the code immediately). After that (when my test character hits an even level) add the (bonus) feats in a similar way, including the special feats (not actual feats, but pretty much like them) for the advanced hero classes. When those 2 are coded, a couple of small tihngs need to be fixed/coded in the usage of the core rules, like reputation, action points and wealth. After that only the 'big thing' to implement is of the hero's gear and equiment of it remains, which will still need some work I fear...


Post A Comment!
Your comment:
Title

Your name

Image text
* advertisement *
* advertisement *

This website is Copyright © 2009 - 2016 Alex Erné
PHP/MySQL coding by Alex Erné Copyright © 2009 - 2016 Alex Erné
...all rights reserved...

AE games™ and the AE games logo are Trademarks owned by Alex Erné
TetraGems™, Burst-a-Bubble™ and the Burst-a-Bubble logo are Trademarks owned by Alex Erné