Strolenati Council - The Invasion of 5.0 · Legacy archive
Coder Challenge - Random Generator
-
Coder Challenge - Random Generator
#1A cool idea that Johnn was sent.
Javascript?
PHP + Database? (could we use the list of items for other stuff eventually?)
If there's been something in a recent article about this I apologize, as I get quite a bit of email from you (by choice!) but don't get to scan it all as carefully as I'd like. Anyway, here's my question:
What is a recommended tool or resource to determine what magical items (of any type or power) might be available for sale in a given town or city? I would be willing to spend a modest amount of cash for a good tool (preferably a PDF of some sort with tables), or if someone had a good generator out there that focuses on this, I'd like to know about it.
I spent nearly three hours with my players last game session generating availability of items on the fly in a modest sized town in which they've based their operations for the last 2 months or so in game time. I'm playing D&D 3.5, and my sole resource for this exercise was the DMG 3.5. I've since combed my collection of old Dragon magazines, and some other stuff I have, and while there are tons of general advice on city design, no one seems to address this specific issue with a handy set of tables. It was fun for everyone (especially the grimaces I was able to produce due to 'adventurers-with-gold' inflation), but I'd have prefered to spend that time moving the game forward.
I would like, ideally, to have some tables I could put into a spreadsheet, enter some parameters, and produce a list of potions, scrolls, weapons and armor, and rods staff and wands, based on the town's gold value, how long the adventurers have been spending money there, town disposition, and maybe a couple of other factors. But barring that, if a basic list could be produced I could pick and choose as needed according to my instincts about the mood of the town.
Thanks for any advice and or references.
Maybe we need to relook at manfred's generators too. Can we reuse retool them together into something?
http://strolen.com/random_generators -
Re: Coder Challenge - Random Generator
#2Most certainly code plus database. I'm frightfully allergic to data in code.
I harp on python quite a bit, and here is one case where its built ins shine.
For example, given a set containing swords,
Print random.choice(swords)
Will select a sword from the set at random. Not sure how you could make it easier :)
Php equivilent http://php.net/manual/en/function.array-rand.php
Or javascript
function randomChoice(list) {
return list[Math.floor(Math.random()*list.length)];
}
Probably javascript with database for generating the lists would be the way do go. Not hardcoded values. Never.
Keep in mind this person was looking for system specific values.
-
Re: Coder Challenge - Random Generator
#3Awesome.
One of the main issues, for me at least, is getting the initial list together. Might need a new table to hold it all too. Could mine manfred's generators (all that is embedded code and data) and see if we can extract and restore it in a different format?
id | type_content_id | power (low,med,high) | content_desc
id_type_content | type_content
I wonder if the "idea" database could be effectively used for something like this....?
http://strolen.com/ideas/view
Maybe that is the perfect engine for the random encounter type engine too. Will have to think how we can harness these pieces that are scattered around. Do we need better organization or just better utilize what we have.... -
Re: Coder Challenge - Random Generator
#4I would be happy to prepare such lists, and yes, mining Manfreds existing generators would be easy.
Just take the code, a few search/replaces to convert into a sql script and run it. Easy - I do stuff like this regularly in my day job.
We could have multiple tables to store each list type, or even have a single big lookup table with a Type column, index number, and text*. Each generator would have an associated view on this big table so that they would only see the index number and the text entries. It would also make more complex generators possible such as recursive generators. The single table approach means less DDL and less joins, though it does go against normalizing databases.
This table should have an editor page accessible to high level strolenites, admins and other trusted people with a propensity towards generator creation. Using the DB tool would work too, but a lightweight page would be good, and I think the entries should be treated like regular subs supporting links, etc.
This is why I've been wanting things like individual elements in 30's to have anchor tags to facilitate such extractions, and for scrolls/stubs to be usable as invisible sections within a sub - so that those passages could be tagged and used in generators.
And I'd need to look at the idea's table structure - if we can easily group rows, then it would do.
-
Re: Coder Challenge - Random Generator
#5We need to tag the author with each entry if possible so add an "author_id" column for sure. -
Re: Coder Challenge - Random Generator
#6That's a good idea - people could add entries on the fly to generators that way.
We could convert scroll entries from such things as 101+ islands into a generator if we did things right.
-
Re: Coder Challenge - Random Generator
#7Yes! -
Re: Coder Challenge - Random Generator
#8Soon...Soon this will be a reality... -
Re: Coder Challenge - Random Generator
#9
Strolenati Council - The Invasion of 5.0 · All categories · Guildhall