Giter Site home page Giter Site logo

Comments (6)

kakaroto avatar kakaroto commented on June 25, 2024

Yeah, I'd have no problem with that. Beyond20 was created because one of my players thought D&D Beyond was awesome (I agree) and wanted to use it and our game is on Roll20. Since I couldn't find an existing way to do that, I wrote Beyond20.

If there are other needs out there, I don't see why Beyond20 wouldn't fulfill those needs. I already have in the TODO a plan to have a dice roller so you could roll the dice in the D&D Beyond window directly, in case someone doesn't use Roll20 and just wants to roll dice. If FoundryVTT (which looks awesome btw and I can't wait for it to become stable/usable) has a way to send rolls to it (which seems like it does), then it should be very easy to add support for it.
You're free to give it a try btw (if you can). The D&D Beyond module parses all the info and just sends messages to the background script which itself forwards it to the roll20 script.

For example, for a skill check, this is the message that gets sent :
image

Or a more complicated one, a weapon attack with multiple damages :
image
(note the 'roll' value in the object is just a fallback value if unable to parse/recognize the type of roll it is)

The script in roll20 just receives that message and decides on how to display it, build a string to send and calls postChatMessage which just sets the textarea value and calls submit on the "Send" button (simplified version of the function in roll20.pyj which doesn't handle the 'speaking as'):

def postChatMessage(message, character=None):
    chat = document.getElementById("textchat-input")
    txt = chat.getElementsByTagName("textarea")[0]
    btn = chat.getElementsByTagName("button")[0]

    txt.value = message
    btn.click()

Adding support for FoundryVTT should be very easy, it will all depend on how fancy you want it to look. For the weapon attack for example, it could just do something like this :

   postChatMessage("/roll 1d20 " + request["to-hit"] )
   for i in request.damages.length:
       postChatMessage("/roll " + request["damages"][i] + "\n" + request["damage-types"][i] + " damage")

Most of the code in roll20.pyj is about using the nice templates basically.

It even looks like FoundryVTT has a dice API which could make it even easier to do rolls : http://foundryvtt.com/pages/api/dice.html

Note: I'm giving this information cause I saw your profile says you're a web developer, so I figured you might want to do it yourself. If you don't want to, can't, then I'd be happy to do it myself, it's just going to be a low priority for me right now.

from beyond20.

AnthonyVadala avatar AnthonyVadala commented on June 25, 2024

Unfortunately, I do not have much experience with something like this. But, the information you provided really helped me to understand what is happening behind the scenes!

from beyond20.

kakaroto avatar kakaroto commented on June 25, 2024

Oh my bad, I saw "web designer" in your profile and I thought it was "web developer"! Two very different fields! :D

from beyond20.

AnthonyVadala avatar AnthonyVadala commented on June 25, 2024

Ah, no problem! 👌

from beyond20.

kakaroto avatar kakaroto commented on June 25, 2024

Research note for future implementation :

speakas = game.actors.entities.find(function(actor) { return actor.data.name == "Symrael";})
ChatMessage.create({"content": "Attack : " + await new Roll("1d20 + 5").render() + 
                                     "\nDamage : " + await new Roll("1d8 + 3").render() + 
                                     "Piercing", 
                         user: game.user._id, 
                         speaker: ChatMessage.getSpeaker({actor: speakas}), 
                         whisper: ChatMessage.getWhisperIDs("GM")})

from beyond20.

kakaroto avatar kakaroto commented on June 25, 2024

Support for FVTT is done as of 0.3 (out on firefox, pending review on chrome webstore).
Thanks!

from beyond20.

Related Issues (20)

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.