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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[PF] Pathfinder Sheet Thread 5

Hey Guys! Popping over from another thread. Someone has a game that has like 300 characters in it, and I noticed something that I thought I would bring up and we could brainstorm on it. The issue is that whenever you create a new Character in a game that is using the Pathfinder sheet, the "sheet opened" event causes the Pathfinder sheet to create around 290 attributes, all with a value of "0". Now that's probably fine for a game with 10-20 characters, but once you start getting into the realm of 100+ characters, it's probably not super great to have 29,000 attributes sitting around that are just "0" when the sheet hasn't even been filled in at all. (Let's leave aside for a moment the question of "why does someone have 200 characters that they aren't actually filling out the sheet for). I guess my question is -- is there a way that we can avoid creating all those "empty" attributes? A few preliminary thoughts I had: 1) Instead of making them the first time the sheet is opened, only do them if the sheet is actually modified (I could add a new event for this). 2) Take advantage of the current "default values" system? So that if the default value of the field is "0" it doesn't get saved to the underlying data store... Anyway, let me know your thoughts. It's not a huge deal since it's not going to affect most "normal" games, but I do know there are people who are creating games with lots and lots of Characters in them and this is one side-effect of the Sheet Workers system I hadn't considered.
1456787353

Edited 1456787389
vÍnce
Pro
Sheet Author
Riley D. said: ... I guess my question is -- is there a way that we can avoid creating all those "empty" attributes? A few preliminary thoughts I had: 1) Instead of making them the first time the sheet is opened, only do them if the sheet is actually modified (I could add a new event for this). 2) Take advantage of the current "default values" system? So that if the default value of the field is "0" it doesn't get saved to the underlying data store... Anyway, let me know your thoughts. It's not a huge deal since it's not going to affect most "normal" games, but I do know there are people who are creating games with lots and lots of Characters in them and this is one side-effect of the Sheet Workers system I hadn't considered. This guy actually have 300+ characters open?  I can see having that many in a game.  I have a Bestiary with quite a few NPC's "on-the-ready"... I like your first idea since that really involves little/none change on our part.  ;-P  However, I think we should also implement the 2nd solution as well, but I'm not sure how that will affect our current "sheet-wide" calculations within sheet workers...?
1456787988
Magik
Sheet Author
I just created a new character in a test game running version .37 of the sheet. It didn't create any attributes at all. I'll play around with it to see when the new attributes are created and help fix the issue. The java worker code that we use only applies a change when there has been a modification to the value. The issue may be more along the lines of #2 that you mention above.
1456788327

Edited 1456788377
chris b.
Pro
Sheet Author
API Scripter
The issue is unless the attribute exists, we were getting "not found" in macros if no default and sheetworkers couldn't pick up the value until it was assigned.    Now that the sheetworkers can see the default values we can probably use them.But that won't help all the sheets that aready exist. Then a brand new sheet would basically have nothing to update. ... Theoretically .. 
1456788548
vÍnce
Pro
Sheet Author
I bet his 300+ have been around thru multiple versions of the sheet.  Lot's of attributes over time...
1456788887
Magik
Sheet Author
Riley, can you provide the list of 290 attributes with a value of "0"? That would speed the process along. I already see some room for improvement.
1456789375

Edited 1456789470
chris b.
Pro
Sheet Author
API Scripter
There are a lot of value="" where we could add defaults back in. This will still result in no setAttrs() being called now that getAttrs will get the default.  That should help some. I agree though once you use the sheet, there are a ridiculous number of attributes that are created. Part of that was I was having so many problems i just wrote "set the damn field now!" to make sure it was there :) but having getAttrs see the defaults is a good addition we should take advantage of to speed the sheet up. My campaign probably has 150 or more characters when you include NPCs and monsters. Yes even when they were closed they were slowing down the system until we switched over to sheetworkers.
1456796347

