# Posting tools for RPGs - Dogs in the Vineyard NPC generator

I just wrote a tool to roll up NPCs for Dogs in the Vineyard in python.

import random
import math

def d(sides):
return random.randint(0,sides-1)

def ndx (n, sides):
for i in range(n):
rolls.append(d(sides))
return rolls

def getStats():
dx = d(10)
statBlock = [[4,3,2,2],[4,3,3,2],[4,4,3,2],[5,4,3,2],[5,5,3,2],[4,4,4,3],[5,4,4,3],[5,5,4,3],[6,5,4,3],[6,5,5,4]]
random.shuffle(statBlock[dx])
return statBlock[dx]

def getTraits():
out = []
traitBlock = ['2d4','1d4','1d6','1d8','1d10','2d6','2d8','2d10']
for i in range(4):
out.append(traitBlock[d(8)])
return out

def getRelns():
out = []
relnBlock = ['2d4','1d4','1d6','1d8','1d10','2d6','2d8','2d10','3d6','3d8']
for i in range(2):
out.append(relnBlock[d(10)])
return out

def freeDice():
out = []
freedice = ['2d4','2d6','4d6','1d8','2d8','1d10']
for i in range(3):
out.append(freedice[d(6)])
return out

def getNPC():
stats = []
for i in range(6):
stats.append(getStats())

fd= "Free dice: {0}, {1}, {2}"
print fd.format(*freeDice())

proto = '''

Name: ______________________
Stats
Acuity: {0}d6\tBody: {1}d6
Heart: {2}d6\tWill: {3}d6
Traits
___________ {4}\t___________ {5}
___________ {6}\t___________ {7}
Relationships
Blood 1d6
___________ {8}
___________ {9}

'''

for npc in stats:
npc.extend(getTraits())
npc.extend(getRelns())
print proto.format(*npc)

traits = getTraits()
reln = getRelns()
getNPC()



Would it be appropriate to post this as part of a "Software tools for DitV" question?

Yeah, I have to say that if someone legitimately asks a question about software tools for DitV and you happened to post that it would be OK, but asking the question yourself and posting it or posting it in your question comes across as self-promotion.

• Yeah, that's why I really didn't want to charge in, because it's doubleplus sketchy. That's also why I moved my answer in the minion question to my question. – Brian Ballsun-Stanton Oct 24 '10 at 0:09

No. You aren't answering a question you are offering a product and this is not the right place. This is a Q&A site, which makes us very different than a forum or blog.

• Fair enough. Though it feels like somehow this could be an answer to a question... just... would be a tricky one. – Brian Ballsun-Stanton Oct 24 '10 at 0:10

There's another factor to consider: We don't want to encourage people to make up materials to answer questions, we want to encourage people to give authoritative answers. Any forum is a good place to work with people to create stuff whole-cloth—StackExchange aims to be something different than any other forum. To accomplish that we have to avoid rewarding answers (and questions) that invite discussion, creation, debate, etc., which are more suited to forums and don't leverage/highlight what makes this place special.

• Hrmmm... The trick is that in context of the question this /is/ authoritative, because the bloody npc gen on his site is broken and this is taken from the book. But yeah, very grey area. – Brian Ballsun-Stanton Oct 24 '10 at 0:10
• Well, the context of "Vincent Baker's own NPC generator is broken. Here's one that works." might make the difference. Hm. – SevenSidedDie Oct 24 '10 at 18:14
• Hrm. I don't agree that making up material is bad. We have a reputation system to handle that. Sometimes made-up material answers the question better than any "authoritative" material. Why stifle that? – Adam Dray Nov 11 '10 at 16:52
• Put another way, don't people in the software StackExchanges answer questions with code snippets that they made up? – Adam Dray Nov 11 '10 at 16:53
• @Adam: It's true, but in that case they're answer a question of "how to do this?" in the lingua franca of algorithms, which is actual or pseudo-code. This is more like, "Is there a wiki for storing your campaigns" and someone answering with, "Yes, I just made one in response to your question. Here's the link." I mean, it answers the question, but it's sitting on an interesting borderline. I'm leaning one way, but considering the zero-vote, my tentative position is clearly not the consensus. ;) – SevenSidedDie Nov 11 '10 at 22:08
• @Adam Hell, at this point I think the only way to answer this is to test it out by posting it on the question and seeing how the votes go, and whether other answers like it crop up and end up being problematic. Then we'll know either way. – SevenSidedDie Nov 11 '10 at 22:11