Sadly I find the wiki lacking one thing(I've yet to see skyld's though), and that is actually what goes in commands. All it tells you is if it's a floating, integer, or string. That doesn't really help much...
Anyways, for Switch:
PHP Code:
function onCreated()
{
player.chat = "Stuff.";
}
function onCreated() // This is a function. Before GS2, things like this were called in events. Basically, if it happened, execute any code in the parenthesis. In GS1, it would be if (created) {}, but all that changed in GS2. Events were translated into their own functions. So basically this means, when the NPC is created, execute everything in the parenthesis.
{...} // As explained above, parenthesis are closed around any amount of commands executed when an event is called. All commands must be executed with an event/function and closed inside parenthesis.
player.chat = "Stuff."; // player.* is associated with anything for the player. This can be player.hearts, for their hearts, player.ap, for their ap, player.x, for their x coordinate, and so on. So, taking that, and taking the knowledge that = is assign, means that you are assigning something to the player's chat, which means you'll force them to say something. "Stuff." is a string. A string is alphanumerical. That means anything not a variable, floating value, integer, has to be enclosed in quotes, or else it won't be assigned. If you want to get basic, text has to be in quotes. And lastly, the semi-colon has to be after every command. Anytime you do 'something' end it with a semi-colon before you move onto the next thing.