Scene: A scene is the entirety of an ADV sequence. From the initial message right up until the game returns to the usual management screens.
- The name field is the name of the scene. This will probably be used to look up the scene internally, and so should be unique in the game
- The narratives field is a hash table of Narrative objects. More about them in a moment
- The default field is the name of the default narrative; the one which would usually start the scene.
- The name field is the narrative name. It is used to index the narratives by scene, and should be unique within a scene.
- The items field is an array of narrative items: snippets, images, etc, etc.
Anyway, let's look at the narrative item classes.
Snippet: represents one message box worth of monologue or dialogue. The basic building blocks of any adventure game.
- The type field is always "snippet". This field is held in common with all the other narrative item classes, and is used to for a sort of half-baked pseudo-polymorphism internally. It's still easier than implementing full inheritance in Lua
- The cut field tells the engine to temporarily drop out of the processing loop and back into the C++ engine. This is so images and menus can be displayed correctly.
- text is the message to be displayed
- image is obsolete. It was intended to change the background image, prior to the image class
- type is always "image" It's a type discriminator field
- path is the path to the image, relative to the application root.
- type is always "func"
- code is a block of Lua code.
userdata.flag1 = true
userdata.flag2 = false
The userdata table is part of the Narrator class, forced into global scope for the Func code. One caveat: don't do this:
function set_flags()
userdata.flag1 = true
userdata.flag2 = false
end
If you do, the function will be defined, but never called, which probably isn't what you want.
Heading: This tells the engine to display a chapter heading that sets the scene for the exchange to follow.
- type is always "heading"
- text is the heading text. "Waking up is hard to do" for instance.
- timeout_ms is the timeout in milliseconds before the heading screen is removed. Default is 5000, or 5 seconds
- image is a background image to go with the caption.The plan was originally to overlay a translucent black layer on the opening image of the next scene, but I couldn'd make that work. This would give a way to achieve the same effect - but it's not implemented. Mainly because I think the black background works well enough.
- type is always "thumbnail"
- image is the path of the thumnail image, relative to the application root
- location is "left" or "right" and defines the side of the text box on which the image will appear
- operation is "show" or "hide". Thumbnails, once shown will remain visible until hidden.
Option: This is basically one menu item.
- text is the menu test to display
- next is the name of the narrative to start if this option is taken
No comments:
Post a Comment