When you make a game you can split it in several basic parts: coding, graphics, sound, story…
If we talk about the code we think in C/C+/C#/Java programmers who create the graphic motor, give a behaviour to the game elements, etc. but usually we don’t think in a game script, which is an element very usual in games nowadays. To make it clear, a script is another type of code that says how the game behaves in some parts of the execution. For example: when you enter the room X, trigger a dialog between characters A and B.
More and more games are based on script actions. Games, like World of Warcraft, are no more than a motor (a very good motor, that is) and a lot of scripts creating stories, defining foes’ positions, treasures and controlling the rest of the game elements.
The biggest difference between the programmed code and the scripted one is that the first one is compiled meanwhile the second one is interpreted. Compiled code runs faster and is directly executed by the hardware CPU in which the code is running (a PC in this case). Interpreted code needs to be transformed to compiled code in runtime and then is executed. Both things have their pros and cons but in a nutshell compiled code is faster and that’s why is in charge of the heaviest things like the graphic motor, sound management, etc. Scripted one is more flexible and it’s used to guide the story and create events in each moment.
Speaking in a lower level, the behaviour could be put in this way:

On the one hand, we have the code written in a programming language, let’s say C++. This code needs to be compiled to generate an executable file (a .exe file in MS Windows systems).
On the other hand, the script written in a scripting language we are using is in another file(s), which are read by the scripting motor at the beggining of the game. Later, when needed in runtime this scripting motor takes each line and associate it with an already written-and-compiled function included in the compiled executable which gives us a visible action in the game.
An example of an interpreted language is the well known SCUMM system used to create Maniac Mansion, Monkey Island, Indiana Jones and Day of the Tentacle among others. SCUMM name is nothing more than Script Creation Utility for Maniac Mansion (and developers used it for the name of the bar in Monkey Island). Funny right? Nowadays we can find an open source script motor for reading SCUMM written games called ScummVM, available for several platforms.
Another example, and maybe the best known, is the Java programming language which uses its JVM (Java Virtual Machine) as script motor. That’s why it’s said that Java is slower than C (interpreted code vs compiled one) and it’s true. But it’s also true that the same Java code can be run in every system with a JVM (like Windows, Linux, Mac or Android). This virtual machine use to be written in a compiled language like C for each platform. Need to point that Java files are preprocessed/precompiled to generate an intermediate language file between compiled and interpreted to reach a better performance, security, packaging, etc.
So, if compiled languages are faster why people use scripted languages?
Basically because once the game and its motor script (or virtual machine) is programmed you can make changes just modifying script files without recompiling source code. That way game designers can work at the same time that programmers while making the game.
Usually, video game studios with resources have their own software to make games and they use apps to create this scripts in an easy way so a game designer can make it without programming knoweldge.
In our first game, Luminaria, we use our own scripting language, a very simple one based on plain text files with functions like loadChar, loadBg, talk… which are preprocessed and packaged so the script motor can interpret them when needed.
If you are interested in how we designed and programmed the virtual machine bases maybe we can write about it, but that’s another story…