Jan 15, 2009

RPG scenario generator (1)




















Now for something completely different, spreadsheets ... ;)

A few weeks ago, I had some nostalgia over the good old time of role playing game (rpg) like AD&D and created 2 maps - and a quick scenario.

But I wanted to develop something funnier, a sort of "rpg scenario generator" the idea was simple - using a generic sentence such as "In terrain_type the group will have to scenario_quest fighting against evil_boss and his army of evil_monster ; etc ..."
I would use a random number for each field (terrain_type, scenario_quest, etc ...) and voila ! pressing recalculate would generate a new scenario ... no more lack of Dungeon Master's inspiration.

First I thought using java, perl or python that would read a xml file - then deduce the number of xml file entry, from this number - select a random number and then print the selection - that would do the job ... xml would be great as I would be able to add new lines, and no need to modify the source.

But then (because of my lack of knowledge of perl, java, python ...) and since a spreadsheet such as openoffice Calc, Excel, or google doc would be as good to do the job.
I started a basic sheet using max(), vlookup() and randinbetween(). And it works !!!

Also in the process I found a very nice google doc feature that doesn't exist elsewhere and that is the "filter()" function (see the picture above - for a comparison with the more "standard" vlookup() function).

As you can see on the pictures, it's just a proof of concept - the yellow cell contains the random number (from 1 to max()) of the item's column - the blue cell contains the result - that will be used to build the "one sentence" rpg scenario.

Functions : Function list - Google Docs Help Center

No comments:

Popular Posts