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

Learn javascript

I'd like to learn javascript but don't know the best way to do it.  I've found books that say they teach it and I've found several online teaching classes.  Does anyone know the best way to learn this?  I've seen that some of the online ones are pretty pricey (at least to my limited means) so free ones are probably what I'm looking for.  Any suggestions? Thanks
1499933569
Ziechael
Forum Champion
Sheet Author
API Scripter
CodeAcademy is a pretty reasonable starting point for the fundamentals in my very limited and basic experience.
1499951975
The Aaron
Pro
API Scripter
<a href="http://www.learn-js.org/" rel="nofollow">http://www.learn-js.org/</a> also looks pretty great. &nbsp;There are lots of javascript programming tutorials, you shouldn't need to buy a curriculum. &nbsp;Everyone learns differently though, so you might have to try several different ones before things click. There are lots of different ways to write Javascript (procedural, object oriented, functional, ...) and lots of different environments where it runs (In the browser, in a Node.js module, in an embedded application sandbox (Roll20 API) ). &nbsp;It can be confusing at times to separate what is "the language" and what is "the environment". &nbsp; What is your intent with learning Javascript? &nbsp;Knowing that might help direct you to better resources. &nbsp;I'm guessing it will be one or both of: Understand API Scripts others have written, and make minor tweaks Learn to write API Scripts to fill a need. Definitely feel free to ask lots of questions. &nbsp;(You can even PM me if you don't want to post them to the forum.)
1499953281
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Javascript for cats: so easy your human can do it! <a href="http://jsforcats.com/" rel="nofollow">http://jsforcats.com/</a>
1499955989
The Aaron
Pro
API Scripter
Oh, that's grand! &nbsp;(I want to know if that's that guy's real beard!) &nbsp;I like that it links to many other tutorials at the end. Learning Javascript reminds me of the protagonist from Good Will Hunting. &nbsp;All the education is freely out there, but you might have to dig a bit to find it.
Thanks to all of you. I'll check out these references and see what works best for me.
1500837530

