• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Can you explain me what exactly are libraries, scopes, modules, etc?

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,580
[vJASS] - Globals and Scopes inside
JASS Manual
Not exactly sure what modules are for, but it seems like scopes and libraries are all you'll really need to understand for the most part.

From what I've gathered from those links, you would create a Library to contain a system that your map will use, perhaps a Dummy system for recycling/automating dummy usage. Other Libraries can reference one another, so you can use these functions anywhere.

Scopes on the other hand are basically private Libraries. The private part means that they can't be referenced from the outside. They can however reference Libraries from the inside. One neat feature of a scope, at least if I'm understanding correctly, is that their function names are "private" so you don't have to worry about naming conventions as much. You could have a function named ExampleFunction in your scope, as well as a function with the same name in some Library somewhere else, and they'll both work properly.

So I guess if you were to create a custom spell for instance, a scope would be a great choice. It can reference your Libraries (so you can get your Dummy system, Knockback system, etc...) but it's private so you have less room for errors/syntax issues. It also makes sense to be private, because you most likely don't need other Libraries/code to be referencing any data/functions inside of your Scope. If you do need access to this information, use a Library instead. That is unless there's an even better option that I'm unaware of...

Sorry I can't give you the best answer, I was using GUI for the longest time until I switched over to Lua. Never used anything other than a Library before.
 
Last edited:
Status
Not open for further replies.
Top