Document the behavior of LNVL.LoadScript() under debug mode
Rename LNVL.Instruction.forOpcode to LNVL.Instruction.ForOpcode

This is a simple capitalization change but creates consistency with
the (growing) convention of beginning publically accessible property
names with a capital letter.
Capitalize the LNVL.Graphics.DrawContainer and DrawText functions

Functions that are not considered class methods begin with a capital
letter for consistency.  Thus we should have Graphics.DrawContainer()
but Scene:drawContainer().  This patch changes two functions in the
Graphics module so that they begin with capital letters.
Teach Character objects to draw themselves to the screen

This patch implements a simple Character:draw() method that will
render the character’s avatar to the screen.  This does not provide
any functionality we do not already have, but it will help clarify our
intent in other parts of the code by making it more obvious what we
mean to draw.
Keep a list of active characters in scenes and draw them

One problem with LNVL is that we only draw characters on screen when
they are speaking lines.  If you look at visual novels you will see
that they rarely behave this way.  Once a character enters a scene he
or she almost always remains on screen until explicitly dismissed.

This patch is the first step in making LNVL behave that way.  Be begin
by adding an ‘activeCharacters’ property to the Scene class.  It is a
table that contains all of the active characters in the scene, meaning
the characters which should appear on screen every time we render the
contents of the Scene object.  We perform this rendering when we call
the drawEssentialElements() method.

All we do in this patch is define the table of active characters and
loop through it, drawing each character when we draw the scene.
However, we do not actually populate the table with any Character
objects with this code, so it has no noticeable effect.
Populate the active character list in scenes

We have a list of active characters for each Scene object but this
patch implements the logic that actually puts Character objects into
that list.  We want to activate a character, i.e. add it to that list,
based on the current opcode we are looking at for each piece of
content in a scene.  So for example, if the current opcode is ‘say’
and that opcode has an associated Character object in its ‘arguments’
property then we add that Character to the list of active characters.
That way a character becomes active when he or she speaks.

With this patch in place character images will remain on screen even
when a character is not speaking or performing an action, so long as
the character is active.  But a problem with this patch is that we
have no way to deactivate a character.
Implement Character:leavesTheScene()

This method gives us a way to remove characters from scenes so that
LNVL will stop drawing them.  We need this for story scripts so that
we can do things such as have characters exit a scene.

To remove a character we use a new opcode: ‘deactivate-character’.
The name reflects the fact that we remove a character by taking him or
her out of a scene’s ‘activeCharacters’ table.  We configure the
opcode to generate a ‘no-op’ instruction but we actually avoid
executing the instruction.  When we draw the contents of a Scene
object we see if the current opcode is ‘deactivate-character’, and if
so we remove the character from that list and then immediately stop
before we convert that opcode to a ‘no-op’ instruction.  Since we know
that opcode is a no-op we can exit the drawing routine as soon as we
see it.
Add an example script demonstrating Character:leavesTheScene()
Document Character:leavesTheScene() in the Howto guide
Do not return a ‘draw-character’ opcode from Character:becomes()

Now that scenes automatically render active characters we do not need
the becomes() method to return a ‘draw-character’ opcode.  The scene
will draw the character for us.
Replace the ‘draw-character’ opcode with a ‘move-character’ opcode

Scenes in LNVL originally had no information about characters
appearing in the scene.  The ‘draw-character’ opcode was a way to
explicitly tell LNVL when to render a character on screen.  Another
responsibility of the opcode was to update the position of the
character by changing the ‘position’ property of the character’s
current image.

Now that the Scene class keeps a list of active characters and
automatically draws them we no longer need the ‘draw-character’
opcode.  This patch removes all of the code for situations where we
previously created that opcode.  The active character list inside of
Scene objects takes care of drawing characters for us and we can
safely rely on that without having to tell LNVL when to draw
characters via opcodes.

But we do need to maintain the second responsibility of
‘draw-character’: changing a character’s position as needed.  We keep
this behavior by replacing ‘draw-character’ with the new
‘move-character’ opcode.  That opcode updates the position of a given
Character object.  And in order for the position change to have full
effect we teach Character:draw() to propagate that change.  So if we
change the value of ‘Character.position’ that method will assign the
same value to ‘Character.images[Character.currentImage].position’,
guaranteeing the character appears on screen in the correct place.

A side-effect of this change is that we can make the ‘say’ opcode
processor a no-op.  Previously we would have to generate an additional
‘draw-character’ opcode so that speaking characters would appear on
screen.  But that is no longer necessary and thus the ‘say’ opcode has
nothing else to do during processing.
Stop Character:draw() from crashing when a character has no image

The Scene class always draws all activate characters.  Yet some of
those characters may have no image since we do not require an image
when defining a character.  Characters without images cause LNVL to
crash since Scene blindly tries to draw all of them without checking
to see if they actually have an image to draw.  This patch prevents
that crash by adding a test to Character:draw() to only render the
character’s image if it actually exists.  This allows Scene to
continue calling draw() for all active characters while avoiding any
method calls on nil values.
Merge branch 'keep-characters-on-screen'

* keep-characters-on-screen:
  Stop Character:draw() from crashing when a character has no image
  Replace the ‘draw-character’ opcode with a ‘move-character’ opcode
  Do not return a ‘draw-character’ opcode from Character:becomes()
  Document Character:leavesTheScene() in the Howto guide
  Add an example script demonstrating Character:leavesTheScene()
  Implement Character:leavesTheScene()
  Populate the active character list in scenes
  Keep a list of active characters in scenes and draw them
  Teach Character objects to draw themselves to the screen