Handle "hardcoded" attributes nicely
Posted: 13 May 2013, 18:46
The server currently expects some hardcoded ids for attributes (like HP for example). However the attribute itself is freely defineable on the xml side.
This could lead to bad setups, like the HP attribute in wrong scopes or maybe missing.
Another problem is that attributes like HP are only read by their base values and never by their modifiers (or at least supposed to be handeled this way). However you can define modifiers for them in the attributes.xml.
My proposal would be this:
Regards,
Ablu
This could lead to bad setups, like the HP attribute in wrong scopes or maybe missing.
Another problem is that attributes like HP are only read by their base values and never by their modifiers (or at least supposed to be handeled this way). However you can define modifiers for them in the attributes.xml.
My proposal would be this:
- add some info tag to the attributes which take a named string like "hp" or "maxhp".
- make the server reading those tags and mapping the ids of those attributes to the internal ids (ATTR_HP)
- write a function which checks the status of the attributes after loading. This would check for all required tags being available in their correct scopes for example.
Regards,
Ablu