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

Sheet workers and repating fields (Traveller: The New Era sheet project)

Yes, I'm still working on my Traveller: The New Era sheet, and yes I don't actually know how to code. But I'm actually learing a lot from all of you that have answered my previous posts here, so a big big thanks! But more to the point: I found some code somwhere in the forums that let me add upp the totals from one of my repeating fields, but there are a few more things I wanted to do that I don't really know how to at this point. Since making a Traveller: The New Era character is rather complicated I've made a character generation worksheet, which includes a repating section for choosing careers. In this system you choose a number of these terms (each lasting four years) during character generation. What I want to do is: 1. Calculate credits on a per term basis. As the attribute Social Standing used to calculate credits might change during character generation this is most accurate when done for each term and not at the end of character generation. 2. Calculate the number of terms choosen (in other words the number of entries in the repeating section). I've seen a CSS Wizardy entry that does this, but I want to use the term number to calculate age so I'm looking to get the value as an attribute of some sort. Also - is there any way I could populate one repeating section from another? When generating characters now the players are simply given a text-box to write down whatever skills they acquire and later fill out a repeating section somewhere else on the sheet. (This is made a bit more complicated since skills are listed based on attribute.)
1526761785
David
Sheet Author
As the author of the Twilight sheet I have offered to help you before and the offer still stands. One thing I will say you are really adding to your work by trying to create a character generater as oppossed to a character sheet.
1526764891
David
Sheet Author
What I want to do is: 1. Calculate credits on a per term basis. As the attribute Social Standing used to calculate credits might change during character generation this is most accurate when done for each term and not at the end of character generation. I think  TheAaronSheet  should be able to help you with this. 2. Calculate the number of terms choosen (in other words the number of entries in the repeating section). I've seen a CSS Wizardy entry that does this, but I want to use the term number to calculate age so I'm looking to get the value as an attribute of some sort. This will give you the number of rows in your repeating section every time something is changed in the repeating section on("change:repeating_terms:term", function() { getSectionIDs("terms", function(idArray) { var termNo = idArray.length; setAttrs({termNo:termNo}); }); }) Also - is there any way I could populate one repeating section from another? When generating characters now the players are simply given a text-box to write down whatever skills they acquire and later fill out a repeating section somewhere else on the sheet. (This is made a bit more complicated since skills are listed based on attribute.) When are you going to do this copying? There are very few events to play with and there is no event for a button press.The only events are when the sheet is opened, when a row in a repeating section is removed and when an attribute is changed.
David said As the author of the Twilight sheet I have offered to help you before and the offer still stands. One thing I will say you are really adding to your work by trying to create a character generater as oppossed to a character sheet. I'm very grateful for the help I've allready gotten from you. In part because I'm basing all this on the Twillight sheet and also because your invite to look at the Sengoku sheet made me realize how the repeating sections work. At this point I guess the main goal of adding the worksheet was specifically to add to my work as I'm having a lot of fun trying to figure these things out. Also the reason I'm doing this sheet now is beacuse I'm running an asynchronus text-based game so I wanted to help the players be a bit more independent when creating characters and not have to ask me to many questions... If you want to have a look: <a href="https://github.com/mariusbax/roll20-character-sheets/tree/master/Traveller%20The%20New%20Era" rel="nofollow">https://github.com/mariusbax/roll20-character-sheets/tree/master/Traveller%20The%20New%20Era</a>. The layout is very basic, and I haven't really gotten around to understanding the .css yet, there is som italicized text in Norwegian that is intended for my players (as well as links to a couple of images) that obviously have to go if this is to be sumbmitted to the official repository... But I'm still quite happy about it.
David said: What I want to do is: 1. Calculate credits on a per term basis. As the attribute Social Standing used to calculate credits might change during character generation this is most accurate when done for each term and not at the end of character generation. I think&nbsp; TheAaronSheet&nbsp; should be able to help you with this. 2. Calculate the number of terms choosen (in other words the number of entries in the repeating section). I've seen a CSS Wizardy entry that does this, but I want to use the term number to calculate age so I'm looking to get the value as an attribute of some sort. This will give you the number of rows in your repeating section every time something is changed in the repeating section on("change:repeating_terms:term", function() { getSectionIDs("terms", function(idArray) { var termNo = idArray.length; setAttrs({termNo:termNo}); }); }) Also - is there any way I could populate one repeating section from another? When generating characters now the players are simply given a text-box to write down whatever skills they acquire and later fill out a repeating section somewhere else on the sheet. (This is made a bit more complicated since skills are listed based on attribute.) When are you going to do this copying? There are very few events to play with and there is no event for a button press.The only events are when the sheet is opened, when a row in a repeating section is removed and when an attribute is changed. Age and Term numbers now up and running - thanks! Dosen't seem to register correctly if a player for some reason deletes a career-term, but I'll look into that. The copying of skills would be when a skill is added to the repeating section in the character creation worksheet and then also added to a repeating section in another part of the character sheet, or possibly if a repeating section could appear at multiple places in the sheet similar to attributes? In any case this would mean extensively rewriting the careers part of the character creation worksheet and probably not worth the effort, but I'm curious if it could be possible. On a similar note. One of the skills that could be added to the skills section is "unarmed martial arts". If this skill is present it is used to calculate the "unarmed combat damage". Currently I'm using a workaround where the players enter their skill level at the end of character creation, but I guess it should be possible to use a sheet worker to look through the "repating_strSkills" for a "attr_strskillName" that is "Unarmed Martial Arts" and get the "attr_strskillValue" from the row?
1526848587
David
Sheet Author
you need a sheet worker for when a row is removed I have code for this but not hand at the minute. &nbsp;I have code as well for cycling through and lookiing for a skill name. &nbsp;Do you have the sheet tabbed? You can copy the fielset on the other tab and it will duplicate everything make sure the attrribute name is the same.
1526849853
David
Sheet Author
Marius said: Age and Term numbers now up and running - thanks! Dosen't seem to register correctly if a player for some reason deletes a career-term, but I'll look into that. on('remove:repeating_terms',function(){ TAS.repeatingSimpleSum('terms','atrribute to sum','attribute to put the sum'); }); On a similar note. One of the skills that could be added to the skills section is "unarmed martial arts". If this skill is present it is used to calculate the "unarmed combat damage". Currently I'm using a workaround where the players enter their skill level at the end of character creation, but I guess it should be possible to use a sheet worker to look through the "repating_strSkills" for a "attr_strskillName" that is "Unarmed Martial Arts" and get the "attr_strskillValue" from the row? on("change:repeating_skills:skillName change:repeating_skills:skillRank", function() { getAttrs(["repeating_skills_skillName","repeating_skills_skillRank"], function(values) { var skill = values.repeating_skills_skillName; skill = skill.toLowerCase(); skill = skill.trim(); if (skill === "unarmed martial arts"){ var rank = parseInt(values.repeating_skills_skillRank); setAttrs({your attribute:rank}); } }); }); This should give you the idea.
Thanks a lot!