Script Language: Conventions: File and Directory Organization


AGAST requires that a specific directory structure be used to store script and resource files so the compiler can determine which files belong to each scene.

Game Directory

A script file is an ASCII text file with the ".s" extension. Those that exist in the game directory are used to declare elements that are accessible by each other, and by all the scenes in the game. Such elements include the player and interface objects, and variables, events, and scripts that are used throughout several scenes.

The name and number of the script files is insignificant; you can use as many or as few as you see fit. It might make sense, for example, to declare each object in its own script file along with all the object-on-object events that apply to it.

Resource files declared in the game directory are immediately available to all scenes without using special syntax.

The name of the game directory is not significant to the compilation process.

Scene Directories

Any number of scene directories may branch from the game directory. In fact, creating a scene directory is how a scene is declared, because the name of that directory is used as the identifier for that scene.

Resource files that are declared in each scene are immediately available within that scene, and can be accessed by game scripts or any other scene scripts using the scope access symbol (::). It is possible to have two or more resources with the same name, as long as they are in different scenes.

Each scene directory contains all the the script and resource files that belong to that scene. As with the game directory, the name and number of script files is in no way significant to the compiler.

See Also...