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

[Script] [Beta] Savage worlds SWADE Statblock Importer

1603885846

Edited 1604103196
First of all I am standing on the shoulders of giants.&nbsp; Thanks Jason.P, pelwar, Aaron and anyone else who's code/sugestions went into this before I got my hands on it!&nbsp; I took pelwar's statblock importer and adjusted to use objects and array's.&nbsp; I also adjusted all the attributes to be compatible with this Official Savage Worlds sheet. This was posted in a slightly different (read broken) version on the Official Savage Worlds Sheet forum, but I feel this may be a better place for this. I have implemented a small but important fix from that version.&nbsp; The previous version did not call the SheetWorker functions, so buttons and such did not work. Currently it&nbsp; should&nbsp; do the following: Read any SWADE Statblock placed in the GM Info section of a token and then: Create Character Sheet Import Attributes Import Skills Import Special Abilities Import Edges Import Hinderances Calculate and adjust Derived stats Calculate modifiers due to: Special Abilities Edges Hinderances Set Token used as Default Token Set Token Image as Character Avatar Image Trigger SheetWorker update scripts to calculate fields and buttons on sheet. I have hopes of adding the following: Processing Weapons and adding to sheet in repeating section Processing Powers and adding to sheet in repeating section I am currently struggling with how to write Regex that will also grab text before the (12/24/48 Range.....) etc for ranged weapons or the (Str+2d6+1) melee damage indicators to allow the code to differentiate between items in the Gear section (Ranged, Melee, Thrown, or not a weapon).&nbsp; Any help with that will help me get the weapons/powers section added, otherwise it might need some other method figured out. Let me know what you think and hopefully this will help those of you with Pro! - ThatGuy Now on Github! <a href="https://github.com/Justin27482/SW-Import" rel="nofollow">https://github.com/Justin27482/SW-Import</a>
1604103233

Edited 1604103268
Updated Script to version 1.0.2: Okay, so I've fixed the Common Knowledge (And Weird Science) but (whitespace in skill names, corrected using replace). [WC!] is now working, logic was reversed (!= instead of ==) Adjusting gmnotes to remove hyphenation should fix linebreak issues, let me know if it persists. I am continuing to have major issues addressing the automatic -2 on fightingmod.... I am even trying to manually run the below at the end of my script and it does nothing to help.... I'm starting to this this is related to the async nature of the API and Sheetworkers....&nbsp; When my code runs staticfighting is already set to 'on' and fightingmod is set to 0, but then later after my code completes the sheetworker resets to -2.&nbsp; At the moment you will need to open the sheets and fix the fighting mod manually, either by hiding/showing it or editing the mod field. Next Steps: I will write Regex to identify and add every edge/hindrance/special ability to the repeating section, regardless of whether I actually do anything mathematically due to the edge/hindrance/special ability.\ I will set the attribute to show the Special Ability section when the sheet has Special Abilities. I will return to trying to figure out how to RegEx (or some other way parse) the whole weapon name and stats (Roll20 doesn't allow lookback or lookahead Regex). I'll then try to clean up my API script for toggling TokenStatus and having that also adjust the appropriate fields on the CharSheet. Please keep letting me know of bugs and issues so we can hopefully have a tool to quickly prepare for game sessions :) function FixFighting(charID){ staticFightingAttr = findObjs({ type: 'attribute', characterid: charID, name: 'staticfighting' })[0]; FightingModAttr = findObjs({ type: 'attribute', characterid: charID, name: 'fightingmod' })[0]; log(FightingModAttr); log(staticFightingAttr); let AttrObj1 = createObj("attribute", { name: 'fightingmod', characterid: charID }); AttrObj1.setWithWorker({ current: '0', max: '' }); let AttrObj2 = createObj("attribute", { name: 'staticfighting', characterid: charID }); AttrObj2.setWithWorker({ current: 'on', max: '' }); }
I just tried the latest version from github. I don't know if I'm doing something wrong or not but I tried it with the horse and while the Special Abilities section is now visible, special abilities still aren't flowing into the character sheet. Also, Parry came up as a 2 on the sheet. Horse Riding horses compromise speed with carrying capacity. Attributes: Agility d8, Smarts d4 (A), Spirit d6, Strength d12, Vigor d8 Skills: Athletics d8, Fighting d4, Notice d6 Pace: 12; Parry: 4; Toughness: 8 Edges: Fleet-Footed. Special Abilities: „ Kick: Str+d4, to the front or rear as desired. „ Size 2: Typical quarter horse of about 1,000 lbs.
I still haven't had a chance to update the script to list the special abilities in that section.&nbsp; The list doesn't actually adjust any stats, what you should find is for example if the creature is an undead it has a +2 to it's unshake roll, etc.&nbsp; You might want to wait for the next version where I will hopefully have special abilities listed.
Okay, Github now has the latest version 1.0.5.&nbsp; This version should do the following: Currently it should do the following: Read any SWADE Statblock placed in the GM Info section of a token and then: Create Character Sheet Import Attributes Import Skills Import Special Abilities (SWADE) Import Edges (SWADE and Non Harrowed from Deadlands: Wild West) Import Hinderances (SWADE) Calculate and adjust Derived stats Calculate modifiers due to: Special Abilities, Edges, Hinderances Set Token used as Default Token Set Token Image as Character Avatar Image Add Weapons to the sheet with all required attributes Next Tasks: Processing Powers and adding to sheet in repeating section Please let me know if you see any breakage, and if you do, please supply the stat-block you are importing.
1605880030

Edited 1605880047
Finderski
Pro
Sheet Author
Compendium Curator
I'm not able to get this to fire at all... Here's the Statblock I was using: I used the Bull stat block from the SWADE Core rule Book (v 5.5, on page 180...I can PM you the stat block if necessary, but didn't want to post it here for copyright reasons). There are no errors in the API console...no messages either other than the everything initialized. And nothing out of the ordinary in the Dev Tools console, either.
1606069147

Edited 1606069175
Finderski said: I'm not able to get this to fire at all... Here's the Statblock I was using: I used the Bull stat block from the SWADE Core rule Book (v 5.5, on page 180...I can PM you the stat block if necessary, but didn't want to post it here for copyright reasons). There are no errors in the API console...no messages either other than the everything initialized. And nothing out of the ordinary in the Dev Tools console, either. I just tested and was not able to recreate your issue.&nbsp; If you have verboseMode = true (right after comments) you should get 100's of lines in the API Output Console: Silly question, you did paste the entire stat block into the GM notes of your preferred token and with the token selected executed !SW-Import in the chat box right?&nbsp; Please PM the stat block exactly as you used it in case it was missing something critical, but in that case I would have expected at least something to output to the console, even when I have errors, I usually get 100's of lines of output before the errors show up, especially since it also output's all your sheetworker log lines with how I add attributes with sheetworker.
1606216796
Finderski
Pro
Sheet Author
Compendium Curator
Not a silly question...I did paste the entire stat block, but was not using !SW-Import...&lt;blush&gt; I've been working with a lot of APIs lately that don't require commands and in my head this was one of them. LOL PMing you with an issue, though...
I've updated the script to 1.0.6 to apply a small bug fix where Quick Draw also caused Quick to be listed as well.
1606252156
Finderski
Pro
Sheet Author
Compendium Curator
Thanks for all your hard work on this...I really appreciate it. :)