# Vehicle-In-Vehicle Loading

This "framework" consists of only a couple of functions that you could add to your vehicles. If your vehicle already inherits from the Legion Studios LAAT/i or LAAT/c and does not overwrite the `UserActions` and/or `ACE_SelfActions` classes, you do not need to add these actions.

## 1. Configuration

### 1.1 Vanilla

Here is an example of adding the "load vehicle" user action to a vehicle.

```cpp
class CfgVehicles {
    class Helicopter_Base_F;
    class Helicopter_Base_H: Helicopter_Base_F {
        class UserActions;
    };
    class TAG_myCarrier: Helicopter_Base_H {
        class UserActions: UserActions {
            class TAG_loadVehicle {
                displayName = "Load vehicle";
                position = "pilotcontrol";
                radius = 5;
                onlyForPlayer = 0;
                // "ViV_exit" is a memory point on the LAAT/c that is used as the
                // center for the vehicle "scan". You can leave this as-is, and it
                // will use the vehicle's center if undefined.
                condition = "[this, ls_player] call ls_common_fnc_isPilot && { [this, 'ViV_exit'] call ls_vehicles_fnc_vivCanLoad }";
                statement = "this call ls_vehicles_fnc_vivLoad";
            };
        };
    };
};
```

### 1.2 ACE

Here is an example on adding the "load vehicle" and "unload vehicle" actions to a vehicle.

```cpp
class CfgVehicles {
    class Helicopter_Base_F;
    class Helicopter_Base_H: Helicopter_Base_F {
        class ACE_SelfActions;
    };
    class TAG_myCarrier: Helicopter_Base_H {
        class ACE_SelfActions: ACE_SelfActions {
            class TAG_loadVehicle {
                displayName = "Load vehicle";
                exceptions[] = {"isNotInside"};
                icon = "\A3\3DEN\data\cfgwaypoints\load_ca.paa";
                condition = "[_target_, _player] call ls_common_fnc_isPilot and {[_target] call ls_vehicles_fnc_vivCanLoad}";
                statement = "";
                insertChildren = "call ls_vehicles_fnc_vivLoad_insertChildren";
            };
            class TAG_unloadVehicle: TAG_loadVehicle {
                displayName = "Unload all vehicles";
                icon = "\A3\3DEN\data\cfgwaypoints\unload_ca.paa";
                condition = "getVehicleCargo _target isNotEqualTo [] and {[_target, _player] call ls_common_fnc_isPilot}";
                statement = "_target call ls_vehicles_fnc_vivUnload";
                insertChildren = "call ls_vehicles_fnc_vivUnload_insertChildren";
            };
        };
    };
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legion-studios.gitbook.io/legion-studios/frameworks/vehicle-in-vehicle-loading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
