Scar Overview

Welcome to Scardoc, the dynamically generated Scar library.

For those new to Scardoc here are some things to remember:

Examples

Example 1: Understanding the Function

Void SGroup_SetPlayerOwner( SGroupID sgroup, PlayerID owner )

An example of using this particular function would be: SGroup_SetPlayerOwner(sg_defenders, player1)

A description will usually follow, indicating to some extent the way in which the function is intended to be utilized.

Example 2: Finding the Source

This very useful feature allows you to track the function to its source file and line number. When in doubt, it is sometimes useful to find the function in the code base to get a better understanding of how it works.

Get Your Function On

Creating your own *.scar file is fun and easy:

  1. Make a new file in any text editor
  2. When you save the file, give it the same name as the *.sgb file you wish to use it with(1) and save it with the extension .scar
  3. When you run the map in game, your scar file, and all of its functionality should be active and available.(2)
(1) If the *.sgb file already has an associated *.scar file, it is recommended that you use the import("filename") function to call your own file instead of walking over the existing file.

(2) Remember to use good naming conventions, Lua operates globally across all active script files. This means that your function names and variables must be unique to your file or you run the risk of conflicting accidentally with another script.

When the game engine reads your *.scar file, anything in the global scope will be immediately called. This may cause problems as some functions are not meant to be used until the game has loaded up all of its components.

The function Scar_AddInit( FunctionName ) can be used to kick off your script. This tells the game engine "When you are ready, call the function FunctionName first."



Happy Scripting

Despite its flaws, Scardoc is an excellent reference tool and we hope you enjoy using it as much as we do.