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

Help needed for using the Geomorphic script

Hello, I am a GM who has recently acquired Geomorphic maps. I was intending to use the API code that was available to make some dunegons using dynamic lighting, but I seem to have come across some problems. For reference, here is the code I am using: <a href="https://gist.github.com/BaldarSilveraxe/9075585" rel="nofollow">https://gist.github.com/BaldarSilveraxe/9075585</a> These are the errors I was given, despite following the instructions, after trying to use !geo: ReferenceError: geomorphicTilesTableItems is not defined ReferenceError: geomorphicTilesTableItems is not defined at buildTileArray (apiscript.js:590:12) at setPaths (apiscript.js:545:23) at processMessage (apiscript.js:469:33) at apiscript.js:462:61 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
1495359978

Edited 1495360333
Jakob
Sheet Author
API Scripter
Urgh, the script is written in non-strict Javascript and generally in a horrible, unclear style. But I have a pretty good idea why it is failing, it tries to use the non-defined geomorphicTilesTableItems variable in the buildTableArray() function on line 590. Whoever wrote this doesn't seem to have a good understanding of how Javascript works. I could probably fix this single error and make it work as intended, but if the rest of the script is written with this code quality, that's probably hopeless... EDIT: Okay, I get it, all the variables are defined at the start. It's terrible practice, since it pollutes the global namespace, but I think it can be fixed. Try adding this to the start of the script: var&nbsp;geomorphicTilesTableItems = [];
1495377890
The Aaron
Pro
API Scripter
Hahah.. You're spoiled by the other code you've dealt with. &nbsp;=D &nbsp;Stephen S. is much better now.&nbsp;
Jakob said: Urgh, the script is written in non-strict Javascript and generally in a horrible, unclear style. But I have a pretty good idea why it is failing, it tries to use the non-defined geomorphicTilesTableItems variable in the buildTableArray() function on line 590. Whoever wrote this doesn't seem to have a good understanding of how Javascript works. I could probably fix this single error and make it work as intended, but if the rest of the script is written with this code quality, that's probably hopeless... EDIT: Okay, I get it, all the variables are defined at the start. It's terrible practice, since it pollutes the global namespace, but I think it can be fixed. Try adding this to the start of the script: var&nbsp;geomorphicTilesTableItems = []; Alright I'll try it now. The Aaron said: Hahah.. You're spoiled by the other code you've dealt with. &nbsp;=D &nbsp;Stephen S. is much better now.&nbsp; I tried messaging him, but he seems to be busy. I wish I had found a more updated version of the code early on.
1495410668
The Aaron
Pro
API Scripter
Hey says the Dungeon Ready script is a newer version of the same thing. (I'm on the phone with him right now. =D )
1495410755
vÍnce
Pro
Sheet Author
Tell Stephen we miss him. &nbsp;No really... &nbsp; ;-)
Alright, it works now. Thanks guys.