Giter Club home page Giter Club logo

opendnd's Introduction

opendnd

This is the main collection of OpenDnD Tools with generators for persons, dynasties, cities, towns, and more

NPM

Build Status

Installation

You will need node and npm installed. Then run the command:

npm install -g opendnd

Generate from CLI

dnd name    # generate a name for a character or city
dnd dna     # generate DNA for a person with unique traits and physical characteristics
dnd person  # generate a person either a playable character or non
dnd domain  # generate a kingdom, city, town, etc. for the characters to explore
dnd dynasty # generate a dynasty to give the kingdom a rich history

Module Usage

Require opendnd into your file and use either of the opendnd classes.

const opendnd = require('opendnd');
const { Nomina, Genetica, Personae, Dominia, Dynastia } = opendnd;

// generate name
const nomina = new Nomina();
const name = nomina.generate();

// generate DNA
const genetica = new Genetica();
const DNA = genetica.generate();

// generate a person with our name and DNA
// all are optional if we leave it out it will be generated for us
const personae = new Personae();
const person = personae.generate({
  name,
  DNA,
});

// generate a dynasty with our person
const dynastia = new Dynastia();
const dynasty = dynastia.generate({
  progenitor: person,
});

// generate a town where this dynasty is from
const dominia = new Dominia();
const town = dominia.generate({
  size: 'town',
});

Features

Here are the features of Dynastia:

Person Generating

For more on person generating please see the Personae README.

Name Generating

For more on name generating please see the Nomina README.

DNA Generating

For more on DNA generating please see the Genetica README.

Domain (kingdoms, cities, towns, etc.) Generating

For more on domain generating please see the Dominia README.

Dynasty Generating

For more on person dynasty please see the Dynastia README.

Developing

To develop with OpenDnD,

git clone https://github.com/opendnd/opendnd.git
cd opendnd/
npm install

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are welcome!

OpenDnD use the Airbnb javascript style.

Licensing

MIT

opendnd's People

Contributors

drewry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opendnd's Issues

the sample code doesn`t work

running the example code returns this

const name = Nomina.generate();
                    ^

TypeError: Nomina.generate is not a function
    at Object.<anonymous> (/home/advaithm/Desktop/dice/index.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

running dnd dna give this error

internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module '/usr/lib/node_modules/opendnd/node_modules/genetica/lib/Genetica'
Require stack:
- /usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js
- /usr/lib/node_modules/opendnd/bin/dnd-dna-generate
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js:5:18)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js',
    '/usr/lib/node_modules/opendnd/bin/dnd-dna-generate'
  ]
}

dnd dna is broken

using the cli command dnd dan results in the following error

internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module '/usr/lib/node_modules/opendnd/node_modules/genetica/lib/Genetica'
Require stack:
- /usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js
- /usr/lib/node_modules/opendnd/bin/dnd-dna-generate
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js:5:18)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/lib/node_modules/opendnd/node_modules/genetica/lib/program-generate.js',
    '/usr/lib/node_modules/opendnd/bin/dnd-dna-generate'
  ]
}

TypeError in Person creation

Using the latest opendnd I tried to use the Person generator. Below is my input and output

playable
classical
Deno
<blank>
middle
male
human
neutral good
<blank>
fighter
/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/@opendnd/personae/dist/personae.js:37
        const { ageRanges } = race;
                ^

TypeError: Cannot destructure property `ageRanges` of 'undefined' or 'null'.
    at Function.generateAge (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/@opendnd/personae/dist/personae.js:37:31)
    at Personae.validateOpts (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/@opendnd/personae/dist/personae.js:128:33)
    at Personae.generate (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/@opendnd/personae/dist/personae.js:285:30)
    at questions.askMany (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/@opendnd/personae/dist/wizard.js:22:33)
    at pool (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/questions/questions.js:22:4)
    at /Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/questions/questions.js:16:6
    at ReadStream.<anonymous> (/Users/andrewcousineau/.nvm/versions/node/v10.15.3/lib/node_modules/opendnd/node_modules/questions/questions.js:44:5)
    at Object.onceWrapper (events.js:277:13)
    at ReadStream.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)

Opendnd looks sick! Quick question

Hi Drew! I'm working on a discord bot over at tavernbot, and I stumbled across your work on a recent npm search spree. Given that we're both developing under the MIT license, it seems like I'd be clear to 'npm install --save opendnd', but I'd rather ask and make sure.

Is it cool if I use the opendnd module for basically everything, from Nomina to Dominia? Also, will opendnd be around for a while? :)

Quests and Adventure Hooks

Hi there - I've been working here and there on github.com/jakethedev/tavernbot (was jakerunsdnd but that got old lol), and I've got some work done in JS for generating quests and hooks. Would that be useful for the opendnd project? It's stashed in the Dungeonary folder, which is published to npm as a standalone lib

I'm just about in a 'done' state with the bot and it would be cool for some of the late game features like quests to get used in more places, so I figured I'd ask and see if that would be cool before planning on forking and making a PR :) It'll be a bit before it's all done and ready

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.