Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Scopes:
- Everything inside a scope is private and cannot be accessed from the outside
- When you declare something public inside a scope, it will be moved outside the scope
so you can access it from other libraries and scopes.
- Scopes can be nested:
JASS:
scope Tro
scope lolo
scope lolol
endscope
endscope
endscope
I wouldn't recommend using scopes.
They make library requirements implicit (Meaning they don't make them clear)
Scopes are moved to the end of the map-script.
That's why they're ideal for spells.
Personally, I never use scopes because making implicit requirements is a bad programming practice.
I always use libraries so that I can specify the requirements within the code. Some say "Hey, you
can use a scope and put the requirements in the documentation". Well, reading the documentation
is extraneous (Thanks Bribe ^.^).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.