Quote:
Originally Posted by Raelyn
See, that confuses me, so there is no need to designate functions anymore? Or, alternatively, there is no need to set up triggers? The function itself is a trigger?
So instead of writing:
PHP Code:
function ThisStuff(){ stuff; }
if (trigger){ ThisStuff(); }
I can just do:
PHP Code:
function onThisStuffTrigger(){ stuff; }
and it would act the same?
|
Well, no.
PHP Code:
// This is an event that occurs when the WNPC is updated
function onCreated() {
this.string = "foo";
}
function onTrigger() {
this.string = "bar";
}
Since onTrigger() isn't triggered, this.string will be "foo"
However,
PHP Code:
function onCreated() {
this.string = "foo";
onTrigger();
}
function onTrigger() {
this.string = "bar";
}
Would now make this.string equal "bar" since the function is triggered.