This is perhaps an odd way to go about things, but I am creating several town name generators for my D&D game (so each race/culture has a unique naming style) and I've run into a bit of a problem. I Think I need to be able to combine tables for some of the deck picks. Let me give a bit of a sample of the tables to better illustrate.
Ok so on the following tables, as they are, it's quite simple. What I want is for the first pick to be from either start or middle. I could just have an interim table that chooses from either table, but that's going to throw the odds off, and I am unsure how well that would work with deckpicks. I could just have start repeat the contents of middle but that is bad programming technique (repetition is bad for maintenance) and would mess up the deck picks, giving the possibility of for example pigeon pigeon city. Or I could put them together and just use the combined table twice, but that gives me the possibility of for example one two city.
Is there any way I could, to extend the deck pick concept, put the two decks together, pick a card, then separate out all the cards from the first deck and then just draw from the remaining cards in the second deck?
Or alternatively is their a way to automatically weight a table with the sizes of a subtable? I realize I could do this manually, but it just feels ugly and hackish and bad programming practice.
I could also maybe cobble together some horrible kludge with subtable picks... maybe, it'd be ugly and hackish but at least not have things hardcoded that shouldn't be.
table: examplecity
[!start] [!middle] [!end]
table: start
one
two
red
blue
table: middle
outlaw
flea
pigeon
last
dry
vale
fish
table: end
city
town
gorge
Comments
table: start
one
two
red
blue
7 [!middle]
Except without the issues that would have if I were to use start multiple times(I shouldn't be so that shouldn't be an issue) and without manually having to change the weight if I add entries to middle. If you happen to decide to do any updates to Inspiration Pad I would love it if you could something to the effect of ![start & middle] that would do this. Though admittedly this may just be due to programmer background leading me to try and do far more complicated things with this than it is intended for.
table: intermediate
4 [!start]
7 [!middle]
I suppose this is the route I'll take, I'm just not a fan of the need to update the weights as the tables develop. I think at this point its just a matter of representation of individual words in the final results, but just in case here are a few good/bad examples.
good:
two fish town (one result from each table)
dry pigeon gorge (different results from middle table)
bad:
pigeon pigeon city (same words twice)
one two city (two results from start)
Sorry for all the unclear explanations, but between aspergers and having had my head wrapped around 7 or so coding projects in 5 different languages, I haven't been so great at talking to humans lately (sidenote: dear gods why vbscript in fractal mapper)
Another option is to add more than two items on the main table:
1) Three tables, "start", "middle", and "end"
2) A town name always consists of three different words.
3) The source tables for those words can only be [start or middle], [middle], [middle or end], in that order.
4) Don't require hard-coding of anything
It took some experimentation, but I think I've got it. Maybe this code will work for you.