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

D&D 3.5 Monster Import API - new to API, no idea what I'm doing... help!

This is my first attempt at adding an API to one of my games, I am using a copy of my game in case I screw up. This is the API I am trying to use: <a href="https://app.roll20.net/forum/post/1761348/script-monsters-automatically-import-srd-slash-monster-manual-entries-generate-ability-macros-and-more" rel="nofollow">https://app.roll20.net/forum/post/1761348/script-monsters-automatically-import-srd-slash-monster-manual-entries-generate-ability-macros-and-more</a> Based on another thread, it said I had to load this one as well: <a href="https://github.com/defamai/Roll20/blob/master/common/utility.js" rel="nofollow">https://github.com/defamai/Roll20/blob/master/common/utility.js</a> I went to my campaign's main page &gt; Settings &gt; API settings &gt; New Script I copied the raw versions of the above scripts into monster.js and utility.js and saved I loaded my campaign, and created a handout called "Monster Import" and pasted the stats for a wolf in it, I tried plain text and with all the formatting. <a href="https://www.dandwiki.com/wiki/SRD:Wolf" rel="nofollow">https://www.dandwiki.com/wiki/SRD:Wolf</a> Then in the chat box I typed &gt;&nbsp; !monster import From there it says that it has failed to load. Any help would be amazing. I will try and add some screen shots of the error message.
1613279918

Edited 1613280038
(From Monster Manager): &nbsp;Importing Monsters... (From Monster Manager): &nbsp;Processing 4 lines of text... (From Monster Manager): &nbsp;Importing wolf size/type: medium animal hit dice: 2d8+4 (13 hp) initiative: +2 speed: 50 ft. (10 squares) armor class: 14 (+2 dex, +2 natural), touch 12, flat-footed 12 base attack/grapple: +1/+2 attack: bite +3 melee (1d6+1) full attack: bite +3 melee (1d6+1) space/reach: 5 ft./5 ft. special attacks: trip special qualities: low-light vision, scent saves: fort +5, ref +5, will +1 abilities: str 13, dex 15, con 15, int 2, wis 12, cha 6 skills: hide +2, listen +3, move silently +3, spot +3, survival +1* feats: trackb, weapon focus (bite) environment: temperate forests organization: solitary, pair, or pack (7–16) challenge rating: 1 treasure: none alignment: always neutral advancement: 3 hd (medium); 4–6 hd (large) level adjustment: — wolves are pack hunters known for their persistence and cunning. ... (From Monster Manager): &nbsp;WARNING: Import failed for wolf size/type: medium animal hit dice: 2d8+4 (13 hp) initiative: +2 speed: 50 ft. (10 squares) armor class: 14 (+2 dex, +2 natural), touch 12, flat-footed 12 base attack/grapple: +1/+2 attack: bite +3 melee (1d6+1) full attack: bite +3 melee (1d6+1) space/reach: 5 ft./5 ft. special attacks: trip special qualities: low-light vision, scent saves: fort +5, ref +5, will +1 abilities: str 13, dex 15, con 15, int 2, wis 12, cha 6 skills: hide +2, listen +3, move silently +3, spot +3, survival +1 feats: trackb, weapon focus (bite) environment: temperate forests organization: solitary, pair, or pack (7–16) challenge rating: 1 treasure: none alignment: always neutral advancement: 3 hd (medium); 4–6 hd (large) level adjustment: — wolves are pack hunters known for their persistence and cunning. COMBAT A favorite tactic is to send a few individuals against the foe’s front while the rest of the pack circles and attacks from the flanks or rear. Trip (Ex): A wolf that hits with a bite attack can attempt to trip the opponent (+1 check modifier) as a free action without making a touch attack or provoking an attack of opportunity. If the attempt fails, the opponent cannot react to trip the wolf. Skills: Wolves have a +4 racial bonus on Survival checks when tracking by scent. . Missing mandatory field hitdie.
1613300001

Edited 1613300302
Ziechael
Forum Champion
Sheet Author
API Scripter
Off the top of my head (going to have a play now) it looks like it is expecting a field of 'hitdie' and you've got 'hit dice', try changing that and see if it runs? I did all my 3.5e monsters the hard way since I used the PC sheets for them... now I feel like a FOOL! To the testing area!!! [edit] hmm changing the hit dice to hitdie didn't work... I wonder if it needs both? This might be more involved than I first thought lol
1613300582
Ziechael
Forum Champion
Sheet Author
API Scripter
'Tis a known problem it seems.
1613301332
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, good news... I got it to work following the advice of the linked thread above and The Aaron's revised version. Now on to the bad news, I think the reason I never bothered to use this is that it wasn't perfect, it imported the wolf (cleansed of formatting in a plain text doc first) and got a few bits right but armour class came out at 7 due to size being Colossal and no natural armour applied... didn't look much further than that since that was enough of a deal breaker for me. It also looks like that importer was written before Diana released the NPC sheet which would obviously be a LOT easier to import monsters to, the script could likely be redone to cater to that and with likely more accuracy but not something I have the time for right now... someone might take up the fight for you though? Either way, good look... at least we found a way to make it work ;)
Thanks for the help. With zero coding and the most basic of html knowledge, do you think the api code is something that can be looked at and tinkered with blindly or do I need to pull up my boot straps and delve into a world of learning? Lol
I am attempting to blindly edit the code, so I am just going to throw a link here, in case i manage to figure something out, lol My attempt....
1613471404
Ziechael
Forum Champion
Sheet Author
API Scripter
The basic backbone of the code is there, and if using The Aaron's edit it'll likely be pretty solid too. The bulk of the work should be just pointing the sheet edits to the npc fields and possibly adding an extra step to toggle the NPC view by default for imported sheets... certainly a good project for someone interested in learning (if I wasn't so busy and currently involved in a 3.5e game I'd take a stab at it myself lol). The kind folk out there will definitely help you with your attempts although they might not find it here if they don't look at 3.5e threads, if you are invested in the project maybe make a new thread with a title to lure them in ;)