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

Campain-wide attributes

1646135126

Edited 1646135153
Is it possible to create attribute that can be shared by multiple players' character sheets ? For example, I want to create an attribute (like a caracter trait) to a NPC and I would like it to be reflected on multiple players' character sheet in a relation tab. Is there a way or a workaround (save it as an attribute of the GM's character sheet?) to do that?
If you have macro mules already created for player macros, use that sheets repeating resource box to handle said attribute.  If you want it editable, use chatsetattr to modify the sheet while its archived.  
1646150773
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
A  Macro Character Sheet  or really any character sheet that is usable for storing a value that can be referenced by anyone at the table. This is useful for formulas and macros, but getting it to display on a character sheet as you are looking at it might be difficult to impossible. They can reference it, but the sheets I am familiar with do not have the capability of displaying a referenced value, just using it. Can you explain a little more about what you are trying to accomplish (not how you want to accomplish it)? There might be some other ways to achieve that goal. What sort of information do you want your players to have and when and where would they use it?
I am trying to adapt a character sheet for an RPG game where the players create the NPCs by giving them traits. I would like each player's character sheet to have a relation tab which would show the NPC's name and traits.
1646508166

Edited 1646508177
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Getting that info to display in real time on a sheet would likely require a specialized character sheet. You haven't said what sheet you are using, but with the D&D 5th Edition by Roll20 Sheet (the most common), this sort of display can't be done. The best you could do is create a macro that polls the common sheet and whispers it to the player in chat. What sheet are you using, or are you in the process of developing your own? If developing your own, this is probably a better question for the Character Sheets & Compendium forum. Hmm. an API script could probably be written so that any change that is made to a given publisher character sheet could be immediately written to a field on the subscriber sheets. But that sounds like an awful lot of work.
I am developping my sheet from scratch using Html / CSS / Javascript
The FFG Star Wars sheet has a "Dice Pool" concept that can be synced with the players. I suggest taking a look at that for inspiration of how it's done.
1646587096
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Dungeon Master said: I am developping my sheet from scratch using Html / CSS / Javascript I'd suggest asking a mod to move your post to the Character Sheets & Compendium forum. You'll get more eyes there who are interested in the subject and who can provide more directed feedback. To get mod attention, use the report button on your top post (you won't get in trouble), and explain your request. With any luck, they'll move it. You can also try the Discord for the Roll20 subreddit. There is an extremely active community of sheet developers there who can answer fetchnical questions like this.
1646589348

Edited 1646589395
GiGs
Pro
Sheet Author
API Scripter
The Dungeon Master said: Is it possible to create attribute that can be shared by multiple players' character sheets ? For example, I want to create an attribute (like a caracter trait) to a NPC and I would like it to be reflected on multiple players' character sheet in a relation tab. Is there a way or a workaround (save it as an attribute of the GM's character sheet?) to do that? If you want to create an attribute whose value is shared between multiple character sheets, that isnt possible. Character sheets are isolated, and can only reference their own values. There is an undocumented character sheet id, so it might be possible through some javascript coding, but it's not offficially supported and is likely to be pretty flaky. This is the kind of thing you'd use the API for, so you are accidentally in the right place if you want to pursue a script solution.
1646590068
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Gigs! I figured that was likely the answer, but I'm not proficient in sheet-fu and did not want to pass bad info.
Where can I learn about this unocumented character id? My first question would be is there a way to return the GM id when I run a script like: on('ready',function(){     'use strict';     var players=findObjs({_type:'player'});     _.each(players,function (obj){         log('Player '+obj.get('displayname')+' has id: '+obj.get('id'));     }); }); The idea would be to get the GM id, store it in a variable and use things like : function SetAttributeFromCharacterID(attribute,characterID,value){     var result = findObjs({type: 'attribute', characterid: characterID, name: attribute});     if(result!='')     {         result[0].set('current',value);     } } to store what I want on the GM sheet
The Fantasy Flight Star Wars character sheet has a mechanism that allows you to share the dice pool across character sheets: The "Force Player Update" button pushes the Light & Dark side Destiny Pool values to the characters. You might want to take a look at the sheet code to give you a starting point. This may of course not be what you are after, but it does work - I've used it.