Scripts are the code that you provide and attach to an Event (Refer See "Events"). A script has an initial skeleton that is provided by the script engine. You enter your script code within this skeleton. The following is a typical script skeleton.
procedure ScriptEvent (var Value : variant);
begin
end;
The first line indicates the name of the script and under all circumstances must not be changed.
The second and fourth line are the begin..end block (ReferSee "Statements") within which you should enter your script. You must not remove this begin...end block. The following is an example of script code being entered - this code adds an entry to the logs during execution of the map.
procedure ScriptEvent (var Value : variant);
begin
loginfo('I want to add this text to the log');
end;
Variables can be declared between the first and second lines. Create a new line directly after the first line and enter your variable declarations. For more information on variables and how to declare them refer to See "Variables". The following is an example of a Integer variable being declared. The variable name is MyVariable
procedure ScriptEvent (var Value : variant);
var MyVariable : Integer
begin
end;
Variable names are not case sensitive in a script. If you declare as MyVariable you can reference it is myvariable