Edited 1456796440
Riley D.
Roll20 Team
So here's the steps I took to get the "0" attributes to show up. Add a new Character. Save changes in the first edit box that pops up. Then close the character. Then re-open it. When you re-open it the second time, if you go to the Attributes and Abilities tab you will see all the Attributes there with the "0" values. I mean, if you have some time to do a few quick experiments to see how hard it would be to get it to not create those attributes and to rely on default values instead, that would be great. You're right, it won't help all those Characters that have already been made but at least for future games it will help. I am also working on our end to make it so that if a Character is archived, we don't fetch the attribute data to help with this as well.
1456797009
James W.
Sheet Author
API Scripter
Can Sheet Workers pull not the current, but the default  value of an attribute (if it has one)? Can Sheet Workers delete an attribute? If we can do both of those, we could have the manual recalc button crawl all of the character's attributes, and delete any that are set to the default, which would help clean characters up once the sheet no longer initializes unchanged attributes.
Wondering if anyone knows a fix for this but I'm having an issue where my character sheet's AC is not updating with the addition of armor or dex mods. It still updates with size bonuses and penalties fine however. Does anyone know an easy (or hard) fix?
1456803215
vÍnce
Pro
Sheet Author
Eric C. said: Wondering if anyone knows a fix for this but I'm having an issue where my character sheet's AC is not updating with the addition of armor or dex mods. It still updates with size bonuses and penalties fine however. Does anyone know an easy (or hard) fix? Try the Recalc button.  There's seems to be something amiss with the AC ability type dropdown on the community sheet, but hitting the recalc fixed it for me.  We'll investigate.  Sorry and thanks for the heads-up.
1456803982
Magik
Sheet Author
Vince said: Eric C. said: Wondering if anyone knows a fix for this but I'm having an issue where my character sheet's AC is not updating with the addition of armor or dex mods. It still updates with size bonuses and penalties fine however. Does anyone know an easy (or hard) fix? Try the Recalc button.  There's seems to be something amiss with the AC ability type dropdown on the community sheet, but hitting the recalc fixed it for me.  We'll investigate.  Sorry and thanks for the heads-up. It was fixed in v .36, but isn't publicly available yet.
1456804618
vÍnce
Pro
Sheet Author
James W. said: Can Sheet Workers pull not the current, but the default  value of an attribute (if it has one)? Can Sheet Workers delete an attribute? If we can do both of those, we could have the manual recalc button crawl all of the character's attributes, and delete any that are set to the default, which would help clean characters up once the sheet no longer initializes unchanged attributes. Regardless if it's the default or a current, isn't there going to be a value?  Often we want to use the default value for other calcs as well.  Not sure if this would help.  I would think even attributes not used in other calculations need to be kept...  So how do we determine what attributes need to be created and which do not?
1456806179
James W.
Sheet Author
API Scripter
Vince said: James W. said: Can Sheet Workers pull not the current, but the default  value of an attribute (if it has one)? Can Sheet Workers delete an attribute? If we can do both of those, we could have the manual recalc button crawl all of the character's attributes, and delete any that are set to the default, which would help clean characters up once the sheet no longer initializes unchanged attributes. Regardless if it's the default or a current, isn't there going to be a value?  Often we want to use the default value for other calcs as well.  Not sure if this would help.  I would think even attributes not used in other calculations need to be kept...  So how do we determine what attributes need to be created and which do not? It sounded to me like the issue was that the characters had a large number of attributes that were set at default values, taking up space on the character and making the attribute list a player has to scroll through to find what they're looking for obscenely long.  It's also my understanding that if the character sheet sets a default value for an attribute, and that attribute is never actually set to anything, the character doesn't actually have  that attribute, but you still get the default value if you actually try to use it.  So if we delete the attributes that have their default value, we can de-clutter the character, and quite possibly from up resources on the server side of things. On a "hey let's make even more  attributes" note, is there any chance the character sheet could get attributes for ability bonuses and penalties?  It'd be nice for things like a Paladin's Divine Grace and Smite Evil (where you only add their Cha mod if it's positive) and adding Str penalties to bow damage (without risking adding a bow ).  These are pretty easy to set up yourself (i.e. "{@{CHA-mod},0}kh1" for Cha bonus), but it'd be nice for newbies who don't know these tricks yet... and it'd be nice if them having a default value meant they didn't add yet another attribute to the list.
1456807573

Edited 1456807751
Magik
Sheet Author
It is fine that there are default values on the sheets. Having them in the sheet is all well and good. It doesn't create any attributes that Roll20 has to manage; it is all HTML at that point. The problem is that the java workers that we have are setting the same value as the default and in that case, it creates an attribute for Roll20 to manage in its database. As Chris mentioned, the java worker support has evolved and we need to update the code to make sure that we don't set a value that hasn't actually changed from the default. Since I have some better experience with working with repeating items in the java code, I'll look at modifying buffs into a repeating entry list. A lot of the problem here is with the buffs. Converting them to repeating items will make them easier to support going forward. I agree that some modifiers should be enabled for ability score rolls.
1456809598

Edited 1456810754
chris b.
Pro
Sheet Author
API Scripter
i have done some updates already this is .35/.36,.. the beta minus the inventory sheet updates (and some updates on defense) (meaning it has the fix for ac dropdown) html with value="" replaced with value="0" (for most, sometimes value="10"): <a href="https://gist.github.com/plutosdad/d91aceb760bd274f" rel="nofollow">https://gist.github.com/plutosdad/d91aceb760bd274f</a>... javascript, mostly the same with a few fixes, but has some more logging: <a href="https://gist.github.com/plutosdad/3d06ef5509b19021" rel="nofollow">https://gist.github.com/plutosdad/3d06ef5509b19021</a>... actually please fork from my repository here <a href="https://github.com/plutosdad/roll20-character-shee" rel="nofollow">https://github.com/plutosdad/roll20-character-shee</a>... note user editable text fields still have value="" only user editable (and readonly) number fields are updated with defaults. I did make some changes to fix some places where it was not properly checking to see if the value was the same. Most of the time it will check if the current value on the sheet isNaN or is not equal to the new value, and if so only then it calls setAttrs (otherwise, the attribute appears even if the default is the same). So by fixing it in a few places I removed a few dozen attributes.&nbsp; I am stuck on a few though, most of the attributes being created are the buff grid and the skills.&nbsp; i cannot figure out why the buffs are all getting written. it checks before calling setAttrs, and it sees that 0=0, so it does not call it, and the log confirms that setAttrs is not being called. YET, &nbsp;the attributes are still full of buffn_name= 0 &nbsp;&nbsp;Same goes for skills, they are filling up the attributes, yet the logging shows setAttrs is not being called. So why are they appearing? I thought maybe the float was not exactly equal to an int in some places, BUT, it would log the write, so it's not that. To show what is being called i have been logging so it only writes when it will update. if (isNaN(currValue) || currValue !== newValue) { TAS.log({"function":functionname,"currValue":currValue","newValue":newValue}); setAttrs(setter); } anyway the above will save you a few hours :) (note, we can't simply not call the recalc on open depending on the version, because old sheets will have version 0, and the attributes will be full of macro language due to the autocalc fields. The recalc has to convert all those to numbers. I don't think there is a way to tell if the sheet is old, or merely a brand new one) deleting: as of right now we'd have to write an API script to delete. which may be valueable if it's a problem for users.
1456811838
Magik
Sheet Author
I think it is better to delete an attribute when we know in the java code that we are resetting the value back to the default so that it removes the attribute. It's late; I hope that made sense.
1456843085

Edited 1456843762
chris b.
Pro
Sheet Author
API Scripter
AHA! I found an actual bug in handleDropdown that was causing it to write every single time. It wrote correct values, so we never noticed, but it was still wasting resources writing the same value back when there was no change. Fixing it got rid of tons of attributes. Buffs are the main thing left. Almost done elminating the uneccesary writes. edit: AND another place where we forcefully update the buffs,fixing now.
1456844913

Edited 1456846947
chris b.
Pro
Sheet Author
API Scripter
I'll have a version ready to check in soon, &nbsp; now when I create a new character i am down to creating&nbsp; 11 &nbsp; 2 attributes only.
chris b. said: I'll have a version ready to check in soon, &nbsp; now when I create a new character i am down to creating&nbsp; 11 &nbsp; 2 attributes only. Great news! Thanks!
1456850140
chris b.
Pro
Sheet Author
API Scripter
PR submitted&nbsp; <a href="https://github.com/Roll20/roll20-character-sheets/" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/</a>...
1456856644
vÍnce
Pro
Sheet Author
Now I can have 600 characters. &nbsp;lol
1456858031
James W.
Sheet Author
API Scripter
Vince said: Now I can have 600 characters. &nbsp;lol You could always have had 600 characters, the power was within you all along. :P
1456859281
chris b.
Pro
Sheet Author
API Scripter
I have 6 players, 2 pet classes plus more if you include summoning and necromancy, so the players already have a small army. the only way I can get close is to throw waves and waves of mooks at them.
1456860071
James W.
Sheet Author
API Scripter
chris b. said: I have 6 players, 2 pet classes plus more if you include summoning and necromancy, so the players already have a small army. the only way I can get close is to throw waves and waves of mooks at them. There are solutions to these problems .
Thought I'd let you know, I was trying out the dragging spells from the compendium feature at about 9pm gmt 1st march (pretty much right at the time of posting), it works well although for some odd reason open/close refuses to be added, other cantrips worked fine, I'm on chrome if that helps. No idea why it's happening.
1456866550

Edited 1456866826
James W.
Sheet Author
API Scripter
David said: Thought I'd let you know, I was trying out the dragging spells from the compendium feature at about 9pm gmt 1st march (pretty much right at the time of posting), it works well although for some odd reason open/close refuses to be added, other cantrips worked fine, I'm on chrome if that helps. No idea why it's happening. I'll take a look at it tonight. EDIT: Actually, I just looked at it; it's an issue the Compendium itself has, presumably with the slash in its name.&nbsp; If you click the spell in the Compendium, it comes back with "Not Found"; Clairaudience/Clairvoyance has the same issue.
For some reason none of the sheets are now allowing me access to the Gear section of the sheet.
1456871202

Edited 1456871965
vÍnce
Pro
Sheet Author
I think there's a missing &lt;/div&gt; at the end of the NPC section. &nbsp;We'll update. &nbsp;Sorry PR submitted:&nbsp;PF v.36 #1448
1456912815

Edited 1456913405
JJL
Pro
Again dunno if this is reported, but for some reason NPC sheet now says that attribute has to be 0 or larger when I put init misc at -5. Since the npc has penalty on initiation throws and has negative initiative.
1456919534
vÍnce
Pro
Sheet Author
You can enter "-5" or whatever negative penalty you like directly in the misc field even if the spinner only goes down to zero. &nbsp;That said, I think we can remove min=0 from the misc field so Init can be easily adjusted.
Was working last night, and I was able to get into the options (gear icon) tab to change from standard skills to background skills last night. This morning, I pull up that tab, and I get nothing at all.
Vince said: I think there's a missing &lt;/div&gt; at the end of the NPC section. &nbsp;We'll update. &nbsp;Sorry PR submitted:&nbsp;PF v.36 #1448 Should be live.
1456933327

Edited 1456933409
Hey folks, sorry if this is the wrong place for it but I'm looking for some macro advice. I'm trying to get Julix's great spellbook macro from earlier in the thread to work, but it seems to be unable to actually use spell information from the sheet, like so: The error underneath occurs when I click the spell. My current macro text is as follows: /w @{character_name} &{template:pf_generic} {{character_name}} {{character_id=@{character_id}}} {{name=Spellbook}} {{Level 0}} {{[@&#123;Pompeo Andosana&#124;repeating_lvl-0-spells_$0_name&#125; ](!%&#123;Pompeo Andosana&#124;repeating_lvl-0-spells_$0_roll&#125;)}} Any help would be much appreciated.
1456935155
James W.
Sheet Author
API Scripter
There's been some changes to how repeatable sections generate IDs; you need to replace the "$0" with the ID of the spell in your spellbook.
Sorry, could you be more specific? Just replacing the "$0" hasn't changed much.
1456944528
vÍnce
Pro
Sheet Author
Even using the older row $X should work, but the calls will be locked to that row regardless of which repeating section is there. &nbsp;Drag/drop baby... &nbsp;I bet that the macro posted in the forums/wiki may be missing the substitutions for special characters. &nbsp;Forums can strip them out if you are not careful. &nbsp;Happens all the time. &nbsp;When you try running a macro that includes queries, nested queries, and/or roll templates, some(usually anything that isn't resolved first, like attributes) special characters found within the macro ie | } , need to use their html special character equivalent or else the macro will fail. More info on the wiki under advanced macros. &nbsp;That's my guess. &nbsp;
1456947114
chris b.
Pro
Sheet Author
API Scripter
Vince said: You can enter "-5" or whatever negative penalty you like directly in the misc field even if the spinner only goes down to zero. &nbsp;That said, I think we can remove min=0 from the misc field so Init can be easily adjusted. Yes I guess we only need min or max on the fields modifying attributes, since those are the only ones where the rules are different.
Ah, I hadn't noticed that the forum ate it. The actual code is as follows:
1456952584
James W.
Sheet Author
API Scripter
Okay, two things that might help: Don't bother with HTML entities in the spell name; we want it to replace that with the spell name immediately. Put a new line character (& #13; without the space) in between "!" and "%".
Looking good! If I had more time I'd volunteer myself... seems like there's a lot going on. Kudos to Magik for actually doing so! One question: last night, I could get to the settings tab of the character sheet no problem. Today, when I click on the tab, nothing loads. Is that something you guys are seeing as well, or is there just something wonky on my end?
1456975323

Edited 1456975506
vÍnce
Pro
Sheet Author
Alex said: Looking good! If I had more time I'd volunteer myself... seems like there's a lot going on. Kudos to Magik for actually doing so! One question: last night, I could get to the settings tab of the character sheet no problem. Today, when I click on the tab, nothing loads. Is that something you guys are seeing as well, or is there just something wonky on my end? We were missing a closing &lt;/div&gt; on the sheet. &nbsp;The update/fix has been merged, we just have to wait for the servers to pick it up. I thought this went live already though... what is the ver and date found in the footer Alex?
Ahh, okay. I must have missed that, sorry! I don't seem to have a footer, but the version in the top-right is 0.36.
One more question--I didn't see any mentions of it in the thread, but when I enter values in fields that are part of a repeating row, more often than not the value is lost and I have to reenter it. Is that something anyone else is seeing?
1456979489
Magik
Sheet Author
Alex said: One more question--I didn't see any mentions of it in the thread, but when I enter values in fields that are part of a repeating row, more often than not the value is lost and I have to reenter it. Is that something anyone else is seeing? Is that just when you first create it or when does that occur?
That's interesting--footer is back, and so is the NPC tab. Sheet version hasn't changed, of course. I thought I had reloaded quite a while after Riley's post, but maybe I did not!
1456979640

Edited 1456979727
Alex
Pro
Hrm, It looks like the weirdness with the repeating rows has also cleared up. I'm really not sure what's going on, but never mind me. Actually, nevermind. It's still there. It seems to primarily happen when entering a value in a field for the first time. I'll have to see if the new version has changed the behavior any, though.
1456979696
Magik
Sheet Author
Riley D. said: chris b. said: I'll have a version ready to check in soon, &nbsp; now when I create a new character i am down to creating&nbsp; 11 &nbsp; 2 attributes only. Great news! Thanks! I found that with some changes that I'm making and using TheAaronSheet that his functions were not checking for a change before setting a value and thus creating an attribute where one wasn't needed. He was kind enough to update it and has released a new version.&nbsp; TheAaronSheet
1456980577
Magik
Sheet Author
Alex said: Hrm, It looks like the weirdness with the repeating rows has also cleared up. I'm really not sure what's going on, but never mind me. Actually, nevermind. It's still there. It seems to primarily happen when entering a value in a field for the first time. I'll have to see if the new version has changed the behavior any, though. If there are any repeating entries with red dotted borders around them, then you'll need to delete those and recreate them. Having those around causing weird issues. I continue to see issues with newly created repeating entries disappearing before I get a chance to enter data or right when I enter data in one field. I've seen this in other sheets, so I suspect that it is a java or Roll20-side issue and not a sheet-specific issue. If you can gather this information when experiencing the issue then we may be able to help identify it. 1. A console log. You can view the steps to get that here: <a href="https://wiki.roll20.net/Solving_Technical_Issues" rel="nofollow">https://wiki.roll20.net/Solving_Technical_Issues</a> (skip to Step 4) 2. In addition to the console log, a screenshot of your whole browser window (including the address bar) would be super helpful. 3. What browser you are using, including the version number. You can find this out by going here: <a href="http://supportdetails.com" rel="nofollow">http://supportdetails.com</a> at any time.
1456980640
Magik
Sheet Author
James, congrats on Sheet Author!