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

Star Wars Saga Edition Character Sheet updated - but by who?

1653438248

Edited 1653438260
Mike
Pro
The title says it all, basically. The character sheet was updated recently but neither the GitHub page nor the wiki have been updated, so its unclear who made the change or how the new functionality (a Second Wind button) works. Any ideas?
1653442324

Edited 1653444143
GiGs
Pro
Sheet Author
API Scripter
You can see the history of changes here: <a href="https://github.com/Roll20/roll20-character-sheets/commits/master/Star%20Wars%20Saga%20Edition" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/commits/master/Star%20Wars%20Saga%20Edition</a> The change was done by a github user by name of iainjess It adds two sheet workers, one to calculate the value of second_wind, and the second to respond to a button, and either add this value to HP if your HP are below half, or restore HP to full. Unfortunately it looks to me like the way it's coded, both these sheet workers will do nothing. Maybe I'm misreading it - does it work for you? Is this how second wind is supposed to wrk: Value is either 1/4HP or your CON, whichever is higher When you take a second wind: If HP are below half, add Second Wind If HP are above half, restore to full.
1653445543
GiGs
Pro
Sheet Author
API Scripter
I've submitted a fix that makes the sheet workers work (hopefully).
GiGs said: You can see the history of changes here: <a href="https://github.com/Roll20/roll20-character-sheets/commits/master/Star%20Wars%20Saga%20Edition" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/commits/master/Star%20Wars%20Saga%20Edition</a> The change was done by a github user by name of iainjess It adds two sheet workers, one to calculate the value of second_wind, and the second to respond to a button, and either add this value to HP if your HP are below half, or restore HP to full. Unfortunately it looks to me like the way it's coded, both these sheet workers will do nothing. Maybe I'm misreading it - does it work for you? Is this how second wind is supposed to wrk: Value is either 1/4HP or your CON, whichever is higher When you take a second wind: If HP are below half, add Second Wind If HP are above half, restore to full. Appreciated! And yes, that's how Second Wind is supposed to work, but the button does not appear to actually do anything (except *eventually* fill in the second-wind HP restoration value). Thanks for submitting the fix, I know the original sheet author has essentially retired from maintaining it.
As long as we're here, can I respectfully request that "Encumberance" be at long last corrected to "Encumbrance"? ;)
1653456449
GiGs
Pro
Sheet Author
API Scripter
Haha, that's a very easy fix. Just addited it the commit.
You're the best! Also-also: In playing around with it a bit, it appears that the Second Wind button DOES work - but only once, and it doesn't send any indication that anything's happened to the chat window. There also doesn't appear to be a way to reset it (let alone to add more uses of Second Wind gained through Talents or Feats). Any chance you can address this as well? As you can guess, you are quickly becoming my go-to person on this stuff :) GiGs said: Haha, that's a very easy fix. Just addited it the commit.
1653461275

Edited 1653461318
GiGs
Pro
Sheet Author
API Scripter
The change I've submitted should fix the second wind button so it works whenever clicked. But it won't send any indication to the chat window - that's a good idea, but will need Custom Roll Parsing. This is getting to be more work than I have time available. (Honestly, there's a huge amount that could be "fixed" on the sheet - I restrain myself to fixes that take almost no time, since I have other things demanding my time.) My main concern was the Second Wind button can be clicked as often as you want - there's nothing stopping someone accidentally clicking it twice. Is there a limit to how often it can be used, and is there an attribute on the sheet that tracks that?
1653461367

Edited 1653461421
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Mike said: As long as we're here, can I respectfully request that "Encumberance" be at long last corrected to "Encumbrance"? ;) GiGs &nbsp;said: Haha, that's a very easy fix. Just addited it the commit. Mightn't that be a breaking change for existing user macros? I figured that was the reason the same exact issue has never been corrected on the&nbsp;D&amp;D 5th Edition by Roll20 Sheet.
1653461654

