If it’s just the linter (the red circles beside lines of code) that is complaining, you can do
“/* globals tracery */” at the top of the file that is complaining to tell it that it’s gonna be defined - the linter doesn’t really matter, though it is nice to be able to turn it off. The problem is that the linter only “sees” a single file, and so it doesn’t know about the definition of tracery in the other file that will flow down to the script.js file.
Thanks so much for your help people.
WilsontheWolf Yeah I thought it was the load order, but still not certain @jarvis394 That looks very useful, I’ll try it out (presumably it is an envelope for all of the script in a file?) @Johnicholas Glad to meet another tracery fan. I’m basically learning to code because I’m EXCITED about playing with proc gen text. I think you are probably right that this is just the linter and I will try the globals thing asap. I will also have a good look at your code to see if i can copy the important bits
I have tested and found that @Johnicholas is right, it is not the load order that is the problem, the function can be defined in one file and called in another, but Glitch still flags it as an undefined function.
Therefore, Tracery is not doing what I expect it to do because my script for writing and outputting a grammar is wrong, which is a subject for another thread.