I've been studying more about DMB files through experimentation and happen to find the cause of some of the runtime errors involving a global without providing a variable name. When you use it in the form of global << while trying to attempt output (no global variable, but global by itself), it will not be able to what I think is the stack properly.
world << global (Just an example) on the other hand what I think will load the wrong value into the stack, which can cause a misread. This was while I was still researching about DMB files.
Numbered Steps to Reproduce Problem:
Look at two sets of source code below
Code Snippet (if applicable) to Reproduce Problem:
mob
Login()
..()
world << global // 33 00 E5 FF 33 00 03 00 (0300 was meant for normal output operation)
mob
Login()
..()
global << world // 33 00 33 00 E5 FF 03 00 (Loads the load operation from what I can tell instead of world. Of course from what I have right now, there are two forms of the output operator due to the [] macro included in strings.
Expected Results:
Compilation error normally for not including any variable.
Actual Results:
Compiles anyway, though with runtime errors when such procs are run.
Does the problem occur:
Every time? Or how often? Everytime
In other games? N/A
In other user accounts? N/A
On other computers? N/A
When does the problem NOT occur? As long you include a variable or proc name (though this applies to global variables from my testing).
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.) N/A
Workarounds:
Best thing to do is not output to and from global unless you define a global variable. I assume this problem may require digging through possibly ancient code I heard about to at least block such future occurrences.
</<></<>
Descriptive Problem Summary:
'global' can be used seemingly like any other variable, but generally runtimes with weird 'cannot read null.[something]' runtimes on execution
Numbered Steps to Reproduce Problem:
1. Use 'global' for something
2. Runtime
Code Snippet (if applicable) to Reproduce Problem:
Expected Results:
Code above would not compile, or would give meaningful results in the case of testA (and possibly testB/testF/testG)
Actual Results:
Code above compiles, all of testA through testV runtime on the commented line with the commented message.
Does the problem occur:
Every time? Or how often? Every time
In other games? N/A
In other user accounts? Untested
On other computers? Untested
When does the problem NOT occur? Unknown
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown
Workarounds: Don't use global like this?