Ok, so a WME game contains a lot of "objects". The scene is an object, scene entities are objects, actors, windows, buttons etc. Everything is an object.
Those objects provide properties and methods (such as the SetCursor() method you mentioned).
Now, to be able to call the methods, you need to obtain a reference to the object somehow. There are several ways how to do it. Most commonly, to reference a scene entity, you need to ask the scene to give it to you:
Here you're saying, "hey, scene, give me a reference to a scene entity called 'some_name'". Once you have the reference, you can call methods on it.
Now, the "this" keyword: It's a shortcut that will return a reference to the object which owns the current script.
For example, you create a scene entity called "door" in SceneEdit and you attach a new script to the entity. Since the script is attached to the door entity, the "this" keyword
in this particular script will return a reference to the door entity.
// you can still get the reference the other way, though
// now 'this' and 'door' reference the same object
if (this == door
) Game.
Msg("they are the same object");
The main advantages of 'this' are that
1) It's less typing
2) Multiple objects can share the same script. For example, if your scene contains 10 doors, you can use the same script for all of them, and the 'this' value in each of them will reference one particular door.