Edited 1500838029
I started learning JavaScript a year ago and found there is a tremendous amount of resources out there, but why you're learning it matters for which is most appropriate. I started with codecademy (note they have many&nbsp; hidden courses - including some other versions of the JS class), but while it shows you the syntax and provides explanation on the left, it's really just a starting point. For just coding there's codecombat (guided learning combined with a light roleplaying game)&nbsp;and&nbsp; codewars (collection of well sorted practice problems, some really hard) - those are great for applying what you've learned, and finding reasons to learn new things. Eventually&nbsp; JS the Good Parts (a book) is worth reading. Like I said, there is a tremendous amount of resources out there. I went for becoming a web developer (and have been employed as such since Feburary 2017), so if you want resources geared towards that check out the Odin Project and&nbsp; Free Code Camp . They're both amazing, though I was personally affected more deeply by the Odin project and the amazing articles they referenced in various sections. Like in the intro they teach you about how to develop a growth mindset, for example, and share stories of people who made their way into the industry.&nbsp;Eventually&nbsp; this roadmap is useful, albeit initially confusing, because it can be easy to get side-tracked too early. Should I learn Angular or React? Well neither until you know JavaScript well. Anyway, if that happens to be something you're interested in, feel free to ask me any question you'd like. I might be slow to respond if I forget to check my roll20 account, as I don't have any games currently running (been busy switching careers :D). Edit: one last thing, if you are going web dev direction - don't skim on the HTML / CSS stuff, there's more depth to it than you might think at first. DOM manipulation (changing html elements) is crucial to learn sooner or later. And don't forget to have fun! Edit2: Just skimmed through jsforcats mentioned above - it's really clear / good. Don't be concerned it you need ot hear the same thing from different (or same) sources multiple times. That's just part of learning. And learning is fun, right? :) Good luck!
I'm retired and not interested in learning Javascript for professional use. &nbsp;All I want to do is be able to write API scripts for Mongoose Traveller and D&D 5e. &nbsp;Are the things you mentioned good for that? Thank you!
Hey KenB. I'm basically looking for the same sort of thing. I have a lot of trouble with the syntax, and understanding how things in roll20 work. I kind of poke around in other people's code to see what they use to do a certain thing. Google + the wiki have been a help, but it's still very rough for me. I also pick up weird habits, based on whoever's random syntax, like, I've been adding semicolons to the end of if brackets, because someone's code used it, and so I thought it was required in javascript.&nbsp; Here's my suggestion for how to start off: First, ask yourself what the script will do. Make it something very limited at first, you can add functionality later. Then ask yourself how you want to tell the script to do that thing. If it's automatic, without needing input, that's fine too. Then try to figure out the logical steps to make this work. For each step, there's probably some example code, or you can ask questions in this forum or try the wiki. Also, if you find a good resource for it, please let me know, because my method is rough. It took me two+ hours to write a simple script to update, track, and report to chat about 2 character attributes. Hmm, maybe we could form a discord server for people to bug each other on how to do a thing.
1500904439
The Aaron
Pro
API Scripter
I have a Gitter channel where I've tried to foster such a discussion community before:&nbsp; <a href="https://gitter.im/shdwjk/Roll20API?utm_source=badg" rel="nofollow">https://gitter.im/shdwjk/Roll20API?utm_source=badg</a>... Feel free to come hang out there and ask questions about javascript and the Roll20 API. =D Btw, I use pretty much exactly your method: 1) What does it do? 2) What's the interface? 3) Sketch pseudo-code in comments, then expand them out into functionality. I find the interface is often the hardest part.
Thanks, I joined it. I have an idea for a system generator script for STA, but the more I read, the more limited it becomes. I think I read that we can't create pages. I'll probably bug you guys if (when) I get stuck on something.
1500925555
The Aaron
Pro
API Scripter
Can't create pages, but you can modify them after creation. &nbsp;Here's a little snippet that sets pages to a default configuration (mostly obviated by the default settings stuff from earlier this year, but illustrates the point): on('ready',function(){ &nbsp; &nbsp; var masterPage = findObjs({type: 'page', name: 'MASTER'})[0]; &nbsp; &nbsp; if(masterPage) { &nbsp; &nbsp; &nbsp; &nbsp; on('add:page',function(p){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log('got create page'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p.set({ &nbsp; &nbsp; &nbsp; &nbsp; showgrid: masterPage.get('showgrid'), &nbsp; &nbsp; showdarkness: masterPage.get('showdarkness'), &nbsp; &nbsp; showlighting: masterPage.get('showlighting'), &nbsp; &nbsp; lightupdatedrop: masterPage.get('lightupdatedrop'), &nbsp; &nbsp; lightenforcelos: masterPage.get('lightenforcelos'), &nbsp; &nbsp; lightrestrictmove: masterPage.get('lightrestrictmove'), &nbsp; &nbsp; lightglobalillum: masterPage.get('lightglobalillum'), &nbsp; &nbsp; width: masterPage.get('width'), &nbsp; &nbsp; height: masterPage.get('height'), &nbsp; &nbsp; snapping_increment: masterPage.get('snapping_increment'), &nbsp; &nbsp; grid_opacity: masterPage.get('grid_opacity'), &nbsp; &nbsp; fog_opacity: masterPage.get('fog_opacity'), &nbsp; &nbsp; background_color: masterPage.get('background_color'), &nbsp; &nbsp; gridcolor: masterPage.get('gridcolor'), &nbsp; &nbsp; grid_type: masterPage.get('grid_type'), &nbsp; &nbsp; scale_number: masterPage.get('scale_number'), &nbsp; &nbsp; scale_units: masterPage.get('scale_units'), &nbsp; &nbsp; gridlabels: masterPage.get('gridlabels'), &nbsp; &nbsp; diagonaltype: masterPage.get('diagonaltype') &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; sendChat('MasterPage','/w gm No page named MASTER found.'); &nbsp; &nbsp; } }); You could imagine an interface where your STA needs to configure a page, so watches page creation and prompts the GM when one is made asking "Should STA configure this new page?" &nbsp;Most interface issues in Roll20 come down to coming up with clever ways to get around limitations. =D &nbsp;I used a similar script for creating a deck of cards. &nbsp;API can't create cards, but can manipulate created cards. &nbsp;When a deck of a given name had a card added, it would configure it to the next card that needed to be created. &nbsp;=D