Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

API - Add Player to "In Player's Journals"

April 09 (3 years ago)

Does anyone happen to know if there is a script around that allows you to:

(1) Select one or more tokens

(2) Run a macro to add a Player to the "In Player's Journals" entry for the character sheets linked to those tokens

- this could also be "none"


I know TokenMod lets you set the "Controlled By" but I don't believe it does Journals.


Does anyone have any ideas?


April 10 (3 years ago)

Edited April 10 (3 years ago)
Oosh
Sheet Author
API Scripter

Here's a modified tokenMod that adds inplayerjournals functionality. It hooks straight into Aaron's controlledby functionality, so syntax is identical. Example:

!token-mod --set inplayerjournals|+oosh controlledby|-oosh

... remove Oosh's control of character, but show in Oosh's journal.


Important to note that journal visibility is a property of Characters and not Tokens. This setting will do nothing to a token with no linked character sheet.


Installing:

Make sure you click the "raw" button before doing a Ctrl-A select-all to copy the text - I don't trust Pastebin's prettified text.

Oh, and you probably want to disabled the one-click version while you're using the modified one.

Aaron is pretty busy these days, but will probably get around to adding it properly at some point :)


Modded:
    - line 132 - add key for 'inplayerjournals'

    - lines 3346 => 3351 - compile current 'inplayerjournals' array while doing 'controlledby' array

    - lines 3377 => 3393 - modified 'controlledby' path to accommodate inplayerjournals

April 10 (3 years ago)

That works perfectly, thank you Oosh!

April 10 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

The Aaron pointed out in a conversation elsewhere, that "In Player Journals" is specifically a character journal property, whereas permissions can be set on a token (or granted through the character setting). For those not wanting to depart from One Click updates, it might be better to write a short script for this purpose. ChatSetAttr can't do it either, because that is specifically for character sheet attributes, not character journal properties.

April 11 (3 years ago)

Good to know.

I would have assumed that as TokenMod already updates character sheet ownership via tokens that extending it to the Journal as well would be consistent / easy to do... but assumption is never as good as evidence :-)

Of course if he has decided that it isn't appropriate to add to TokenMod then that makes sense, alas while I can likely code well enough to insert code into new versions, I doubt I could code my own separate script to run the code Oosh put together.

April 11 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Lol. I've never added it for that reason, and because I want to rewrite TokenMod as just a general !mod, but haven't got around to it. I'll take Oosh's push and bring this into the next version of TokenMod. 

April 11 (3 years ago)
Andreas J.
Forum Champion
Sheet Author
Translator

TokenMod -> TAMod (The Aaron Mod)

April 11 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

Lol, perhaps... =D

April 12 (3 years ago)

Edited April 12 (3 years ago)
Oosh
Sheet Author
API Scripter

DM: You hear the Scriptomancer walk off down the hallway.

Oosh: I'll sneak into his study.

DM: Are you sure you want to do that?

Oosh: Yep!

DM: You're in the Scriptomancer's study. As a strong believer in shared learnings, he hasn't locked the door.

Oosh: Awesome! I'll grab his spellbook.

DM: You grab his spellbook. There's a whole heap of original spells in here, the one at the front is quite long.

Oosh: Cool! I'll add some words to it to make it better.

DM: *Raises an eyebrow* Are you really sure you want to do that? Make an Arcana check.

Oosh: It's an 11. That's better than average, right?

DM: After your Int mod is applied, no. No it is not. You failed to improve the spell, but you did manage to draw a few dicks in the margin.

Oosh: I'm happy with this outcome.

DM: You hear footsteps coming back down the hall towards the study.

Oosh: Uh oh! Can I roll stealth now?

DM: What for?

Oosh: To hide!

DM: Where?

Oosh: Behind the spellbook?

DM: *sigh* I guess this will be easier if I just let you roll. Go on, then.

Oosh: I rolled a one. That's good isn't it? Ziechael said it's the best number.

DM: The Scriptomancer walks straight up to you and snatches your 'hiding place' from your filthy hobbit hands.

Oosh: I dive under the table. Can I make a saving throw?

DM: What? Why? The Scriptomancer isn't attacking you.... yet. But you are now under the table. By the way, this would have been a better hiding place than behind a book you were holding.

Oosh: Oh. What's the Scriptomancer doing now?

DM: Well he doesn't look impressed. He's shaking his head and mumbling something about 'not what the damned spell is for'...

Oosh: I shout "Francesco made me do it" and hide. Can I roll stealth again?

> Oosh has been kicked from the game.
> Connection lost, attempting to reconnect...

April 12 (3 years ago)
The Aaron
Roll20 Production Team
API Scripter

BWAHAHAHAHA!!

April 12 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


April 12 (3 years ago)

Edited April 12 (3 years ago)