neofax wrote:This is where a actual database would come in handy. However, you could build a pseudo one from others example. Place JSON arrays inside the Table function. So, you could have a Class JSON that holds Starting HP, Ability bonuses, Reflex/Will/Save bonuses and such and then the actual tokens pull their info from these JSON's inside the table. You could use it for powers, clases, races, equipment... basically whatever and you could build one atop another so if a weapon has a power, the one JSON would call the other. It is a write once use anywhere scenario and t should be easily maintainable. So if the developer were to add a new idea (Pool points anyone?) just tack that bit inside the JSON.
Yeah, I looked into that. I have a couple reasons for favoring the implementation I used. The main one is its pretty modular. Each token represents a thing of its type (property set) and it can encapsulate all the logic to return those values (so the properties can change, be made into Jason or put into a table for that matter). I can drop a new version of a token onto the library and replace the old one, I can go back to an older version if the newer one doesn't work, etc.
Tables work OK and probably can do a good bit with them, and maybe someone can come up with a particularly elegant implementation of that too. Of course you can also take the 3rd approach which would be say an 'armors' library token that contains basically a table in Json. There really are a lot of ways to slice it and dice it. The main consideration I have is SPEED. Json eats stack fast and gets way slow. By using straight linear properties on tokens the performance is way better. Maptool these days really runs a lot of macro code VERY slowly unfortunately.
One thing that would make a real difference would be allowing tables to be defined with multiple columns and a built-in API that let you treat them as mini-databases. For that matter if you could drop in a JDBC driver or JDO driver and store tables in a database that would really move things forward a lot in that direction. Then it would be easy to use existing database editing tools to get the data INTO Maptool, which is currently a hairy problem. I have perl code to mine the Compendium for 4e but there is no easy way to get that data into Maptool. It currently requires either manufacturing tokens in perl or brain surgery on a campaign file to insert it into a table (and then its still only got one column per table...).