The RPG module is nearing an official 'Alpha' release. There are still a few things to flesh out, and I'll go over them in some detail soon. Here are some notes for fleshing out Attributes, which will be required before creating Actions and Modifiers. After those three sections of code have been finished, we should be ready to make some test game platforms!
Attributes
Attributes are defined by types, and may be overridden by descendant types. Objects will inherit the attributes of all its parent types. The default value of an attribute will be set by the type.
Still TODO for Attributes
- define simple attribute classes: integer, string (which may use filters). These will be defined by a module hook, for easy extensibility.
- create table to store attribute classes:
- class (corresponding to class of attribute -- integer/string/etc)
- name (such as strength, color, etc.)
- other columns? look at cck field widgets. not sure if things like required are appropriate here, but we can work that out.
- when a new attribute type is defined, a new table, with the name of ('rpg_type_attribute_' . $class), will be dynamically created to store:
- type (corresponding to rpg type)
- default value (will be assigned to objects of this type)
- other columns defined by the attribute class (such as min, max, filter, etc.) -- these are set by an array in the attribute class hook
- dynamically create table to store attribute values for objects, with the name of ('rpg_attribute_' . $class)
- rid (corresponding to rpg object id)
- value (given initial value of type's default value)
- any other columns required by the attribute class
- finish form to create attributes for rpg types. include a dropdown of already defined types, so the attributes may be overridden or added to another type
- on the rpg type attributes admin screen, show a table of all defined attributes, including a section with inherited types (which may be overridden simply by adding that attribute manually from a drop down on the add attribute screen)
- rewrite rpg_get/set to grab attribute values (exclusively? name will be the only required 'attribute', the rest defined through this system)
- on the rpg object add/edit screen, add form elements for all defined & inherited attributes, filling in the default values accordingly. similar to cck fields, the elements are defined by the appropriate attribute class hooks.
- for testing purposes, we'll also just list all attribute values on the object viewing screen. later, we'll have theme functions that will be able to theme them the way needed (leaving some attributes hidden if needed). actually, might be nice, following cck, to also have admin drop-downs to build an object view, as well as allowing theme overriding.
This article is cross-posted at DrupalRPG.org.
Aaron Winborn
DrupalRPG.org -- Home of the RPG Module for Drupal

Comments
progress so far
first two items are done, and an admin form for adding attributes started in the most recent commit.
Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic
...and now
it also creates the table for storing type/attribute data, and loads type-defined attributes on type loading. however, the current release will quickly be deprecated, because there's still more to go -- defining the object/attribute look-up tables, and inheritance of attributes.
at this point, if you're following along, i don't plan to create updates, so if you're running a test module on your server, you'll need to wipe out any created tables fresh. sorry about that. i guess that as we get closer to an alpha release (and definitely after that time), i'll need to start including updates in the install file.
if you want to do a test run without installing it yourself, you can go to Drupal RPG, create a user account, and shoot me a message that you'd like rpg admin access. for now, anyone who wants gets rpg admin privs. i'll remove or downgrade that about the time of alpha release, and/or if/when it supports php evals.
Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic
just about done
attributes are nearly complete. just modified the admin screen to list inherited/defined attributes, and you can now override attributes. (still need to fill in fields and disable certain fields in that case.)
next will be to dynamically create the object/attribute tables and tie in the rpg_get/set calls to the new attribute system.
Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic
status of attributes for rpg
slow but steady. wasn't able to work on it last week because of new site launches at work.
tonight, i started the attribute edit form. also cleaned up some of the admin screens, and menus. plan to work more tomorrow night.
Aaron Winborn
DrupalRPG.org -- Home of the RPG Module for Drupal
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic