Quote:
Originally Posted by Tolnaftate2004
Compare:
Old GraalScript
PHP Code:
if (created) {
i=50;
test();
message #v(i);
}
function test() {
i=30;
return;
}
The above code displays "30"
New GraalScript
PHP Code:
function onCreated() {
temp.i=50;
test();
message(temp.i);
}
function test() {
temp.i=30;
return;
}
The above code displays "50"
And another thing, in the editor, I placed two scripts:
PHP Code:
if (created) i=234;
PHP Code:
if (created) message #v(i);
And the second displayed "234"
Let's not confuse people with false information now. Variables without prefixes are global, and have been global (with some exceptions).
|
They are global, but they they are only global to that one NPC. In the new engine, any NPC running in the same scope can access an unprefixed variable. They are removed after script execution is complete, just like the temp.prefix variables.
Try not to correct me unless you know what you're talking about, and what context the question was phrased in.