Edited 1653461837
GiGs
Pro
Sheet Author
API Scripter
keithcurtis said: Mightn't that be a breaking change for existing user macros? I figured that was the reason the same exact issue has never been corrected on the&nbsp;D&amp;D 5th Edition by Roll20 Sheet. A good concern but in this case, it shouldn't affect any macros. The Encumberance typo isnt in an attribute, but was in a heading in the HTML which isnt (and in fact can't be) touched by macros. I don't know what the error is on the Roll20 5e sheet - but users can't jump in and fix that. It has to be done by the devs, so I'd suggest bringing it up in their thread or on their new suggestion board.
GiGs said: The change I've submitted should fix the second wind button so it works whenever clicked. But it won't send any indication to the chat window - that's a good idea, but will need Custom Roll Parsing. This is getting to be more work than I have time available. (Honestly, there's a huge amount that could be "fixed" on the sheet - I restrain myself to fixes that take almost no time, since I have other things demanding my time.) My main concern was the Second Wind button can be clicked as often as you want - there's nothing stopping someone accidentally clicking it twice. Is there a limit to how often it can be used, and is there an attribute on the sheet that tracks that? Sorry, I didn't mean for this to take up so much of your time. I got excited because no one else has been able/willing to tackle any of these things until recently when I noticed the new changes, and frankly I play SWSE more than anything else on here. Normally, all characters with Heroic levels can take a Second Wind once per day, but certain talents or feats can raise that number. There's currently no attributes on the sheet to track any of this, which I always thought was surprising for such a basic mechanic of this system.&nbsp;
1653470812
GiGs
Pro
Sheet Author
API Scripter
Mike said: Normally, all characters with Heroic levels can take a Second Wind once per day, but certain talents or feats can raise that number. There's currently no attributes on the sheet to track any of this, which I always thought was surprising for such a basic mechanic of this system. If I had more time and new the sheet layout, I'd definitely be adding an attribute for number of Second Winds/day, and have the button press reduce the number, and another&nbsp; button to reset them for the end of the day. But you can see just for that how things tend to grow more ambitious and take more and more time. Because of this, I restrict most of my sheet additions to fixing bugs that are spoiling the use of the sheet, rather than adding extra features.
1653471722
Iain J.
Plus
Sheet Author
Hi, I was the person that updated the sheet.&nbsp; I'm a bit new to character sheet development so my apologies for missing the updates on the wiki. It's a game I really enjoy but was just missing a few things from the sheet that I felt would help.&nbsp; I can look at sending something to chat for the second wind. On my list to look at the multiple uses of second wind and being able to use it above half health but figured at least a starting basic use.&nbsp;
1653472158

Edited 1653472236
GiGs
Pro
Sheet Author
API Scripter
I'm sure players will appreciate someone's making active updates to the sheet. You can see the changes I've made in the github commits.
1653473390
Iain J.
Plus
Sheet Author
I can see you changes and what I did wrong, thanks for jumping on a fixing it.&nbsp;
1653473502

Edited 1653475210
GiGs
Pro
Sheet Author
API Scripter
To be more specific - the error was definining your variables inside the scope block { } of the if statements. That means they existed there and only there - once the code moved past that, to the setAttrs, those attributes didn't exist any more. If you'd declared a variable of that name before the if statements, their values would have been set correctly.
I cannot stress enough how happy I am that things are being looked at on this sheet at all! Is there any way we can make this a permanent SWSE thread dedicated to this sheet and its issues? I'm pleased to know I'm not the only one still running games!
1653500844
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GiGs said: keithcurtis said: Mightn't that be a breaking change for existing user macros? I figured that was the reason the same exact issue has never been corrected on the&nbsp;D&amp;D 5th Edition by Roll20 Sheet. A good concern but in this case, it shouldn't affect any macros. The Encumberance typo isnt in an attribute, but was in a heading in the HTML which isnt (and in fact can't be) touched by macros. I don't know what the error is on the Roll20 5e sheet - but users can't jump in and fix that. It has to be done by the devs, so I'd suggest bringing it up in their thread or on their new suggestion board. Yeah, without more info on where the typo was, I was making a guess. In the&nbsp;D&amp;D 5th Edition by Roll20 Sheet case, it's actually the attribute name, which means that fixing it would likely cause more problems than letting it lie as a trap for unwary, but English-proficient coders...
1653531804
GiGs
Pro
Sheet Author
API Scripter
Mike said: I cannot stress enough how happy I am that things are being looked at on this sheet at all! Is there any way we can make this a permanent SWSE thread dedicated to this sheet and its issues? I'm pleased to know I'm not the only one still running games! On Roll20, sheets are permanent as long as people keep replying at least once every 3 months :)
1653547506
Iain J.
Plus
Sheet Author
I’m happy to keep working on this sheet. Though the amount of work it really needs to bring it up to date is probably more than I have the skill/time to do. I have some ideas for updates but I would be keen to hear what things other people would like updated/changed on the sheet.&nbsp;
1653565362

