Vehicle Simulator scripting language 8/10/2009 ---------------------------------------------------- This document details the use and syntax of the Vehicle Simulator scripting language. The scripting language is used for controlling vehicles only and is loaded through the scripts dialog inside the program, scripts names are saved and loaded in the situation files, but the scripts themselves are kept insdie the scripts directory. VSSL ( Vehicle Simulator Scripting Language ) is designed to be very simple and high level, close as possible to natural english. It is not structural and not object oriented in any way. The language controls a state machine in which some states can be turned on or off and all commands are executed in the order they appear. Some commands have immediate effect, while others execute until some conditions are met, these conditions are set and reset by the script. All scripts commands must be in lower case, commands may be entered one command per line, or multiple commands per line, when the syntax of one token is not identified the program tries to read the next token and construct a meaningful script. The language Syntax =================== 1) Comments: ============ Comments may be added once per line, each line which contains double slash is marked as a comment and not interpreted. Example: // This is a comment 2) State commands ================== 2.1 engage This command tuns on engagement mode which is active inside the fly, go, turn, stay, commands. Engagement causes the vehicle to fly or go in the direction of the engaged target, and shoot when the range is smaller than the engagement range. The choice of weapon to use depends upon the range from the target, when smaller than 1000 meters - cannon will be used, when larger a guided weapon is used. Syntax: engage [who] [where] range [max] fire [min] [who] - who to engage : all, me [where] - where to engage : land, sea, air, all [max] - range in nm to engage target [min] - range in nm to shoot target Example: engage all air range 10 fire 3 2.2 disengage This command turn off engagement mode. Example: disengage 2.3 until This command turns on one or more limit checks on which to terminate the fly, go, turn stay, commands, until commands can be repeated to turn on multiple check types. Syntax: until [type] [size] [type] - type of check to activate : distance - stops when segment distance is greater than [size] in nm. time - stops when segment time is greater than [size] in minutes. altitude - stops when altitude is greater than [size] in ft. kills - stops when number of targets killed is greater than [size] fuel - stops when fuel is less than [size] in decimal fraction. 2.4 done This command clears all until check modes. 2.5 verbal This commands turns on/off verbal reports by vehicle running script, when speech is enabled this also speaks the verbal messages. Syntax: verbal [on] [on] - activates the verbal mode : on, off Example: verbal on 3) Mode commands ================ 3.1 fly / go This command flies or goes to a direction or position, engages other vehicles, and stops when this position is readed or one of the until conditions is met. Syntax: fly [type] [size] [altitude] [alt] [type] - type of flight: heading, position, waypoint, origin, airport [alt] - altitude in which to fly in ft Example: fly heading 260 altitude 2000 fly waypoint a fly origin fly position 32.45 35.45 fly airport altitude 1000 3.2 turn This commands instructs the vehicle to turn to either side, engages other vehicles, until a condition is met. Syntax: turn [side] [side] - side to turn : left, right Example: turn left 3.3 stay This command stops the vehicle in place, engages other vehicles, until a condition is met. Example: stay 3.4 takeoff This commands makes the vehicle take off flying straight ahead untill a hight of 500 ft above ground level is reached. Example: takeoff 3.5 land This command lands the vehicle at the nearest runway or at the origin point, makes a landing circuit and touches down perfectly. Example: land 4) Immediate commands ===================== 4.1 bomb This command instructs the vehicle to bomb the current position, when this command follows immediately after fly command the vehicle will bomb the target of the fly command, and fly to CCIP ( continuous compound impact point ) position. Syntax: bomb [count] [count] - number of bombs to drop. Example: fly waypoint a bomb 2 4.2 refuel This command refuels the vehicle. Example: refuel 4.3 break This command explodes and brakes the vehicle. Example: break 4.4 repair This command repairs the vehicle. Example: repair 4.5 eject This command ejects the pilot from the vehicle. Example: eject 4.6 lights This command turns the lights of the vehicle on or off. Syntax: lights [on] [on] - state of lights : on, off 4.6 engine This command turns the engine of the vehicle on or off. Syntax: engine [on] [on] - state of engine : on, off 4.7 horn This command sounds the horn of the vehicle. Example: horn 4.8 print This command prints and speaks a short message. Syntax: print [message] [message] - a short text message. Example: print unknown vehicle please turn back