Game Development Reference
In-Depth Information
If the scripting system has a feature which allows you to place comments
into the scripts, you should always take advantage of this and put in comments
at every opportunity. Comments are useful as a reminder to you, but also help
others who are working on the scripts - implementing puzzle logic or facial
animation for the characters, say.They can also be a useful help in the studio
when recording the voices as the comments will be able to put each small
section of script into context. If we take our script and put in a few suitable
comments it may look like the following.
if(wilks_shooting == false)
{
// Edwards launches straight into his first line of questioning with no pre-
amble
Edwards: I heard that you witnessed the shooting.
Wilks: That so? // Nervous, but puts on brave face
Edwards: Just tell me what happened!
Wilks: Get lost! I didn't see nothing!
// Edwards looks angry - he should have handled it better
wilks_shooting = true;
}
The double slash (//) and the italics is a common style of putting comments
into code. As the game scripts are a simple form of code, it helps if such
conventions are maintained. Because comments are never compiled into the
final code, even a comment written at the end of a line will not appear on
screen if the dialogue lines are displayed as subtitles.
Comments are also useful for keeping track of any logic that might be a
part of the dialogue scripts. Sometimes the dialogue itself will not tell you
where the scene snippet lies in the bigger picture and a comment is neces-
sary. If the game allows the player the freedom to talk to characters repeatedly,
it is sometimes necessary to create a generic line or two so that there is a
response of some kind. The logic is pretty simply and, with comments, may
go something like this:
if(wilks_shooting == false) // Talk about shooting for first time
{
// Edwards launches straight into his first line of questioning with no pre-
amble
Search Nedrilad ::




Custom Search