SQF-VM - An SQF Emulator

  • Sonstiges

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • SQF-VM - An SQF Emulator


    SQF-VM
    Der SQF Emulator
    Eine voll funktionstüchtige, open-source Virtual Machine für die Skriptsprache der ArmA Spiele.
    Links


    FAQ
    • Wie benutzt man das Ding?
      Um die SQF-VM zu starten, müssen Sie nur die Anwendung starten.
    • Wofür kann es verwendet werden (Beispiele)?
      Das offensichtlichste Beispiel ist: Sie benutzen einen Laptop auf Reisen und wollen SQF Code testen.Fortgeschrittene Benutzer könnten mithilfe des Tools auch Unit-Tests gestalten.
    • Gibt es Kommandozeilenparameter für z.B. Unit-Tests?
      Ja, gibt es. Starten Sie das Tool über die Kommandozeile und mit den Parameter -? um alle zu bekommen.
    • Was wird unterstützt?
      Um zu Prüfen was unterstützt ist und was nicht existiert der `help__ "name"` befehl.
      Wenn der befehl ausgegeben wird und eine beschreibung hat, ist er unterstützt.
      Alle anderen fälle jedoch leider noch nicht.
    • Ich habe einen Fehler gefunden, was soll ich jetzt tun?
      Versuchen Sie, das Problem so weit wie möglich einzugrenzen (minimales beispiel) und gehen Sie dann nach GitHub, um den Fehler zu melden.
    • Ich habe eine Frage, die hier nicht beantwortet wird, was tun?
      Stellen Sie Ihre Frage in diesem Thread oder im Discord Channel und ich füge sie eventuell in das FAQ ein :)


    Downloads
    Alle Releases können auch auf Github gefunden werden.

    Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von X39 () aus folgendem Grund: 1.0-RC1

  • github.com/X39/sqf-vm/releases/tag/0.1.2-alpha

    Quellcode

    1. Added more checks to FOR
    2. fix
    3. re-fixed endless attempt to parse empty blocks
    4. Added Switch case do
    5. Added ForEach
    6. fixed parser
    7. fix
    8. Moved OBJECT type into its own file
    9. fixed array parsing
    10. Fixed array order
    11. Added productversion
    12. added missing comparison types to ==, added !=
    13. Added velocity and setVelocity
    14. Added getPos, position and setPos
    15. Added typeOf
    16. added setVariable & getVariable
    17. malloc sizeof from pointer to actual struct
    18. fixed invalid malloc sizeof
    19. fixed copy-paste error
    20. Added createVehicle
    21. Added OBJECT type
    22. fixed last token getting proper textrange info
    23. fixed empty string not terminated segfault
    24. unterminated strings are no longer trimmed by 2 chars
    25. Added COUNT type to vm types
    Alles anzeigen
    Nächster release wird vermutlich sides & groups enthalten
  • Released SQF-VM Standalone Alpha 0.1.4 (tool allowing you to run arbitrary sqf code) github.com/X39/sqf-vm/releases/tag/0.1.4-alpha
    As usual, the hint that the Discord-Server contains a bot that allows you to run the code inside of discord.

    Highlights of this version:
    • support for `spawn` (executed after the sync context of the VM is done, might suspend a script to give other scripts a chance to run)
    • support for config parsing (during runtime, use `configFile mergeFrom__ parseConfig__ "<YOUR CONFIG>"`)
    • Changes to the command line parameters (making old scripts possibly outdated)


    Changelog:

    Quellcode

    1. SCRIPT:t:0:(null)
    2. CONFIG:t:0:(null)
    3. configFile:n:4:nil
    4. selectRandom:u:4:selectRandom <ARRAY>
    5. getText:u:4:getText <CONFIG>
    6. tolower:u:4:tolower <STRING>
    7. vectorNormalized:u:4:vectorNormalized <VECTOR3D>
    8. toupper:u:4:toupper <STRING>
    9. isArray:u:4:isArray <CONFIG>
    10. isText:u:4:isText <CONFIG>
    11. vectorMagnitude:u:4:vectorMagnitude <VECTOR3D>
    12. isNumber:u:4:isNumber <CONFIG>
    13. getNumber:u:4:getNumber <CONFIG>
    14. inheritsFrom:u:4:inheritsFrom <CONFIG>
    15. isClass:u:4:isClass <CONFIG>
    16. getArray:u:4:getArray <CONFIG>
    17. reverse:u:4:reverse <ARRAY>
    18. scriptDone:u:4:scriptDone <SCRIPT>
    19. vectorMagnitudeSqr:u:4:vectorMagnitudeSqr <VECTOR3D>
    20. >>:b:4:<CONFIG> >> <STRING>
    21. vectorMultiply:b:4:<VECTOR3D> ectorMultiply <SCALAR>
    22. vectorDistance:b:4:<VECTOR3D> vectorDistance <VECTOR3D>
    23. vectorDistanceSqr:b:4:<VECTOR3D> vectorDistanceSqr <VECTOR3D>
    24. vectorDiff:b:4:<VECTOR3D> vectorDiff <VECTOR3D>
    25. spawn:b:4:<ANY> spawn <CODE>
    26. resize:b:4:<ARRAY> resize <SCALAR>
    27. vectorDotProduct:b:4:<VECTOR3D> vectorDotProduct <VECTOR3D>
    28. vectorAdd:b:4:<VECTOR3D> vectorAdd <VECTOR3D>
    29. vectorCos:b:4:<VECTOR3D> vectorCos <VECTOR3D>
    30. createUnit:b:4:<GROUP> createUnit <ARRAY>
    31. deleteAt:b:4:<ARRAY> deleteAt <SCALAR>
    32. append:b:4:<ARRAY> append <ARRAY>
    33. find:b:4:<ARRAY> find <ANY>#<STRING> find <STRING>
    34. exitWith:b:4:<IF> exitWith <CODE>
    35. /:b:7:<SCALAR> / <SCALAR> | <CONFIG> / <STRING>
    36. arrayIntersect:b:4:<ARRAY> arrayIntersect <ARRAY>
    37. vectorCrossProduct:b:4:<VECTOR3D> vectorCrossProduct <VECTOR3D>
    38. mergefrom__:b:4:<CONFIG> mergefrom__ <CONFIG>
    39. parseconfig__:u:4:parseconfig__ <STRING>
    Alles anzeigen
  • Release version 1.0

    Kein Changelog da vollständiger neuschreib (dafür neue features wie debugger interface <3).

    --Help ausgabe:

    Quellcode

    1. .\sqfvm-cpp.exe --help
    2. USAGE:
    3. D:\Git\SQF-VM\Release\Windows\x64\sqfvm-cpp.exe [--pretty-print <PATH>]
    4. ... [-c] [-N] [-n] [-p <NUMBER>]
    5. [-m <NUMBER>] [-s] [-a] [-R <CODE>]
    6. ... [-r <CODE>] ... [-F <PATH>]
    7. ... [-f <PATH>] ... [--]
    8. [--version] [-h]
    9. Where:
    10. --pretty-print <PATH> (accepted multiple times)
    11. Loads provided file from disk and pretty-prints it onto console.
    12. -c, --disable-classname-check
    13. Disables the config checking for eg. createVehicle.
    14. -N, --no-execute-print
    15. Prevents the `Execute` and two horizontal lines to be printed.
    16. -n, --no-print
    17. Prevents the value stack to be printed out at the very end.
    18. -p <NUMBER>, --server-port <NUMBER>
    19. Sets the port of the server. Defaults to 9090.
    20. -m <NUMBER>, --max-instructions <NUMBER>
    21. Sets the maximum ammount of instructions to execute before a hard exit
    22. may occur. Setting this to 0 will disable the limit.
    23. -s, --start-server
    24. Causes the sqf-vm to start a network server allowing for automated
    25. control.
    26. -a, --no-prompt
    27. Disables the prompt which expects you to type in sqf-code.
    28. -R <CODE>, --config-code <CODE> (accepted multiple times)
    29. Loads provided config-code directly into the sqf-vm. (executed after
    30. files)
    31. -r <CODE>, --sqf-code <CODE> (accepted multiple times)
    32. Loads provided sqf-code directly into the sqf-vm. (executed after
    33. files)
    34. -F <PATH>, --config-file <PATH> (accepted multiple times)
    35. Loads provided config-file from the hdd into the sqf-vm.
    36. -f <PATH>, --sqf-file <PATH> (accepted multiple times)
    37. Loads provided sqf-file from the hdd into the sqf-vm.
    38. --, --ignore_rest
    39. Ignores the rest of the labeled arguments following this flag.
    40. --version
    41. Displays version information and exits.
    42. -h, --help
    43. Displays usage information and exits.
    44. Emulates the ArmA-Series SQF environment.
    Alles anzeigen



    Support:

    Quellcode

    1. [
    2. ["n", "parsingnamespace"],
    3. ["n", "pi"],
    4. ["n", "nil"],
    5. ["n", "east"],
    6. ["n", "missionnamespace"],
    7. ["n", "cmds__"],
    8. ["n", "uinamespace"],
    9. ["n", "profilenamespace"],
    10. ["n", "productversion"],
    11. ["n", "diag_ticktime"],
    12. ["n", "allobjects__"],
    13. ["n", "true"],
    14. ["n", "false"],
    15. ["n", "confignull"],
    16. ["n", "configfile"],
    17. ["n", "blufor"],
    18. ["n", "west"],
    19. ["n", "opfor"],
    20. ["n", "resistance"],
    21. ["n", "independent"],
    22. ["n", "civilian"],
    23. ["n", "sideempty"],
    24. ["n", "sideenemy"],
    25. ["n", "grpnull"],
    26. ["n", "sidefriendly"],
    27. ["n", "sidelogic"],
    28. ["n", "sideunknown"],
    29. ["n", "objnull"],
    30. ["u", "abs", "SCALAR"],
    31. ["u", "round", "SCALAR"],
    32. ["u", "sqrt", "SCALAR"],
    33. ["u", "deg", "SCALAR"],
    34. ["u", "acos", "SCALAR"],
    35. ["u", "selectmax", "ARRAY"],
    36. ["u", "log", "SCALAR"],
    37. ["u", "sin", "SCALAR"],
    38. ["u", "toupper", "STRING"],
    39. ["u", "tan", "SCALAR"],
    40. ["u", "exp", "SCALAR"],
    41. ["u", "rad", "SCALAR"],
    42. ["u", "random", "SCALAR"],
    43. ["u", "hint", "STRING"],
    44. ["u", "hint", "TEXT"],
    45. ["u", "-", "SCALAR"],
    46. ["u", "systemchat", "STRING"],
    47. ["u", "+", "SCALAR"],
    48. ["u", "+", "NaN"],
    49. ["u", "+", "ARRAY"],
    50. ["u", "!", "BOOL"],
    51. ["u", "floor", "SCALAR"],
    52. ["u", "count", "ARRAY"],
    53. ["u", "count", "STRING"],
    54. ["u", "count", "CONFIG"],
    55. ["u", "cei", "SCALAR"],
    56. ["u", "asin", "SCALAR"],
    57. ["u", "selectmin", "ARRAY"],
    58. ["u", "ln", "SCALAR"],
    59. ["u", "atan", "SCALAR"],
    60. ["u", "allvariables", "NAMESPACE"],
    61. ["u", "allvariables", "OBJECT"],
    62. ["u", "allvariables", "GROUP"],
    63. ["u", "atg", "SCALAR"],
    64. ["u", "isnil", "STRING"],
    65. ["u", "isnil", "CODE"],
    66. ["u", "units", "GROUP"],
    67. ["u", "units", "OBJECT"],
    68. ["u", "cos", "SCALAR"],
    69. ["u", "private", "STRING"],
    70. ["u", "private", "ARRAY"],
    71. ["u", "vectormagnitude", "ARRAY"],
    72. ["u", "format", "ARRAY"],
    73. ["u", "scriptdone", "SCRIPT"],
    74. ["u", "vectormagnitudesqr", "ARRAY"],
    75. ["u", "vectornormalized", "ARRAY"],
    76. ["u", "call", "CODE"],
    77. ["u", "with", "NAMESPACE"],
    78. ["u", "default", "CODE"],
    79. ["u", "comment", "STRING"],
    80. ["u", "compile", "STRING"],
    81. ["u", "while", "CODE"],
    82. ["u", "typename", "ANY"],
    83. ["u", "str", "ANY"],
    84. ["u", "for", "STRING"],
    85. ["u", "if", "BOOL"],
    86. ["u", "selectrandom", "ARRAY"],
    87. ["u", "reverse", "ARRAY"],
    88. ["u", "tolower", "STRING"],
    89. ["u", "case", "ANY"],
    90. ["u", "switch", "ANY"],
    91. ["u", "params", "ARRAY"],
    92. ["u", "diag_log", "ANY"],
    93. ["u", "tree__", "STRING"],
    94. ["u", "typeof", "OBJECT"],
    95. ["u", "help__", "STRING"],
    96. ["u", "configparse__", "STRING"],
    97. ["u", "toarray", "STRING"],
    98. ["u", "tostring", "ARRAY"],
    99. ["u", "configname", "CONFIG"],
    100. ["u", "confighierarchy", "CONFIG"],
    101. ["u", "inheritsfrom", "CONFIG"],
    102. ["u", "isnumber", "CONFIG"],
    103. ["u", "istext", "CONFIG"],
    104. ["u", "isclass", "CONFIG"],
    105. ["u", "isarray", "CONFIG"],
    106. ["u", "getnumber", "CONFIG"],
    107. ["u", "gettext", "CONFIG"],
    108. ["u", "getarray", "CONFIG"],
    109. ["u", "creategroup", "SIDE"],
    110. ["u", "groupid", "GROUP"],
    111. ["u", "deletegroup", "GROUP"],
    112. ["u", "createvehicle", "ARRAY"],
    113. ["u", "deletevehicle", "OBJECT"],
    114. ["u", "position", "OBJECT"],
    115. ["u", "getpos", "OBJECT"],
    116. ["u", "velocity", "OBJECT"],
    117. ["b", "SCALAR", "min", "SCALAR"],
    118. ["b", "SCALAR", "atan2", "SCALAR"],
    119. ["b", "OBJECT", "domove", "ARRAY"],
    120. ["b", "ARRAY", "domove", "ARRAY"],
    121. ["b", "SCALAR", "^", "SCALAR"],
    122. ["b", "CODE", "foreach", "ARRAY"],
    123. ["b", "ARRAY", "vectordiff", "ARRAY"],
    124. ["b", "ARRAY", "vectoradd", "ARRAY"],
    125. ["b", "SCALAR", "max", "SCALAR"],
    126. ["b", "ANY", "!=", "ANY"],
    127. ["b", "SIDE", "!=", "SIDE"],
    128. ["b", "STRING", "!=", "STRING"],
    129. ["b", "OBJECT", "!=", "OBJECT"],
    130. ["b", "GROUP", "!=", "GROUP"],
    131. ["b", "TEXT", "!=", "TEXT"],
    132. ["b", "CONFIG", "!=", "CONFIG"],
    133. ["b", "DISPLAY", "!=", "DISPLAY"],
    134. ["b", "CONTRO", "!=", "CONTRO"],
    135. ["b", "LOCATION", "!=", "LOCATION"],
    136. ["b", "ARRAY", "set", "ARRAY"],
    137. ["b", "SCALAR", "mod", "SCALAR"],
    138. ["b", "SCALAR", "-", "SCALAR"],
    139. ["b", "ARRAY", "-", "ARRAY"],
    140. ["b", "SCALAR", "%", "SCALAR"],
    141. ["b", "ARRAY", "pushback", "ANY"],
    142. ["b", "SCALAR", "+", "SCALAR"],
    143. ["b", "ARRAY", "+", "ARRAY"],
    144. ["b", "STRING", "+", "STRING"],
    145. ["b", "SCALAR", "*", "SCALAR"],
    146. ["b", "SCALAR", "/", "SCALAR"],
    147. ["b", "CONFIG", "/", "STRING"],
    148. ["b", "ARRAY", "vectorcos", "ARRAY"],
    149. ["b", "SCALAR", ">", "SCALAR"],
    150. ["b", "ARRAY", "append", "ARRAY"],
    151. ["b", "ARRAY", "resize", "SCALAR"],
    152. ["b", "ARRAY", "vectorcrossproduct", "ARRAY"],
    153. ["b", "IF", "exitwith", "CODE"],
    154. ["b", "ANY", "call", "CODE"],
    155. ["b", "ARRAY", "vectordistance", "ARRAY"],
    156. ["b", "BOOL", "&&", "BOOL"],
    157. ["b", "BOOL", "&&", "CODE"],
    158. ["b", "SWITCH", ":", "CODE"],
    159. ["b", "ARRAY", "select", "SCALAR"],
    160. ["b", "ARRAY", "select", "BOOL"],
    161. ["b", "ARRAY", "select", "ARRAY"],
    162. ["b", "ARRAY", "select", "CODE"],
    163. ["b", "STRING", "select", "ARRAY"],
    164. ["b", "CONFIG", "select", "SCALAR"],
    165. ["b", "ARRAY", "vectordistancesqr", "ARRAY"],
    166. ["b", "ANY", "spawn", "CODE"],
    167. ["b", "ARRAY", "vectordotproduct", "ARRAY"],
    168. ["b", "SCALAR", "<=", "SCALAR"],
    169. ["b", "ARRAY", "vectormultiply", "SCALAR"],
    170. ["b", "SCALAR", ">=", "SCALAR"],
    171. ["b", "WITH", "do", "CODE"],
    172. ["b", "WHILE", "do", "CODE"],
    173. ["b", "FOR", "do", "CODE"],
    174. ["b", "SWITCH", "do", "CODE"],
    175. ["b", "NAMESPACE", "getvariable", "STRING"],
    176. ["b", "NAMESPACE", "getvariable", "ARRAY"],
    177. ["b", "OBJECT", "getvariable", "STRING"],
    178. ["b", "OBJECT", "getvariable", "ARRAY"],
    179. ["b", "GROUP", "getvariable", "STRING"],
    180. ["b", "GROUP", "getvariable", "ARRAY"],
    181. ["b", "SCALAR", "==", "SCALAR"],
    182. ["b", "SIDE", "==", "SIDE"],
    183. ["b", "STRING", "==", "STRING"],
    184. ["b", "OBJECT", "==", "OBJECT"],
    185. ["b", "GROUP", "==", "GROUP"],
    186. ["b", "TEXT", "==", "TEXT"],
    187. ["b", "CONFIG", "==", "CONFIG"],
    188. ["b", "DISPLAY", "==", "DISPLAY"],
    189. ["b", "CONTRO", "==", "CONTRO"],
    190. ["b", "LOCATION", "==", "LOCATION"],
    191. ["b", "FOR", "step", "SCALAR"],
    192. ["b", "NAMESPACE", "setvariable", "ARRAY"],
    193. ["b", "OBJECT", "setvariable", "ARRAY"],
    194. ["b", "GROUP", "setvariable", "ARRAY"],
    195. ["b", "OBJECT", "setvelocity", "ARRAY"],
    196. ["b", "ARRAY", "joinstring", "STRING"],
    197. ["b", "CODE", "count", "ARRAY"],
    198. ["b", "STRING", "callextension", "STRING"],
    199. ["b", "STRING", "callextension", "ARRAY"],
    200. ["b", "IF", "then", "ARRAY"],
    201. ["b", "IF", "then", "CODE"],
    202. ["b", "CODE", "else", "CODE"],
    203. ["b", "FOR", "from", "SCALAR"],
    204. ["b", "FOR", "to", "SCALAR"],
    205. ["b", "SCALAR", "<", "SCALAR"],
    206. ["b", "ARRAY", "apply", "CODE"],
    207. ["b", "ARRAY", "deleteat", "SCALAR"],
    208. ["b", "ARRAY", "arrayintersect", "ARRAY"],
    209. ["b", "ARRAY", "find", "ANY"],
    210. ["b", "STRING", "find", "STRING"],
    211. ["b", "ARRAY", "params", "ARRAY"],
    212. ["b", "CONFIG", "merge__", "CONFIG"],
    213. ["b", "ANY", "createvehiclelocal", "ANY"],
    214. ["b", "BOOL", "and", "BOOL"],
    215. ["b", "BOOL", "and", "CODE"],
    216. ["b", "BOOL", "||", "BOOL"],
    217. ["b", "BOOL", "||", "CODE"],
    218. ["b", "BOOL", "or", "BOOL"],
    219. ["b", "BOOL", "or", "CODE"],
    220. ["b", "ANY", "isequalto", "ANY"],
    221. ["b", "STRING", "createvehicle", "ARRAY"],
    222. ["b", "ANY", "isequaltype", "ANY"],
    223. ["b", "CONFIG", ">>", "STRING"],
    224. ["b", "OBJECT", "setpos", "ARRAY"],
    225. ["b", "GROUP", "createunit", "ARRAY"],
    226. ["b", "STRING", "createunit", "ARRAY"]
    227. ]
    Alles anzeigen
    Downloads:
    x39.io/Files/sqfvm/sqfvm-1.0.zip
    github.com/X39/sqf-vm/releases/tag/1.0.0-RC1
  • SQF-VM Release 1.1 (RC1)
    Download
    Changelog

    Quellcode

    1. 1.1 RC1
    2. - Continuous CLI (exit__ command now needs to be used)
    3. - Fixed String-Parsing (had problems handling "somethingendingwith'")
    4. - Fixed : not getting recognized
    5. - Config checking is no longer enabled by default (-c flag now enables config checking instead of disabling it)
    6. - Fixed some debugger-related stuff
    7. - Now contains DebuggerCLI application (sqfvm needs to be started with -s -p 9090 for it to work)
    8. - added nearestObjects
    9. - added distance
    10. - Debugger interface error messages now have status error
    11. - Debugger interface now prints output with status message
    12. - Debugger interface no longer prints the status change twice when hitting breakmode
    13. - Icon was updated (Currently disabled though due to new CMakeList.txt)
    14. - Added isNull <OBJECT> isNull <GROUP> isNull <CONFIG>
    15. - Fixed config commands causing segfaults
    16. - Fixed spawning things prevented further stack execution
    17. - Fixed spawned scopes are not reporting to be schedulable
    18. - Fixed params unary will error-out on non-array _this param
    19. - Added sleep command & corresponding code
    20. - Added canSuspend
    21. - Fixed some internal method to check array types
    22. - Added Marker-System and corresponding commands: [ allMapMarkers, createMarker, createMarkerLocal, deleteMarker, deleteMarkerLocal, getMarkerColor, getMarkerPos, getMarkerSize, getMarkerType, markerAlpha, markerBrush, markerColor, markerDir, markerPos, markerShape, markerSize, markerText, markerType, setMarkerAlpha, setMarkerAlphaLocal, setMarkerBrush, setMarkerBrushLocal, setMarkerColor, setMarkerColorLocal, setMarkerDir, setMarkerDirLocal, setMarkerPos, setMarkerPosLocal, setMarkerShape, setMarkerShapeLocal, setMarkerSize, setMarkerSizeLocal, setMarkerText, setMarkerTextLocal, setMarkerType, setMarkerTypeLocal ]
    23. - productVersion now outputs full version information
    24. - productVersion now will tell properly if it is x64 or x86 (or NA on some compilers and systems)
    25. - Added side <OBJECT> and side <GROUP>
    26. - DllExports no longer allow sleep
    27. - Fixed _this not getting set properly in <ANY> call <CODE>
    28. - Added vm__ command to get a list of vm-only commands
    29. - Added cmdsimplemented__ command to get a list of actually implemented commands (checks for missing description and ommits those)
    30. - Added allUnits
    31. - No longer printing space inbetween array commas when stringified
    32. - implemented toFixed
    33. - Fixed <ARRAY> select <BOOL> help message
    34. - fixed pretty printing would not add a space character between private and the variable
    35. - altered the "greeting" message on prompt
    36. - fixed -s debugging server not connecting
    37. - implemented <ARRAY> pushBackUnique <ANY>
    38. - implemented <ARRAY> findIf <CODE>
    39. - fixed SQF parser was detecting expressions like _x == 1 as assignment
    40. - fixed non-scheduled execution was continuing executing after error
    41. - fixed scheduled execution was not continuing executing after error
    Alles anzeigen