Primer:
A 'global' variable normally refers to a variable with no scope, accessible globally.
IE:
var
thing = 1
mob
new()
if (thing)
thing = 0
Byond has a var keyword, called global. This var keyword is for vars inside of types. IE:
mob
var
global
thing = 1
It means that that var will only exist once for all instances of its type, in this case that var will only exist once for all mobs, ie its shared across everything in it's type. (ie: static in other languages like php/c++/c#/java)
It DOES NOT mean that you can access it everywhere like a global var (from above)
Isn't that confusing? It is to me, and most of the programmers at /tg/station13, as we just had a 3 hour conversation trying to agree on what it does, with most people assuming it made the var global, as in, could be accessed in any scope.
Byond also has another var keyword, called static, it is identical to global, but it's not likely to get confused with a global var (as in, no scope/all scopes)
The static keyword is not documented, but i think it should be, and we should replace the global keyword with static, and depreciate the use of the global keyword.
(PS: reminder that there is also a global object, that acts like src, but for accessing global vars when you have name conflicts with a local var)