#Title Inline rolls from text editor

1 messages ยท Page 1 of 1 (latest)

lunar nacelle
#

I think I can module this

lunar nacelle
#

Only really need to pass the flavor through Roll.replaceFormulaData as well, which _onClickInlineRoll does not do currently

#

though in this particular instance, the name of the actor would be the speaker on the chat message

twin stone
#

That would be awesome! Let me know if I can help

lunar nacelle
#

I already have it working. I am just trying to imagine a use case other than what you mentioned

#

which I already mentioned is slightly pointless because the speaker on the message is set to actor.name already

twin stone
#

So it titles it "Gamemaster" in the chat but I want it to use the name of the actor who's sheet it was on, in the same way that if the attack roll has "+ @bab" it pulls in it's stat for bab

#

Melee [[/r 1d20+5 #@actor.name makes a Halbred Attack]] halberd +5

#

apologies if I described anything incorrectly ๐Ÿ™‚

lunar nacelle
#

the click event does not know the app it comes from. It uses the selected token's information

twin stone
#

[[/r 1d20+5 +@bab]] properly pulls in the actor's 4 bab, with no token selected

#

token isn't even spawned, doing this from the character sheet opened from the "Actors Directory"

lunar nacelle
#

nevermind, you are right. let me fiddle with this for a sec

twin stone
#

thanks! Appreciate the interest

lunar nacelle
#

question, would you want item data in any case?

twin stone
#

not that I can think of for my uses cases no

lunar nacelle
#

I'll throw that in there anyway

twin stone
#

that's awesome

lunar nacelle
#

took it a step further with a bit that I had in there for someone else's request

twin stone
#

looks solid

lunar nacelle
twin stone
#

Sorry do I just unzip and toss that into \FoundryVTT\Data\modules ? Tried that and its not showing up for me. I've never installed a module manually before

lunar nacelle
#

yeah, you have to return to the setup page and relaunch the world after you do that with a new module though

twin stone
#

oh I found it. I think because I haven't updated foundry itself in a while

#

I was planning on updating though, so might as well do that now

lunar nacelle
#

core version shouldnt matter, I just put in in version 9 from habit

twin stone
#

oh okay, I;ll try updating that file then. I'm only on 0.8.9

lunar nacelle
#

version 9 is pretty dope though

twin stone
#

hmm it showed up, I enabled it, and I still got the same result. Maybe I do need to be on version 9?

lunar nacelle
#

do you have libwrapper installed?

#

I didn't list it as a dependency, but it is necessary to overwrite the function

twin stone
#

oh yeah, but not enabled. Will enable and try again

#
[Detected 2 packages: inline-adv-dis-crit, lib-wrapper]
    at HTMLAnchorElement.:gift:TextEditor._onClickInlineRoll#inline-adv-dis-crit (module.js:39)
    at B.:gift:call_wrapper [as call_wrapper] (libWrapper-wrapper.js:551)
    at HTMLAnchorElement.:gift:TextEditor._onClickInlineRoll#0 (libWrapper-wrapper.js:164)
    at HTMLBodyElement.dispatch (jquery.min.js:2)
    at HTMLBodyElement.v.handle (jquery.min.js:2)```
lunar nacelle
#

what the heck

twin stone
#

I'm happy to upgrade to version 9 if you want ๐Ÿ˜†

lunar nacelle
#

I didn't think that was a v9 thing, but you can try it

twin stone
#

updated lib wrapper as well, and one of those two updated fixed it!

cinder bolt
#

BTW, supporting inline rolls in text editors in actor/item sheets is up to game systems/modules to do. Foundry doesn't enforce inline roll support on them.

Or rather, Foundry can't enforce the product of said thing will have inline rolls parsed. The editor itself needs to display them unprocessed.

lunar nacelle
#

TextEditor is not enforced on character sheets as far as I know, but inline rolls are parsed by TextEditor by Foundy

cinder bolt
#

Yes, though only if inline roll conversion is enabled with a parameter.