### HEMTT Launch Executable Path Example Source: https://hemtt.dev/print Demonstrates specifying the Arma 3 executable path for the 'hemtt launch' command, showing both relative and absolute path examples. ```bash # Relative to the Arma 3 directory hemtt launch -e arma3profiling_x64 # Absolute path hemtt launch -e "C:\\Program Files\\Steam\\steamapps\\common\\Arma 3\\arma3_x64.exe" ``` -------------------------------- ### HEMTT CLI: PBO File Extraction Example Source: https://hemtt.dev/print An example command demonstrating how to inspect a specific PBO file ('abe_main.pbo') located in the build output directory. ```CLI hemtt.exe utils pbo inspect .hemttout\build\addons\abe_main.pbo ``` -------------------------------- ### Install HEMTT with Winget Source: https://hemtt.dev/installation/index Installs the HEMTT tool on Windows using the Winget package manager. This command fetches the latest stable version from the Winget repository. ```powershell winget install hemtt ``` -------------------------------- ### HEMTT Launch Optional Addons Example Source: https://hemtt.dev/print Illustrates how to include multiple optional addon folders when launching with 'hemtt launch' using the '-o' flag. ```bash hemtt dev -o caramel -o chocolate ``` -------------------------------- ### HEMTT Addon Path Example Source: https://hemtt.dev/configuration/index Illustrates the expected directory structure for an addon, showing how the 'mainprefix' and 'prefix' are used to form the path. ```text z\abe\addons\main ``` -------------------------------- ### Install or Update HEMTT on Linux/MacOS Source: https://hemtt.dev/installation/index Installs or updates HEMTT on Linux and MacOS systems using a provided installer script fetched via curl. This script handles downloading and setting up HEMTT. ```bash curl -sSf https://hemtt.dev/install.sh | sh ``` -------------------------------- ### Install HEMTT via Script Source: https://hemtt.dev/print Command to install or update HEMTT on Linux and macOS systems using a provided installation script fetched via curl. This script automates the download and setup process. ```shell curl -sSf https://hemtt.dev/install.sh | sh ``` -------------------------------- ### HEMTT Configuration File Example Source: https://hemtt.dev/print Illustrates how to configure HEMTT build options, specifically regarding optional mod folders, within the project.toml file. ```toml [hemtt.build] optional_mod_folders = false ``` -------------------------------- ### Install or Upgrade HEMTT with Winget Source: https://hemtt.dev/print Commands to install HEMTT using the Windows Package Manager (winget) and to upgrade an existing installation. Winget is a convenient tool for managing software on Windows. ```shell winget install hemtt ``` ```shell winget upgrade hemtt ``` -------------------------------- ### HEMTT Project Configuration (project.toml) Source: https://hemtt.dev/commands/launch Example of a `.hemtt/project.toml` file defining default launch settings. This includes workshop IDs, DLCs, optional addons, mission parameters, and executable settings. ```TOML mainprefix = "z" # Launched with `hemtt launch` [hemtt.launch.default] workshop = [ "450814997", # CBA_A3's Workshop ID ] presets = [ "main", # .html presets from .hemtt/presets/ ] dlc = [ "Western Sahara", ] optionals = [ "caramel", ] mission = "test.VR" # Mission to launch directly into the editor with parameters = [ "-skipIntro", # These parameters are passed to the Arma 3 executable "-noSplash", # They do not need to be added to your list "-showScriptErrors", # You can add additional parameters here "-debug", "-filePatching", ] executable = "arma3" # Default: "arma3_x64" file_patching = false # Default: true binarize = true # Default: false rapify = false # Default: true # Launched with `hemtt launch vn` [hemtt.launch.vn] extends = "default" dlc = [ "S.O.G. Prairie Fire", ] # Launched with `hemtt launch ace` [hemtt.launch.ace] extends = "default" workshop = [ "463939057", # ACE3's Workshop ID ] ``` -------------------------------- ### HEMTT Launch Configuration (launch.toml) Source: https://hemtt.dev/commands/launch Example of a separate `.hemtt/launch.toml` file for defining launch configurations. This allows for cleaner separation of launch-specific settings, potentially extending default configurations. ```TOML [default] workshop = [ "450814997", # CBA_A3's Workshop ID ] [vn] extends = "default" dlc = [ "S.O.G. Prairie Fire", ] ``` -------------------------------- ### HEMTT Global Options Example Source: https://hemtt.dev/print Demonstrates the usage of global options for HEMTT commands, including thread count and verbosity level. ```shell hemtt ... -t 4 hemtt ... -vv ``` -------------------------------- ### HEMTT Launch Passthrough Arguments Example Source: https://hemtt.dev/print Shows how to pass additional arguments directly to the Arma 3 executable using the '--' separator with the 'hemtt launch' command. ```bash hemtt launch -- -world=empty -window ``` -------------------------------- ### HEMTT Launch Command Arguments Source: https://hemtt.dev/print Details the various command-line arguments available for the 'hemtt launch' command, used to start Arma 3 with specific configurations and options. ```APIDOC HEMTT Launch Command: Launches Arma 3 with specified configurations and arguments. Usage: hemtt launch [OPTIONS] [ARGUMENTS] Options: -e, --executable Executable to launch. Defaults to 'arma3_x64.exe'. Overrides the 'executable' option in the configuration file. Can be a relative path to the Arma 3 directory or an absolute path. Examples: -e arma3profiling_x64 -e "C:\\Program Files\\Steam\\steamapps\\common\\Arma 3\\arma3_x64.exe" -i, --instances Launches multiple instances of the game. Defaults to 1 if unspecified. -Q, --quick Skips the build step, launching the last built version. Throws an error if no build exists. -F, --no-filepatching Disables file patching. Equivalent to '-F' or '--no-filepatching' in Arma 3 startup. -o, --optional Include an optional addon folder. Can be used multiple times. Example: hemtt dev -o caramel -o chocolate -O, --all-optionals Include all optional addon folders. --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf). Files are copied directly into the PBO. Arguments: Launches with the specified configurations. Configured in .hemtt/project.toml or .hemtt/launch.toml. Passthrough additional arguments to Arma 3. Any options after '--' are passed to the executable. Useful for passing standard Arma 3 Startup Parameters. Example: hemtt launch -- -world=empty -window ``` -------------------------------- ### Compile HEMTT from Source Source: https://hemtt.dev/print Command to install HEMTT from its source code using the Rust package manager, Cargo. This requires having Rust and Cargo installed on your system. ```shell cargo install --path bin ``` -------------------------------- ### Minimum HEMTT Project Configuration Source: https://hemtt.dev/print Example of the minimal configuration file required for a HEMTT project, named `.hemtt/project.toml`. It specifies the mod's name and a prefix for its files. ```toml name = "Advanced Banana Environment" prefix = "abe" ``` -------------------------------- ### HEMTT Arma 3 Tools Configuration Source: https://hemtt.dev/installation/arma3tools Details on how HEMTT locates and uses Arma 3 Tools, including environment variable precedence and preferred installation paths on Linux. ```APIDOC HEMTT Arma 3 Tools Configuration: HEMTT relies on Arma 3 Tools for binarizing supported files (p3d, rtm, wrp). Location Precedence: 1. `HEMTT_BI_TOOLS` Environment Variable: If set, HEMTT will always use the path specified by this variable. 2. Linux Specific Paths: - `~/.local/share/arma3tools`: HEMTT prefers this path if the tools are installed here manually or via Steam. - `~/.local/share/armatools`: An alternative path HEMTT checks if the tools are installed within the Steam directory structure. 3. Wine/Proton Usage (Linux): - HEMTT prioritizes `wine64` for running Arma 3 Tools on Linux. - Proton may be used but is slower and can cause unexpected window pop-ups. Windows Installation: - Install Arma 3 Tools via [Steam](https://store.steampowered.com/app/233800/Arma_3_Tools/). - Run the tools at least once after installation to ensure registry keys are correctly set. ``` -------------------------------- ### PBOPREFIX Path with Actual Prefix Source: https://hemtt.dev/configuration/minimum Demonstrates the concrete path generated after substituting the `prefix` variable (e.g., 'abe') into the `$PBOPREFIX$` placeholder. This is a practical example of the path format. ```plaintext z\abe\addons\main ``` -------------------------------- ### HEMTT Custom Command Definition and Example Source: https://hemtt.dev/configuration/custom-commands This snippet demonstrates how to define a custom command for HEMTT projects using YAML. It includes the command's metadata, syntax, parameters, and an example of its usage in SQF. This is specific to projects using Intercept and injecting custom SQF commands. ```yaml name: bananize description: Bananize the player, forcing them to only throw bananas. syntax: - call: !Unary player ret: - Boolean - The success of the bananization params: - name: unit description: The unit to bananize type: Object argument_loc: Global effect_loc: Global examples: - bananize player ``` ```sqf bananize player ``` -------------------------------- ### HEMTT Hook Directory Structure Example Source: https://hemtt.dev/print Illustrates the typical file system layout for HEMTT hooks within the `.hemtt/hooks/` directory. It shows how hooks are organized by build phase (e.g., `pre_build`, `post_build`) and can be ordered using numerical prefixes. ```filesystem .hemtt └── hooks ├── pre_build │ ├── 01_example.rhai │ └── 02_example.rhai └── post_build ├── 01_example.rhai └── 02_example.rhai ``` -------------------------------- ### HEMTT Build Configuration (TOML) Source: https://hemtt.dev/commands/build Shows an example of the `.hemtt/project.toml` file for configuring the HEMTT build process. It specifically details the `[hemtt.build]` section, including the `optional_mod_folders` setting which controls how optional mod folders are handled during the build. ```toml [hemtt.build] optional_mod_folders = false # Default: true ``` -------------------------------- ### HEMTT Dev CLI Usage and Options Source: https://hemtt.dev/commands/dev Details the command-line interface for the 'hemtt dev' command, used for building projects during development. It outlines various options for including addons, controlling binarization, and managing build threads. ```CLI Build the project for development Usage: hemtt [OPTIONS] Options: -o, --optional Include an optional addon folder -O, --all-optionals Include all optional addon folders --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) -b, --binarize Use BI's binarize on supported files --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') 'hemtt dev' is designed to help your development workflows. It will build your mod into ".hemttout/dev", with links back to the original addon folders. This allows you to use file-patching with optional mods for easy development. Example usage: hemtt dev -o caramel -o chocolate ``` -------------------------------- ### SQF Capitalization Fix Example Source: https://hemtt.dev/utilities/sqf/case Demonstrates the transformation of SQF code by the HEMTT tool, correcting capitalization in commands and variable names. ```SQF private _positionASL = GetPosasl Player; // becomes private _positionASL = getPosASL player; ``` -------------------------------- ### Compile HEMTT from Source Source: https://hemtt.dev/installation/index Compiles and installs HEMTT from its source code repository using the Rust package manager, Cargo. This method requires a Rust development environment and is suitable for developers or users needing the latest unreleased features. ```bash cargo install --path bin ``` -------------------------------- ### HEMTT Project Configuration (TOML) Source: https://hemtt.dev/commands/dev Defines the project configuration for HEMTT using TOML format, specifically detailing the 'hemtt.dev' section for development build settings. The 'exclude' key allows specifying addons to be omitted from the development build. ```TOML [hemtt.dev] exclude = ["addons/unused"] ``` -------------------------------- ### hemtt launch Command Usage Source: https://hemtt.dev/commands/launch Provides the command-line interface usage for `hemtt launch`, detailing arguments for configurations and passthrough arguments, as well as available options for customizing the launch process. ```CLI Test your project Usage: hemtt [OPTIONS] [CONFIG]... [-- ...] Arguments: [CONFIG]... Launches with the specified configurations [PASSTHROUGH]... Passthrough additional arguments to Arma 3 Options: -e, --executable Executable to launch, defaults to `arma3_x64.exe` -i, --instances Launches multiple instances of the game -Q, --quick Skips the build step, launching the last built version -F, --no-filepatching Disables file patching -o, --optional Include an optional addon folder -O, --all-optionals Include all optional addon folders --no-rap Do not rapify (cpp, rvmat, sqm, bikb, bisurf) -b, --binarize Use BI's binarize on supported files --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') ``` -------------------------------- ### SQF ALL_CAPS Variable Example Source: https://hemtt.dev/print An example of SQF code that uses an ALL_CAPS variable (`DO_NOT_EXIST`), which could be mistaken for a macro. This lint rule helps prevent potential typos or unintended variable usage. ```SQF private _z = _y + DO_NOT_EXIST; ``` -------------------------------- ### hemtt new Command Usage Source: https://hemtt.dev/commands/new Demonstrates the command-line interface usage for creating a new HEMTT project. It outlines the primary command, its arguments, and available options for help. ```CLI Create a new project Usage: hemtt Arguments: The name of the new project Options: -h, --help Print help (see more with '--help') ``` -------------------------------- ### SQF Banned Command Example Source: https://hemtt.dev/print An example of an SQF script using a banned command (`echo`), which would be flagged by the linter. This rule helps prevent the use of commands that might be broken or removed in certain game versions. ```SQF echo "Hello World"; // Doesn't exist in the retail game ``` -------------------------------- ### HEMTT Padded Argument Warning Example Source: https://hemtt.dev/lints/preprocessor Shows an example of a preprocessor warning (PW3) for padded arguments in a macro call, where extra spaces around arguments can alter the output. A flag can be used to ignore this for specific macros. ```c++ #define Introduction(var1, var2) var1, meet var2 HELLO(Jim, Bob) ``` -------------------------------- ### Get Project Prefix (Rust) Source: https://hemtt.dev/rhai/library/project Retrieves the project's prefix. This method returns the specific prefix associated with the project. ```Rust HEMTT.project().prefix(); // "abe" ``` -------------------------------- ### PBOPREFIX Path Structure Source: https://hemtt.dev/configuration/minimum Illustrates the general structure for addon paths using the `$PBOPREFIX$` placeholder. This shows how the project's prefix is intended to be integrated into directory structures. ```plaintext z\{prefix}\addons\main ``` -------------------------------- ### Get Project Name (Rust) Source: https://hemtt.dev/rhai/library/project Retrieves the name of the project. This method returns the project's designated name as a string. ```Rust HEMTT.project().name(); // "Advanced Banana Environment" ``` -------------------------------- ### hemtt dev CLI Source: https://hemtt.dev/print Builds the project for development, placing output in `.hemttout/dev` with links back to original addon folders for file-patching. Supports optional addons and binarization. ```APIDOC hemtt dev Usage: hemtt [OPTIONS] Options: -o, --optional Include an optional addon folder -O, --all-optionals Include all optional addon folders --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) -b, --binarize Use BI's binarize on supported files --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') Description: Build the project for development `hemtt dev` is designed to help your development workflows. It will build your mod into `.hemttout/dev`, with links back to the original addon folders. This allows you to use file-patching with optional mods for easy development. Configuration: .hemtt/project.toml [hemtt.dev] exclude = ["addons/unused"] [hemtt.dev].exclude A list of addons to exclude from the development build. Includes from excluded addons can be used, but they will not be built or linked. Arguments: -o, --optional Include an optional addon folder This can be used multiple times to include multiple optional addons. Example: hemtt dev -o caramel -o chocolate -O, --all-optionals Include all optional addon folders --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) They will be copied directly into the PBO, not .bin version is created. -b, --binarize Use BI's binarize on supported files By default, `hemtt dev` will not binarize any files, but rather pack them as-is. Binarization is often not needed for development. --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level ``` -------------------------------- ### hemtt new CLI Source: https://hemtt.dev/print Creates a new project directory with initial files for a new mod. It prompts the user for mod details like name, author, prefix, and license. ```APIDOC hemtt new Usage: hemtt Arguments: The name of the new project Options: -h, --help Print help (see more with '--help') Description: Create a new project `hemtt new` is used to create a new mod. It will create a new folder with the name you provide, and create some starting files. It will ask for: * The full name of your mod * The author of your mod * The prefix of your mod * The main prefix of your mod * A license for your mod Arguments: The name of the new project This will create a new folder with the name you provide in the current directory. It should be a valid folder name, using only letters, numbers, and underscores. Example: `hemtt new my_mod` ``` -------------------------------- ### HEMTT Build Command Source: https://hemtt.dev/print Details the 'hemtt build' command, used to compile and prepare mods for testing. It binarizes files and creates output in .hemttout/build. ```APIDOC HEMTT Build Command: Build the project for final testing. Usage: hemtt build [OPTIONS] Description: 'hemtt build' will build your mod into `.hemttout/build`. It binarizes all applicable files and does not create folder links like 'hemtt dev'. Intended for local testing before release. Options: --no-bin Do not binarize the project. Files are copied directly into the PBO. Config.cpp, *.rvmat, *.ext, *.sqm, *.bikb, *.bisurf will still be rapified. This can be configured per addon in `addon.toml`. --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf). Files are copied directly into the PBO. This can be configured per addon in `addon.toml`. --just Only build the given addon. -t, --threads Number of threads to use for building. Defaults to the number of CPUs. -v... Verbosity level. -h, --help Print help information. Configuration: .hemtt/project.toml: [hemtt.build] optional_mod_folders = false # Default: true `optional_mod_folders` setting: By default, `hemtt build` creates separate mods for each optional mod folder. Setting this to `false` changes this behavior. ``` -------------------------------- ### Get Project Main Prefix (Rust) Source: https://hemtt.dev/rhai/library/project Retrieves the project's main prefix. If a main prefix is not set for the project, this method returns an empty string. ```Rust HEMTT.project().mainprefix(); // "z" ``` -------------------------------- ### hemtt launch Command Source: https://hemtt.dev/commands/launch Launches the Arma 3 game with various configurable options and arguments. This command allows specifying the executable, managing instances, controlling file patching and binarization, and passing custom parameters to the game. ```APIDOC hemtt launch [OPTIONS] [-- ] Launches the Arma 3 game with specified configurations and arguments. Configuration Sources: - .hemtt/project.toml (under hemtt.launch) - .hemtt/launch.toml Options: -e, --executable Executable to launch. Defaults to 'arma3_x64.exe'. Overrides the 'executable' option in the configuration file. Can be a relative path to the Arma 3 directory or an absolute path. Example: -e arma3profiling_x64 -e "C:\\Program Files\\Steam\\steamapps\\common\\Arma 3\\arma3_x64.exe" Launches with the specified configurations. -i, --instances Launches multiple instances of the game. Defaults to 1 if unspecified. -Q, --quick Skips the build step, launching the last built version. Throws an error if no build exists or no symlink is found. -F, --no-filepatching Disables file patching. Equivalent to '-F' or '--no-filepatching' in Arma 3. -o, --optional Include an optional addon folder. Can be used multiple times. Example: hemtt dev -o caramel -o chocolate -O, --all-optionals Include all optional addon folders. --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf). Files will be copied directly into the PBO. -b, --binarize Use BI's binarize on supported files. By default, 'hemtt dev' packs files as-is. Passthrough additional arguments to Arma 3. Any options after '--' are passed to the Arma 3 executable. Useful for passing additional [Startup Parameters](https://community.bistudio.com/wiki/Arma_3%3A_Startup_Parameters). Example: hemtt launch -- -world=empty -window ``` -------------------------------- ### SQF False Positive Example (Variables) Source: https://hemtt.dev/utilities/sqf/case Shows another potential false positive where variable names might be altered incorrectly, emphasizing the importance of verifying changes made by the tool. ```SQF private _value = player getVariable [QGVAR(showHud), false]; // becomes private _value = player getVariable [QGVAR(showHUD), false]; ``` -------------------------------- ### SQF False Positive Example (Macros) Source: https://hemtt.dev/utilities/sqf/case Illustrates a potential false positive where the HEMTT tool might incorrectly alter macro definitions or their usage, highlighting the need for manual review. ```SQF // script_macros.hpp #define FALSE 0 #define TRUE 1 // fnc_someFunction.sqf if (getNumber (configFile >> "someClass" >= TRUE)) then {...}; // becomes if (getNumber (configFile >> "someClass" >= true)) then {...}; ``` -------------------------------- ### hemtt Launch CLI Usage Source: https://hemtt.dev/print Provides the command-line interface usage for the `hemtt launch` command. It details arguments for specifying configurations and passthrough arguments, along with various options to control the launch process, such as executable selection, instance count, build skipping, file patching, and verbosity. ```APIDOC Usage: hemtt [OPTIONS] [CONFIG]... [-- ...] Arguments: [CONFIG]... Launches with the specified configurations [PASSTHROUGH]... Passthrough additional arguments to Arma 3 Options: -e, --executable Executable to launch, defaults to `arma3_x64.exe` -i, --instances Launches multiple instances of the game -Q, --quick Skips the build step, launching the last built version -F, --no-filepatching Disables file patching -o, --optional Include an optional addon folder -O, --all-optionals Include all optional addon folders --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) -b, --binarize Use BI's binarize on supported files --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') ``` -------------------------------- ### HEMTT Release CLI Usage Source: https://hemtt.dev/commands/release Details the command-line interface for building a project for release using HEMTT. Covers usage, options, and arguments. ```APIDOC HEMTT Release Command Build the project for release Usage: hemtt [OPTIONS] Options: --no-bin Do not binarize the project --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) --no-sign Do not sign the PBOs or create a `bikey`. --no-archive Do not create a zip archive of the release -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') Description: `hemtt release` will build your mod into `.hemttout/release`. It will create `bisign` files for all addons, and a `bikey` for validation. It is intended to be used for releasing your mod. It will create two zip archives in the `releases` folder: - `{name}-latest.zip` - `{name}-{version}.zip` Configuration: `hemtt release` is built the same way as [`hemtt build`](build.html), and will use its configuration. Arguments: --no-bin: Do not binarize the project. They will be copied directly into the PBO. `config.cpp`, `*.rvmat`, `*.ext`, `*.sqm`, `*.bikb`, `*.bisurf` will still be rapified. This can be configured per addon in [`addon.toml`](../configuration/addon#binarize). --no-rap: Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf). They will be copied directly into the PBO. This can be configured per addon in [`addon.toml`](../configuration/addon#rapify). --no-sign: Do not sign the PBOs or create a `bikey`. All public releases of your mods should be signed. This will be a requirement of many communities, and is an important security feature. Do not use this unless you know what you are doing. --no-archive: Do not create a zip archive of the release. The output will be in `.hemttout/release`. ``` -------------------------------- ### Rhai Variable Shadowing Source: https://hemtt.dev/rhai/index Illustrates variable shadowing in Rhai, where a variable redefined within a scope hides the outer variable. This example shows how inner scope variables affect output. ```Rhai let x = 1; print(x); // 1 { let x = 2; print(x); // 2 } print(x); // 1 ``` -------------------------------- ### HEMTT Addon Configuration: Properties Source: https://hemtt.dev/configuration/addon Allows adding custom properties to the PBO, similar to the 'properties' key in project.toml. The 'iso' property is an example of a custom metadata field that can be included. ```toml [properties] iso = "14001" ``` -------------------------------- ### HEMTT Build Command with --just option Source: https://hemtt.dev/print Builds a single addon for local testing. It is advised to use this only on large projects and to run a full build periodically to ensure all addons are up-to-date. ```shell hemtt build --just myAddon ``` -------------------------------- ### HEMTT Minimum Project Configuration Source: https://hemtt.dev/print The most basic configuration for a HEMTT project requires setting the 'name' and 'prefix' options. The 'name' is the mod's display name, and 'prefix' is used in addon folder structures. ```TOML name = "Advanced Banana Environment" prefix = "abe" ``` -------------------------------- ### Define Custom SQF Command Source: https://hemtt.dev/print Defines a custom SQF command using YAML format. This includes the command name, description, syntax with parameter types and return values, and usage examples. ```yaml name: bananize description: Bananize the player, forcing them to only throw bananas. syntax: - call: !Unary player ret: - Boolean - The success of the bananization params: - name: unit description: The unit to bananize type: Object argument_loc: Global effect_loc: Global examples: - bananize player ``` -------------------------------- ### HEMTT Redefine Macro Warning Example Source: https://hemtt.dev/lints/preprocessor Illustrates a common preprocessor warning (PW1) emitted when a macro is defined more than once. This can occur with direct redefinitions or through multiple inclusions of header files defining the same macro. ```c++ #define FOO 1 #define FOO 2 ``` -------------------------------- ### SQF: Simplify boolean comparisons Source: https://hemtt.dev/lints/sqf Checks for comparisons of variables directly to `true` or `false`, suggesting a more concise syntax. For example, `if (_x == true)` can be simplified to `if (_x)`, and `if (_y == false)` to `if (!_y)`. ```SQF if (_x == true) then {}; if (_y == false) then {}; ``` ```SQF if (_x) then {}; if (!_y) then {}; ``` -------------------------------- ### HEMTT Build/Dev --just Option API Source: https://hemtt.dev/print Allows building a single addon for the `build` and `dev` commands. It is advised to use this on large projects and run a full build periodically. ```APIDOC hemtt build --just hemtt dev --just Builds a single addon. Danger: It is advised to only use this on very large projects that take a long time to build. It is advised to only use this after running the command once without `--just` to ensure all addons are built. Anytime you run any git commands that can modify files, you should run without `--just` to ensure all addons are up to date. Before reporting any unexpected behavior, try running without `--just` first. ``` -------------------------------- ### hemtt build/dev --just Source: https://hemtt.dev/commands/index Builds a single addon for the `build` and `dev` commands. It can be used multiple times to build multiple addons. It is advised to only use this on very large projects that take a long time to build, and only after running the command once without `--just` to ensure all addons are built. Anytime git commands that can modify files are run, it's advised to run without `--just` to ensure all addons are up to date. Before reporting unexpected behavior, try running without `--just` first. ```APIDOC hemtt build --just myAddon hemtt dev --just myAddon Danger: It is advised to only use this on very large projects that take a long time to build. It is advised to only use this after running the command once without `--just` to ensure all addons are built. Anytime you run any git commands that can modify files, you should run without `--just` to ensure all addons are up to date. Before reporting any unexpected behavior, try running without `--just` first. ``` -------------------------------- ### HEMTT Minimum Project Configuration Source: https://hemtt.dev/configuration/minimum Defines the minimum configuration for a HEMTT project, requiring a `name` and `prefix`. This TOML file is essential for setting up a new mod and its associated paths. ```toml name = "Advanced Banana Environment" prefix = "abe" ``` -------------------------------- ### hemtt build/dev --just Source: https://hemtt.dev/commands Builds a single addon for the `build` and `dev` commands. It can be used multiple times to build multiple addons. It is advised to only use this on very large projects that take a long time to build, and only after running the command once without `--just` to ensure all addons are built. Anytime git commands that can modify files are run, it's advised to run without `--just` to ensure all addons are up to date. Before reporting unexpected behavior, try running without `--just` first. ```APIDOC hemtt build --just myAddon hemtt dev --just myAddon Danger: It is advised to only use this on very large projects that take a long time to build. It is advised to only use this after running the command once without `--just` to ensure all addons are built. Anytime you run any git commands that can modify files, you should run without `--just` to ensure all addons are up to date. Before reporting any unexpected behavior, try running without `--just` first. ``` -------------------------------- ### Format Current Date with date() Function Source: https://hemtt.dev/print Demonstrates the usage of the `date()` function to retrieve and format the current date and time. It shows two examples with different format specifiers, referencing external documentation for a full list of available patterns. ```rhai date("[year]-[month]-[day] [hour]:[minute]:[second]"); // {{ time_1 }} date("[year repr:last_two][month][day]"); // {{ time_2 }} ``` -------------------------------- ### HEMTT Project Main Prefix Configuration Source: https://hemtt.dev/configuration/index Configures the 'mainprefix' option, which sets the root prefix for the project. This is primarily used by the 'hemtt launch' command and should align with the '$PBOPREFIX$' placeholder in addon directories. ```toml mainprefix = "z" ``` -------------------------------- ### HEMTT Date Formatting Source: https://hemtt.dev/rhai/library/time Demonstrates the usage of the `date()` function in HEMTT for formatting dates and times. It shows examples of different format specifiers and their expected output. The formatting specifiers follow the conventions described in the Rust `time` crate documentation. ```HEMTT Templating date("[year]-[month]-[day] [hour]:[minute]:[second]"); // {{ time_1 }} date("[year repr:last_two][month][day]"); // {{ time_2 }} ``` -------------------------------- ### HEMTT Main Prefix Configuration Source: https://hemtt.dev/print Configures the root prefix for the project, which is applied before the 'prefix' option. This setting is primarily utilized by the 'hemtt launch' command. ```TOML mainprefix = "z" ``` -------------------------------- ### Rhai Script for Bumping Minor Version in Header File Source: https://hemtt.dev/print This Rhai script reads a C++ header file (script_version.hpp), finds a #define for the MINOR version, increments it, and writes the modified content back to the file. It uses HEMTT_RFS for file system operations and HEMTT.project().version() to get the current version. ```Rhai // Read the current contents of script_version.hpp let script_version = HEMTT_RFS.join("addons") .join("main") .join("script_version.hpp") .open_file() .read(); // Replace the current version with the new version let prefix = "#define MINOR "; let current = HEMTT.project().version().minor(); let next = current + 1; script_version.replace(prefix + current.to_string(), prefix + next.to_string()); // Write the modified contents to script_version.hpp HEMTT_RFS.join("addons") .join("main") .join("script_version.hpp") .create_file() .write(script_version); ``` -------------------------------- ### HEMTT Build CLI Usage Source: https://hemtt.dev/commands/build Demonstrates the command-line interface for building a HEMTT project for final testing. It outlines common options such as disabling binarization (`--no-bin`), disabling rapification (`--no-rap`), specifying threads (`-t`), and verbosity (`-v`). The build output is typically placed in `.hemttout/build`. ```cli Build the project for final testing Usage: hemtt [OPTIONS] Options: --no-bin Do not binarize the project --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf) --just Only build the given addon -t, --threads Number of threads, defaults to # of CPUs -v... Verbosity level -h, --help Print help (see more with '--help') ``` -------------------------------- ### Get Project Version (Rust) Source: https://hemtt.dev/rhai/library/project Retrieves the project's version information. It supports various formats including the full version string, a short version string, and individual components like major, minor, patch, and build numbers. The `.build()` method returns '0' if the build number is not set. ```Rust HEMTT.project().version().to_string(); // "1.3.0.1052" HEMTT.project().version().to_string_short(); // "1.3.0" HEMTT.project().version().major(); // 1 HEMTT.project().version().minor(); // 3 HEMTT.project().version().patch(); // 0 HEMTT.project().version().build(); // 1052 ``` -------------------------------- ### Unpack PBO File with HEMTT Source: https://hemtt.dev/utilities/pbo/unpack Unpacks a PBO file to a specified output directory. It creates a `$PBOPREFIX$` file and a `properties.txt` file in the output directory. Supports verbosity levels and help flags. ```CLI Unpack a PBO Usage: hemtt utils pbo unpack [OPTIONS] Arguments: PBO file to unpack Directory to unpack to Options: -v... Verbosity level -h, --help Print help ``` -------------------------------- ### HEMTT Release Command Source: https://hemtt.dev/print Details the 'hemtt release' command, used to build the project for distribution. It handles binarization, rapification, signing, and archiving. ```APIDOC HEMTT Release Command: Build the project for release. Usage: hemtt release [OPTIONS] Options: --no-bin Do not binarize the project. Files are copied directly into the PBO. Config.cpp, *.rvmat, *.ext, *.sqm, *.bikb, *.bisurf will still be rapified. --no-rap Do not rapify (cpp, rvmat, ext, sqm, bikb, bisurf). Files are copied directly into the PBO. --no-sign Do not sign the PBOs or create a `bikey`. --no-archive Do not create a zip archive of the release. -t, --threads Number of threads to use for building. Defaults to the number of CPUs. -v... Verbosity level. -h, --help Print help information. ``` -------------------------------- ### hemtt Launch Configuration (TOML) Source: https://hemtt.dev/print Defines how `hemtt launch` configures the Arma 3 mod launch process. Configurations can be stored in `.hemtt/project.toml` or `.hemtt/launch.toml`, allowing specification of workshop IDs, DLCs, presets, optional addons, missions, and custom launch parameters. ```toml # .hemtt/project.toml mainprefix = "z" # Launched with `hemtt launch` [hemtt.launch.default] workshop = [ "450814997", # CBA_A3's Workshop ID ] presets = [ "main", # .html presets from .hemtt/presets/ ] dlc = [ "Western Sahara", ] optionals = [ "caramel", ] mission = "test.VR" # Mission to launch directly into the editor with parameters = [ "-skipIntro", # These parameters are passed to the Arma 3 executable "-noSplash", # They do not need to be added to your list "-showScriptErrors", # You can add additional parameters here "-debug", "-filePatching", ] executable = "arma3" # Default: "arma3_x64" file_patching = false # Default: true binarize = true # Default: false rapify = false # Default: true # Launched with `hemtt launch vn` [hemtt.launch.vn] extends = "default" dlc = [ "S.O.G. Prairie Fire", ] # Launched with `hemtt launch ace` [hemtt.launch.ace] extends = "default" workshop = [ "463939057", # ACE3's Workshop ID ] # .hemtt/launch.toml [default] workshop = [ "450814997", # CBA_A3's Workshop ID ] [vn] extends = "default" dlc = [ "S.O.G. Prairie Fire", ] ```