Hello again!
From my two previous questions I have actually managed to do what I wanted to do. So I could just move on with my life. However, I wanted to produce a plugin out of it and I got stuck.
I decided to create an object with several variables and methods. In the plugin it looks like this:
but when I try to call one of its methods from the Event editor, as soon as the game launches I receive the error message:
"ReferenceError: MyAwesomeObject is not defined"
But I defined it in the plugin. It's supposed to be a global object, because I didn't define it inside any function. So what's the problem?
From my two previous questions I have actually managed to do what I wanted to do. So I could just move on with my life. However, I wanted to produce a plugin out of it and I got stuck.
I decided to create an object with several variables and methods. In the plugin it looks like this:
Code:
var MyAwesomeObject = {
array1: [],
array2: [],
var1: value1,
var2: value2,
boolean: false,
method1: function() {
// what it does goes here
},
method2: function() {
// what it does goes here
}
};
but when I try to call one of its methods from the Event editor, as soon as the game launches I receive the error message:
Code:
MyAwesomeObject.method1();
But I defined it in the plugin. It's supposed to be a global object, because I didn't define it inside any function. So what's the problem?