Edited 1653566294
GiGs
Pro
Sheet Author
API Scripter
Iain, I see you are adding an update to the second wind sheet worker, but the code contains the same error that prompted me to make my original bug fix. Here's how to fix it. You have this line: if ( hp &lt;= ( hp_max * 0.5 ) &amp;&amp; sw_current &gt; 0 ) { hp_value = Second_Wind + hp ; sw_current_value = sw_current - 1 ; } else { return } The problem with this code is better illustrated if the code is expanded: if ( hp &lt;= ( hp_max * 0.5 ) &amp;&amp; sw_current &gt; 0 ) { hp_value = Second_Wind + hp ; sw_current_value = sw_current - 1 ; } else { return } The main problem is any section inside a { } is in its own scope, and is in a way separate from the rest of the script. If you refer to variables there and don't initialise them first, they only exist in that scope, and stop existing as soon as the code moves on past that block. The fix for this is declaring hp_value before the first curly bracket { I would suggest something like this (from getAttrs down): getAttrs ([ "hp_max" , "hp" , "Second_Wind" , "sw_current" ], function ( values ) { &nbsp; &nbsp; // get the hp, hp_max, second wind stat, and coerce into a numerical values. &nbsp; &nbsp; let hp_max = + values . hp_max || 0 ; &nbsp; &nbsp; let hp = + values . hp || 0 ; &nbsp; &nbsp; let sw_current = + values . sw_current || 0 ; &nbsp; &nbsp; let Second_Wind = + values . Second_Wind || 0 ; &nbsp; &nbsp; let hp_value = hp ; &nbsp; &nbsp; // If the character is equal or less than half health then add the value of second wind to current hit points &nbsp; &nbsp; if ( sw_current &gt; 0 ) { &nbsp; &nbsp; &nbsp; &nbsp; // only do anything if SW is over 0 - otherwise second wind isn't applied &nbsp; &nbsp; &nbsp; &nbsp; if ( hp &lt;= ( hp_max * 0.5 )) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_value = Math . min ( hp_max , Second_Wind + hp_value ); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sw_current = sw_current - 1 ; // you don't need to use a separate variable for sw_current. Technically you don't need hp_value - // you could just modify hp instead of creating hp_value. &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp_value = hp_max ; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAttrs ({ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "hp" : hp_value , &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "sw_current" : sw_current &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; // put your startRoll and finishRoll here, so they only run if sw_current is over 0. &nbsp; &nbsp; } }) The main changes: I created let hp_value before the if statement, so it will continue to exist by the time you reach the setAttrs Reorganised the if statement, so the code after that only runs when sw_current is over 0 Put the setAttrs and the starRoll inside this branch of the if statement, for the same reason. If you want to have startRoll run to send some chat message like "no SW left", the best way is to create an else branch for the first if statement, and put a new startRoll there. Note 1: the code assumes second wind's cant raise HP above maximum. That's what this does: Math.min(hp_max, Second_Wind + hp_value); Note 2: you need to edit the other sheet worker, to just add let Second_Wind; before the if statement, otherwise it'll be undefined when setAttrs runs, too.
1653566114

Edited 1653566340
GiGs
Pro
Sheet Author
API Scripter
If you did away completely with the hp_value variable, it would look like this: getAttrs ([ "hp_max" , "hp" , "Second_Wind" , "sw_current" ], function ( values ) { &nbsp; &nbsp; // get the hp, hp_max, second wind stat, and coerce into a numerical values. &nbsp; &nbsp; let hp_max = + values . hp_max || 0 ; &nbsp; &nbsp; let hp = + values . hp || 0 ; &nbsp; &nbsp; let sw_current = + values . sw_current || 0 ; &nbsp; &nbsp; let Second_Wind = + values . Second_Wind || 0 ; &nbsp; &nbsp; // If the character is equal or less than half health then add the value of second wind to current hit points &nbsp; &nbsp; if ( sw_current &gt; 0 ) { &nbsp; &nbsp; &nbsp; &nbsp; // only do anything if SW is over 0 - otherwise second wind isn't applied &nbsp; &nbsp; &nbsp; &nbsp; if ( hp &lt;= ( hp_max * 0.5 )) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp = Math . min ( hp_max , Second_Wind + hp ); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sw_current = sw_current - 1 ; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hp = hp_max ; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAttrs ({ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "hp" : hp , &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "sw_current" : sw_current &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; // put your startRoll and finishRoll here, so they only run if se_current is over 0. &nbsp; &nbsp; } }); Personally, I'd also change the sw_current attribute name to something like Second_Wind_Count. So it matches the format of the Second_Wind attribute - you don't have to use abbrevations: attribute names and variables can be as long as you need them to be.
1653567106
Iain J.
Plus
Sheet Author
Drat! I thought I had add that change in. Thank you for catching that will update it.&nbsp; Will make the other changes as they make sense.&nbsp;
1653569465
Iain J.
Plus
Sheet Author
Made the changes, hopefully that works better now. Thanks again for your help this is very useful for my learning&nbsp;
1653616075
Andrew R.
Pro
Sheet Author
Variable scope is an elephant trap for new coders. (Spoken as a tutor of new coders back in the late 1980s)
It looks like modifications to the sheet broke the image on the Vehicle Record Sheet tab?
1653844053
Iain J.
Plus
Sheet Author
I’ll push up a fix shortly.&nbsp;
1653844766
Iain J.
Plus
Sheet Author
That's the fix raised&nbsp;<a href="https://github.com/Roll20/roll20-character-sheets/pull/10623" rel="nofollow">https://github.com/Roll20/roll20-character-sheets/pull/10623</a>
I have another request: Is it possible to look into why ticking off the "Armored Def." checkbox doesn't properly calcluate Reflex Defense? It *should* be adding the highest of either your Heroic Level or the Armor Bonus. All the other checkboxes seem to be doing their jobs, including "Improved Armor Def.," which leads me to believe something got broken along the way.
1654852059
Iain J.
Plus
Sheet Author
I'll have a look over the weekend and see if I can spot what is going wrong
1654971318
Iain J.
Plus
Sheet Author
Raised a fix, seems to work on sandbox&nbsp;
Hmm, so if a character has a higher level bonus than its armor bonus, it automatically picks the highest one?&nbsp;
1655026700
Iain J.
Plus
Sheet Author
Once it’s merged in which will probably be a few days that is the behaviour.&nbsp;
Thank you for fixing this!